diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index fab8d6ea8..eabb7adc4 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -38,6 +38,7 @@ class BidsController < ApplicationController @bids = @bids.offset(@offset).limit(@limit).all.reverse else limit = @bid_count % @limit + limit = @limit if limit == 0 @bids = @bids.offset(@offset).limit(limit).all.reverse end @s_state = 0 @@ -46,6 +47,7 @@ class BidsController < ApplicationController @bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse else limit = @bid_count % @limit + limit = @limit if limit == 0 @bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse end @s_state = 1 @@ -54,6 +56,7 @@ class BidsController < ApplicationController @bids = @bids.offset(@offset).limit(@limit).all.reverse else limit = @bid_count % @limit + limit = @limit if limit == 0 @bids = @bids.offset(@offset).limit(@limit).all.reverse end @s_state = 0 @@ -63,6 +66,7 @@ class BidsController < ApplicationController @bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse else limit = @bid_count % @limit + limit = @limit if limit == 0 @bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse end @s_state = 1 diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 965f1dd0e..c12a8ea0e 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -21,11 +21,11 @@
<% if session[:enterprise_college] == 2 %> - <%=render :partial => 'layouts/base_enterprise_header'%> + <%= render :partial => 'layouts/base_enterprise_header'%> <% elsif session[:enterprise_college] == 1 %> - <%=render :partial => 'layouts/base_college_header'%> + <%= render :partial => 'layouts/base_college_header'%> <% else %> - <%=render :partial => 'layouts/base_header'%> + <%= render :partial => 'layouts/base_header'%> <% end %>
@@ -38,33 +38,29 @@ <% @course = Course.find_by_extra(@project.identifier)%> - + + <% end %> -
- <% if(@project.project_type==1)%> - - <% if get_avatar?(@project)%> - <%= link_to image_tag(url_to_avatar(@project), :class => "avatar2"), project_path(@project) %> - <% else %> - <%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(@project)%> - <% end %> - <% else %> - <%= link_to image_tag(url_to_avatar(@project), :class => "avatar2") %> - <% end %> - <% if(@project.project_type==1)%> + + <% if get_avatar?(@project)%> + <%= link_to image_tag(url_to_avatar(@project), :class => "avatar2"), project_path(@project) %> + <% else %> + <%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(@project)%> + <% end %> + <% else %> + <%= link_to image_tag(url_to_avatar(@project), :class => "avatar2") %> + <% end %>
- <%= @project.name %> -
- <% unless @course.teacher.id == User.current.id%> + <%= @project.name %> + <% unless @course.teacher.id == User.current.id%> <%= join_in_course(@project, User.current)%> - <% end %> -
+
- + <% files_count = @project.attachments.count %> @@ -72,65 +68,64 @@ <% files_count += version.attachments.count %> <% end %> - - - + + + - - + +
<%=link_to "#{@project.members.count}", project_member_path(@project) ,:course =>'1'%><%=link_to files_count, project_files_path(@project) %><%= link_to "#{@project.members.count}", project_member_path(@project) ,:course =>'1'%><%= link_to files_count, project_files_path(@project) %>
<%= "成员" %> <%= "成员" %><%= l(:label_course_data) %>
- - -
- - - - - - + + +
+
<%= l(:label_main_teacher) %><%= @course.teacher.lastname+@course.teacher.firstname %>
+ + + + - - - - - - - + + + + + + + - <% unless @course.teacher.user_extensions.nil?%> - - - - <% else %> - - - - <% end %> - -
<%= l(:label_main_teacher) %><%= @course.teacher.lastname+@course.teacher.firstname %>
<%= l(:label_course_time) %><%= @course.time %>
<%= l(:label_main_term) %><%= @course.term %>
<%= l(:label_course_time) %><%= @course.time %>
<%= l(:label_main_term) %><%= @course.term %>
<%= l(:label_teacher_work_unit) %><%= @course.teacher.user_extensions.occupation %>
<%= l(:label_teacher_work_unit) %><%= l(:field_course_un) %>
+ <% unless @course.teacher.user_extensions.nil?%> + + <%= l(:label_teacher_work_unit) %><%= @course.teacher.user_extensions.occupation %> + + <% else %> + + <%= l(:label_teacher_work_unit) %><%= l(:field_course_un) %> + + <% end %> -
-
+ + +
+
<%= l(:label_project_overview) %>
- +
<% if @project.description.size>0 %>
- + <%= textilizable @project.description %>
<% else %>
- <%= l(:label_course_description_no) %> + <%= l(:label_course_description_no) %>
<% end %>
@@ -139,50 +134,42 @@
- - -
- -
+ + +
+ +
<%= render :partial => 'tags/tag', :locals => {:obj => @project,:object_flag => "2"}%> -
+
+
- - - -
-
+
    -
  • <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%>
  • -
  • <%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Homework')%>
  • -
  • <%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
  • -
  • <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%>
  • - - <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%> -
  • <%= link_to l(:label_course_settings), {:controller => 'projects', :action => 'settings', :id => @project}, :class => link_class(:settings)%>
