课程里面添加了图片上传功能

This commit is contained in:
huangjingquan 2013-10-30 20:50:35 +08:00
parent 8a37f924f9
commit b113719b46
2 changed files with 5 additions and 4 deletions

View File

@ -38,9 +38,8 @@
<% @course = Course.find_by_extra(@project.identifier)%> <% @course = Course.find_by_extra(@project.identifier)%>
<table> <table>
<tr> <tr>
<td> <% if(@project.project_type==1)%> <td><% if(@project.project_type==1) %>
<% if get_avatar?(@project) %>
<% if get_avatar?(@project)%>
<%= link_to image_tag(url_to_avatar(@project), :class => "avatar2"), project_path(@project) %> <%= link_to image_tag(url_to_avatar(@project), :class => "avatar2"), project_path(@project) %>
<% else %> <% else %>
<%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(@project)%> <%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(@project)%>

View File

@ -5,7 +5,9 @@
<!--[form:project]--> <!--[form:project]-->
<% unless @project.new_record? %>
<p><%= render :partial=>"avatar/avatar_form",:locals=> {source:@project} %></p>
<% end %>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %></p> <p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %></p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p><!--by young--> <p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p><!--by young-->