course_form

This commit is contained in:
yanxd 2014-05-20 14:52:30 +08:00
parent d47facc9e8
commit 7189d9a14a
1 changed files with 58 additions and 55 deletions

View File

@ -1,56 +1,59 @@
<div class="content_frame"> <div class="content_frame">
<ul class="user_project_sort"> <ul class="user_project_sort">
<% for membership in memberships %> <% for membership in memberships %>
<li> <li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;"> <table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr> <tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td> <td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td>
<td> <td>
<table width="580" border="0"> <table width="580" border="0">
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<span><%= link_to_project(membership.project) %></span> <span><%= link_to_project(membership.project) %></span>
<!--added by huang for: filter by roles--> <span style="float: right">
<span style="float: right"> <%= render :partial => 'courses/set_course_time', :locals => {:project => membership.project} %>
<%=render :partial => 'courses/set_course_time', :locals => {:project => membership.project} %> <% if User.current == @user %>
<% if User.current == @user %> <% (membership.roles).each do |role| %>
<% (membership.roles).each do |role| %> <% unless (role == Role.find(9) || role == Role.find(3)) %>
<% unless (role == Role.find(9) || role == Role.find(3)) %> <%= join_in_course(membership.project, User.current) %>&nbsp;&nbsp;&nbsp;&nbsp;
<%= join_in_course(membership.project, User.current)%>&nbsp;&nbsp;&nbsp;&nbsp; <% end %>
<% end %> <% end %>
<% end %> <% else %>
<% else %> <% end %>
<% end %> <%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>
<!--end--> (<%= "#{membership.project.members.count}" %>)&nbsp;&nbsp;
<%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)&nbsp;&nbsp; <%= l(:label_homework) %>
<%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>) (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
&nbsp;&nbsp; &nbsp;&nbsp;
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>) <%= l(:label_course_news) %>
</span></td> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)
</tr> </span></td>
<tr> </tr>
<td colspan="2" width="580" > <tr>
<p class="font_description"> <td colspan="2" width="580">
<%= membership.project.description %> <p class="font_description">
</p></td> <%= membership.project.description %>
</tr> </p></td>
<tr><td> </tr>
<tr>
<!-- added by bai --> <td>
<% @course = Course.find_by_extra(membership.project.identifier)%>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %> <% @course = Course.find_by_extra(membership.project.identifier) %>
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.name, user_path(@course.teacher)) %></span> <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
<span style="float: right; padding-left: 8px" ><%= l(:label_course_term) %> : <%= @course.time %><%= @course.term %></span> <span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %>
<!-- <span class="font_lighter" style="float: right"><%= l(:label_create_time) %> <%= format_time(membership.created_on) %></span> --> : <%= link_to(@course.teacher.name, user_path(@course.teacher)) %></span>
<% end %> <span style="float: right; padding-left: 8px"><%= l(:label_course_term) %>
</td></tr> : <%= @course.time %><%= @course.term %></span>
</table></td> <% end %>
</tr> </td>
</table> </tr>
</li> </table>
</td>
<% end %> </tr>
</table>
</ul> </li>
</div>
<%= call_hook :view_account_left_bottom, :user => @user %> <% end %>
</ul>
</div>
<%= call_hook :view_account_left_bottom, :user => @user %>