socialforge/app/views/courses/_course.html.erb

91 lines
3.5 KiB
Plaintext
Raw Normal View History

<div class="project-block">
2013-11-05 20:46:38 +08:00
<div class="img-tag-2">
2014-06-10 15:44:37 +08:00
<% if get_avatar?(course)%>
<%= image_tag(url_to_avatar(course), :class => "avatar2") %>
2013-11-05 20:46:38 +08:00
<% else %>
2014-06-10 15:44:37 +08:00
<%= image_tag('../images/avatars/course/course.jpg', :class => "avatar2") %>
2013-11-05 20:46:38 +08:00
<% end %>
</div>
<div class="wiki-description">
<p >
<%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%>
<% unless @course.is_public == 1 %>
<span class='private_project'>
<%= l(:label_private) %>
</span>
<% end %>
<%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info #{User.current.member_of_course?(@course) ? 'my-project' : nil}"))%>
2013-11-05 20:46:38 +08:00
</p>
<p >
<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%>
2014-06-10 15:44:37 +08:00
<% @admin = @course.course_infos%>
2014-06-03 09:56:54 +08:00
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
2014-07-05 11:00:01 +08:00
<% unless @course.teacher.user_extensions.school.nil? %>
<%= link_to(@course.school.try(:name), school_course_list_path(@course.school)) if @course.school %>
2014-07-05 11:00:01 +08:00
<% end %>
2013-11-05 20:46:38 +08:00
<% end %>
</p>
<p >
<%= content_tag('div', "#{l(:field_teacher_name)}:", :class => "info course-font teacher") %>
<% if @admin.size > 0 %>
<%= content_tag('a', @admin.collect{|u| link_to(u.user.lastname+u.user.firstname, user_path(u.user_id))}.join(", ").html_safe) %>
<% end %>
</p>
2013-11-05 20:46:38 +08:00
</div>
<div class="information_for_course" >
<p class="stats">
2014-06-10 15:44:37 +08:00
<%= content_tag('span', link_to("#{@course.homeworks.count}", homework_course_path(@course)), :class => "info") %>
<%= content_tag('span', l(:label_x_task, :count => @course.homeworks.count)) %>
2013-11-05 20:46:38 +08:00
</p>
<p class="stats">
2014-06-10 15:44:37 +08:00
<% files_count = @course.attachments.count %>
<%= content_tag('span', link_to(files_count, course_files_path(@course)), :class => "info") %>
2013-11-05 20:46:38 +08:00
<%= content_tag('span', l(:label_x_data,:count => files_count)) %>
</p>
<p class="stats">
2014-06-10 15:44:37 +08:00
<%= content_tag('span', "#{garble @course.members.count}", :class => "info") %>
<%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>
2013-11-05 20:46:38 +08:00
</p>
2014-04-24 09:13:06 +08:00
<!--gcm-->
<p class="stats">
2014-06-10 15:44:37 +08:00
<%= content_tag('span', link_to("#{@course_activity_count[@course.id]}", course_path(@course)), :class => "info") %>
<%= content_tag('span', l(:label_x_activity, :count => @course_activity_count[@course.id])) %>
2014-04-24 09:13:06 +08:00
</p>
<!--gcm-->
2013-11-06 10:28:18 +08:00
<div class="buttons_for_course" style="margin-top:30px;margin-left:144px">
2013-11-05 20:46:38 +08:00
<span class="info"></span>
<% if(course_endTime_timeout? @course) %>
2014-03-07 11:28:52 +08:00
<span class="font_lighter">
<%= l(:lable_course_end) %>
2014-03-07 11:28:52 +08:00
</span>
2014-06-10 15:44:37 +08:00
<% else %>
<%= join_in_course_for_list(@course, User.current,['regular'])%>
2014-06-10 15:44:37 +08:00
<% end -%>
2013-11-05 20:46:38 +08:00
</div>
</div>
</div>
<div class="add-info">
<div class="main-language" style="margin-left: 30px;margin-top:-10px">
<%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%>
2014-06-10 15:44:37 +08:00
<%= get_course_term @course %>
2013-11-05 20:46:38 +08:00
</div>
</div>
<div class="add-info" style="margin-left: 30px; margin-top: -20px">
<%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %>
2014-06-10 15:44:37 +08:00
<%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
2013-11-05 20:46:38 +08:00
</div>
<div class="tags">
<div id="tags">
<%= image_tag( "/images/sidebar/tags.png") %>
2014-06-10 15:44:37 +08:00
<%= render :partial => 'tags/tag_name', :locals => {:obj => @course,:object_flag => "9",:non_list_all => true }%>
2013-11-05 20:46:38 +08:00
</div>
</div>