- <% end %> +
  • + <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%> +
  • +
  • + <%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Homework')%> +
  • +
  • + <%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%> +
  • +
  • + <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%> +
  • + + <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%> +
  • + <%= link_to l(:label_course_settings), {:controller => 'projects', :action => 'settings', :id => @project}, :class => link_class(:settings)%> +
  • + + <% end %>
    <%= yield %> <%= call_hook :view_layouts_base_content %> diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 619e96985..dca67df5a 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -8,15 +8,14 @@ <%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(project)%> <% end %> <% else %> - <%=link_to image_tag(url_to_avatar(project), :class => "avatar2"), project_path(project) %> - <% end %> + <%= link_to image_tag(url_to_avatar(project), :class => "avatar2"), project_path(project) %>

    <%= textilizable(project.short_description, :project => project) %>

    - +

    <%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %> @@ -31,26 +30,54 @@ <%= content_tag('span', "#{@project.repository.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %><%= content_tag('span', l(:label_commit_on)) %>

    - + <% end %> + <% if(@project.project_type==1)%> +
    +
    +

    + <%= textilizable(project.short_description, :project => project) %> +

    +
    + +
    +

    + <%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %> +

    +

    + <%= content_tag('span', "#{@project.homeworks.count}", :class => "info") %><%= content_tag('span', l(:label_x_task, :count => @project.users.count)) %> +

    +

    + <%= content_tag('span', "#{@project.members.count}", :class => "info") %><%= content_tag('span', l(:label_x_member)) %> +

    +

    + <% files_count = @project.attachments.count %> + <% @project.versions.each do |version| %> + <% files_count += version.attachments.count %> + <% end %> + <%= content_tag('span', files_count, :class => "info") %><%= content_tag('span', l(:label_x_data)) %> +

    +
    +<% end %> +
    - <% if(@project.project_type==1)%> - <%= content_tag('span', "#{l(:field_tea_name)}: ") %> + <% if(@project.project_type==1)%> + <%= content_tag('span', "#{l(:field_tea_name)}: ") %> <% else %> - <%= content_tag('span', "#{l(:default_role_manager)}: ") %> - <% end %> + <%= content_tag('span', "#{l(:default_role_manager)}: ") %> + <% end %> <% @admin = @project.project_infos%> <% if @admin.size > 0 %> <%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %> - <% end %> + <% end %> <% if(@project.project_type==1)%>    大学: - <%= @admin.first.user.user_extensions.occupation %> - <% end %> + <%= @admin.first.user.user_extensions.occupation %> + <% end %>
    <%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %> @@ -64,10 +91,10 @@
    - + <%= image_tag( "/images/sidebar/tags.png") %> - + <%= render :partial => 'tags/tag_name', :locals => {:obj => @project,:object_flag => "2",:non_list_all => true }%> - +
    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4fef1ff7c..3a7f9a85b 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1550,4 +1550,9 @@ zh: label_third_reward: 三等奖 label_excellence_reward: 优秀奖 label_comfort_reward: 入围奖 - label_course_settings: 课程设置 \ No newline at end of file + label_course_settings: 课程设置 + +#added by nie + label_x_task: 份作业 + label_x_member: 个成员 + label_x_data: 份资料