socialforge/app/views/layouts/base_courses.html.erb

195 lines
9.4 KiB
Plaintext
Raw Normal View History

<% course_model %>
<% teacher_num = teacherCount(@course) %>
<% student_num = studentCount(@course) %>
2015-03-18 15:18:06 +08:00
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
2013-12-11 10:00:38 +08:00
<!DOCTYPE html>
<html lang="en">
2014-05-19 17:56:39 +08:00
<head>
<meta charset="utf-8">
<title>
<%= h html_title %>
</title>
2014-05-19 17:56:39 +08:00
<meta name="description" content="<%= Redmine::Info.app_name %>"/>
<meta name="keywords" content="issue,bug,tracker"/>
<%= csrf_meta_tag %>
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'public', 'leftside', 'courses'%>
2015-03-18 10:15:10 +08:00
<%= javascript_include_tag "course","header" %>
2014-05-19 17:56:39 +08:00
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<!--add by huang-->
<body>
<div id="Container">
<%= render :partial => 'layouts/new_header' %>
2015-03-18 10:47:30 +08:00
<div class="cl"></div>
<div id="TopBar">
<div class="topbar_info02 fl">
2015-03-17 18:02:46 +08:00
<h2>
<a href="http://<%= Setting.host_course%>" target="_blank" class="c_blue">
<%= l(:label_courses_community)%>
</a>
</h2>
<p>
<%= l(:label_user_location) %> :
<%= link_to l(:field_homepage), home_path %>
>
<a href="http://<%= Setting.host_course%>">
<%=l(:label_courses_management_platform)%>
</a>
>
<%= link_to @course.name, nil %>
</p>
</div>
<div class="search fl">
2015-03-17 18:02:46 +08:00
<%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get, :class => "search_form") do %>
<%= text_field_tag 'name', params[:name], :placeholder => "课程名称", :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %>
<a href="#" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
<%= l(:label_search)%>
</a>
<br />
<span id="project_name_span" style="float: left"></span>
<% end %>
</div>
</div><!--TopBar end-->
<div class="cl"></div>
2015-03-18 10:47:30 +08:00
<div id="content">
<div id="LSide" class="fl">
<div class="project_info">
2015-03-18 10:15:10 +08:00
<div class="pr_info_logo fl mr10 mb5">
<!--<a href="#"><img src="images/courses/pic_courses.jpg" width="60" height="60" alt="logo" /></a>-->
<% if get_avatar?(@course) %>
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
<% else %>
<%= link_to image_tag('../images/avatars/course/course.jpg', :width => "60", :height => "60"), course_path(@course) %>
<% end %>
</div>
<div class="pr_info_id fl mb5 f14">
ID:<%= @course.id%>
</div>
<div class="pr_info_join fl">
<% if is_teacher%>
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, {:controller => 'courses', :action => 'settings', :id => @course}, :class => "pr_join_a" %>
<%= set_course_time @course%>
<%= link_to "<span class='pr_copy'></span>#{l(:button_copy)}".html_safe, copy_course_course_path(@course.id), :class => "pr_join_a" %>
<% else%>
2015-03-27 19:50:01 +08:00
<div id="join_in_course_header"><%= join_in_course_header(@course, User.current) %></div>
<% end%>
2015-03-18 10:15:10 +08:00
</div>
<div class="cl"></div>
2015-03-18 10:15:10 +08:00
<div >
<a class="pr_info_name fl c_dark fb" href="courses/<%= @course.id%>" target="_blank">
2015-03-18 10:15:10 +08:00
<%= @course.name %>
<% if @course.is_public == 0%>
<span class="img_private ">
<%= l(:field_is_private)%>
</span>
<% end %>
</a>
</div>
<div class="cl"></div>
2015-03-18 15:18:06 +08:00
<div class="pr_info_foot ">
<%= l(:label_account_identity_teacher)%><%= course_teacher_link teacher_num %>
<span>|&nbsp;</span>
<%= l(:label_account_identity_student)%><%= course_student_link student_num %>
<span>|&nbsp;</span>
<%= l(:project_module_attachments)%><%= link_to @course.attachments.count, course_files_path(@course), :class => 'info_foot_num c_blue' %></div>
<div class="cl"></div>
</div><!--课程信息 end-->
<div class="info_box">
<ul>
2015-03-18 15:18:06 +08:00
<li><%= l(:label_main_teacher)%> :&nbsp;&nbsp;<%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li>
<li><%= l(:label_class_period)%> :&nbsp;&nbsp;<span ><%= @course.class_period %> <%= l(:label_class_hour) %></span></li>
<li><%= l(:label_main_term)%> :&nbsp;&nbsp;<span><%= @course.time %> <%= @course.term %></span></li>
<% if @course.school%>
<li><%= l(:label_course_organizers)%> :&nbsp;&nbsp;<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.school.id%>" target="_blank" class="c_dblue"><%= @course.school%></a></li>
<% end%>
</ul>
</div>
<div class="subNavBox">
2015-03-18 15:18:06 +08:00
<div class="subNav">
<%= link_to l(:label_activity), course_path(@course), :class => "f14 c_blue02" %>
<!--暂时不显示课程动态数,优化后在显示-->
<%= link_to "(#{course_activity_count @course})", course_path(@course), :class => "subnav_num c_orange"%>
</div>
2015-03-18 15:18:06 +08:00
<div class="subNav">
<%= link_to l(:label_homework), homework_course_path(@course), :class => "f14 c_blue02"%>
<%= link_to "(#{@course.homeworks.count})", homework_course_path(@course), :class => "subnav_num c_orange"%>
<%= link_to( "+#{l(:label_course_homework_new)}", new_homework_course_path(@course), :class => 'subnav_green c_white') if is_teacher %>
</div>
2015-03-18 15:18:06 +08:00
<div class="subNav">
<%= link_to l(:label_course_news), course_news_index_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.news.count})", course_news_index_path(@course), :class => "subnav_num c_orange"%>
<%= link_to( "+#{l(:label_course_news_new)}", new_course_news_path(@course), :class => 'subnav_green c_white') if is_teacher %>
</div>
2015-03-18 15:18:06 +08:00
<div class="subNav">
<%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %><%= link_to "(#{@course.attachments.count})", course_files_path(@course), :class => "subnav_num c_orange" %><%= link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white') if is_teacher %>
</div>
2015-03-18 15:18:06 +08:00
<div class="subNav">
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.boards[0].topics.count})", course_boards_path(@course), :class => "subnav_num c_orange" %>
2015-03-27 11:57:49 +08:00
<%= link_to( "+#{l(:label_message_new)}", new_board_message_path(@course.boards[0]), :class => 'subnav_green ml95 c_white') if User.current.member_of_course?(@course) %>
</div>
2015-03-18 15:18:06 +08:00
<div class="subNav">
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{course_feedback_count})", course_feedback_path(@course), :class => "subnav_num c_orange" %>
</div>
2015-03-18 15:18:06 +08:00
<div class="subNav">
2015-03-19 15:04:44 +08:00
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => " f14 c_blue02"%>
<%= link_to "(#{course_poll_count})", poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => "subnav_num c_orange" %>
<%= link_to( "+#{l(:label_new_poll)}", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'subnav_green c_white') if is_teacher %>
</div>
2015-03-18 15:18:06 +08:00
</div><!--项目侧导航 end-->
<div class="cl"></div>
<div class="project_intro">
<div id="course_description" class="course_description">
<h4 ><%= l(:label_course_brief_introduction)%></h4>
<div id="course_description_content">
<%= textilizable(@course.description) if @course.description && !@course.description.blank? %>
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
2015-03-18 15:18:06 +08:00
<%= l(:label_expend_information)%>
<span class="g-arr-down">
<img src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
2015-03-18 15:18:06 +08:00
</div><!--项目简介 end-->
<div class="project_Label">
<h4 class="mb5" ><%= l(:label_tag)%>:</h4>
<div class="tag_h" >
<%= render :partial => 'tags/new_tag', :locals => {:obj => @course, :object_flag => "9"} %>
</div>
<div class="cl"></div>
2015-03-18 15:18:06 +08:00
</div><!--项目标签 end-->
</div><!--LSide end-->
<div id="RSide" class="fl">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
</div>
<div style="clear:both;"></div>
</div><!--Content end-->
2015-03-18 10:47:30 +08:00
<div class="cl"></div>
2015-03-18 15:18:06 +08:00
<%= render :partial => 'layouts/new_footer' %>
2015-03-18 10:47:30 +08:00
<div class="cl"></div>
</div><!--Container end-->
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
<%= call_hook :view_layouts_base_body_bottom %>
2014-05-19 17:56:39 +08:00
</body>
2014-05-20 09:12:15 +08:00
2013-09-14 09:51:26 +08:00
</html>