From cf2810f1c68bab0f722b451814eeeaad619de4f3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 15:13:11 +0800 Subject: [PATCH 01/12] =?UTF-8?q?#1712=E7=82=B9=E5=87=BB=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=9F=90=E7=AB=9E=E8=B5=9B=E4=BD=9C=E5=93=81=EF=BC=8C=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E5=90=8D=E6=98=BE=E7=A4=BA=E4=B8=BA=E6=89=98=E7=AE=A1?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/softapplications_controller.rb | 2 +- .../layouts/_base_softapplication_top_content.html.erb | 3 ++- app/views/softapplications/show.html.erb | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index 5b6111187..e47cfc2ff 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -48,7 +48,7 @@ class SoftapplicationsController < ApplicationController def show @softapplication = Softapplication.find(params[:id]) - @project = @softapplication.project + #@project = @softapplication.project # 打分统计 stars_reates = @softapplication. rates(:quality) diff --git a/app/views/layouts/_base_softapplication_top_content.html.erb b/app/views/layouts/_base_softapplication_top_content.html.erb index afa2e1d29..46d45c903 100644 --- a/app/views/layouts/_base_softapplication_top_content.html.erb +++ b/app/views/layouts/_base_softapplication_top_content.html.erb @@ -17,7 +17,8 @@ <%=link_to l(:field_homepage), home_path %> > <%= l(:label_contest_innovate) %> - <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> + <% contest = @softapplication.contests.first %> + <%= contest ? link_to(">" + contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 7a2edfa1f..77cc6aa71 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -1,4 +1,5 @@ <%= render :partial => 'layouts/base_softapplication_top_content' %> +<% html_title(@softapplication.name) -%>
@@ -47,8 +48,9 @@ - <% if @project %> - <%=l(:label_attendingcontestwork_deposit_project)%>:<%= link_to "#@project", project_path(@project) %> + <% if @softapplication.project %> + <%=l(:label_attendingcontestwork_deposit_project)%>: + <%= link_to "#{@softapplication.project}", project_path(@softapplication.project) %> <% end %> From 9280da5b61e298ec2b473647b560f27c4c1dedb3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 15:19:03 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/course.rb b/app/models/course.rb index ef42d91e8..196e7168d 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -36,7 +36,7 @@ class Course < ActiveRecord::Base acts_as_attachable :view_permission => :view_course_files, :delete_permission => :manage_files - validates_presence_of :password, :term,:name,:description + validates_presence_of :password, :term,:name validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ validates_length_of :description, :maximum => 10000 From 5966a1edb6ac417d6fe74163422a5209cd4326f1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 16:20:58 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84=E6=97=B6=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 2 +- app/views/bids/_alert_anonyoms.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 72755dc6a..5c4542944 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -348,7 +348,7 @@ class HomeworkAttachController < ApplicationController else end else - render_403 :message => :notice_not_authorized + render_403 end end diff --git a/app/views/bids/_alert_anonyoms.html.erb b/app/views/bids/_alert_anonyoms.html.erb index e4e9076a5..567a3f81f 100644 --- a/app/views/bids/_alert_anonyoms.html.erb +++ b/app/views/bids/_alert_anonyoms.html.erb @@ -50,8 +50,8 @@

开启匿评功能

开启匿评后学生将不能对作业进行 - 提交、修改、删除 - 等操作,目前有 + 提交作业 + 操作,目前有 <%= totle_size%>个 学生,共提交了 <%= cur_size %> From 3d81331f439939039b49b868abc71ccf5fd9051b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 16:21:17 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84=E6=97=B6=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_alert_anonyoms.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/bids/_alert_anonyoms.html.erb b/app/views/bids/_alert_anonyoms.html.erb index 567a3f81f..f26487126 100644 --- a/app/views/bids/_alert_anonyoms.html.erb +++ b/app/views/bids/_alert_anonyoms.html.erb @@ -50,8 +50,8 @@

开启匿评功能

开启匿评后学生将不能对作业进行 - 提交作业 - 操作,目前有 + 修改、删除 + 等操作,目前有 <%= totle_size%>个 学生,共提交了 <%= cur_size %> From 813f2d10266ad907b885c997a8b3282449393e38 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Dec 2014 09:33:26 +0800 Subject: [PATCH 05/12] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E7=BC=BA=E9=99=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=82=B9=E8=B5=9E=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E4=BD=8D=202.=E4=BF=AE=E5=A4=8D=E5=BD=93=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E9=9D=9E=E5=B8=B8=E7=9F=AD=EF=BC=8C=E6=88=96=E8=80=85?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=8F=8F=E8=BF=B0=E6=97=B6=EF=BC=8C=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E5=88=97=E8=A1=A8=E4=B8=AD=E7=BC=BA=E9=99=B7=E7=9A=84?= =?UTF-8?q?=E6=8C=87=E6=B4=BE=E4=BA=BA=E3=80=81=E6=9F=A5=E7=9C=8B=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_list.html.erb | 116 ++++++++++++++++---------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 39fd3776f..58960df4c 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -1,67 +1,69 @@

-
+ + <% end -%> + + +
+ <% end -%> + \ No newline at end of file From 5ad2d22f98d893ed22a30fa07a3ef287d30b4c3e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Dec 2014 09:58:16 +0800 Subject: [PATCH 06/12] =?UTF-8?q?#1724=20=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=94=A8=E6=88=B7=E5=9C=A8=E8=AF=BE=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E6=9C=892=E4=B8=AA=E9=80=80=E5=87=BA?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_form.html.erb | 47 +++++++++++++++-------- app/views/users/_my_joinedcourse.html.erb | 16 ++++---- app/views/users/user_courses.html.erb | 1 - 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/app/views/users/_course_form.html.erb b/app/views/users/_course_form.html.erb index 6784faf89..02ba782ec 100644 --- a/app/views/users/_course_form.html.erb +++ b/app/views/users/_course_form.html.erb @@ -4,31 +4,40 @@
  • - +
    <%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %> + <%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %> + + ( + + <%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %> + ) + + diff --git a/app/views/users/_my_joinedcourse.html.erb b/app/views/users/_my_joinedcourse.html.erb index 74be37b55..8314974d3 100644 --- a/app/views/users/_my_joinedcourse.html.erb +++ b/app/views/users/_my_joinedcourse.html.erb @@ -1,15 +1,15 @@
    <% if @memberships.empty? %> <% if @user != User.current %> -

    - <%= l(:label_project_course_un) %> -

    +

    + <%= l(:label_project_course_un) %> +

    <% else %> -

    - - <%= l(:label_project_cousre_studentun) %><%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %> - <%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %> -

    +

    + <%= l(:label_project_cousre_studentun) %> + <%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %> + <%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %> +

    <% end %> <% else %>
    From 3dfb0358c154b24f100eaf8059409e04451ce4f8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Dec 2014 14:53:21 +0800 Subject: [PATCH 08/12] =?UTF-8?q?#1718=20=E4=BF=AE=E5=A4=8D=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E4=B8=8B=E8=BD=BD=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=A1=86=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_project_file.html.erb | 34 +++--- app/views/tags/_tag.html.erb | 6 +- app/views/tags/_tag_name.html.erb | 147 ++++++++++++------------- 3 files changed, 91 insertions(+), 96 deletions(-) diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb index f52b7d353..e2f928332 100644 --- a/app/views/files/_project_file.html.erb +++ b/app/views/files/_project_file.html.erb @@ -2,22 +2,21 @@ <% attachmenttypes = @project.attachmenttypes %> <% sufixtypes = @project.contenttypes %> -<%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区 + + <%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %> + 资源共享区 +
    - <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
    <%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %> <%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>

    - - -
    - + <% if attachmenttypes.any? %>       - - <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]), + + <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]), :onchange => "attachmenttypes_searchex(this.value)" %> <% end %> <% if sufixtypes.any? %>   - + <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes), :onchange => "attachment_contenttypes_searchex(this.value)" %> <% end %> @@ -65,20 +71,14 @@
    <%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %> - <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
    <%#= render :partial => 'show_all_attachment' %> <% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %> - - <%= render partial: "show_all_attachment"%> - - + <%= render partial: "show_all_attachment"%> <%else%> - - <%= render partial: "sort_by_attachtypel"%> - + <%= render partial: "sort_by_attachtypel"%> <%end%>
    diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 06680d373..c08a3b553 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -1,6 +1,6 @@
    <%#begin - 1 代表是user类型 + 1 代表是user类型 2 代表是project类型 3 代表是issue类型 4 代表是bid类型 @@ -44,14 +44,14 @@ <%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', :class => "tags_icona", - :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').slideToggle(); readmore(this);" if User.current.logged? %> + :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %> <%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %>   
    <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
    -
    - <%= link_to_course(membership.course) %> + + <%= link_to_course(membership.course) %> + <%= render :partial => 'courses/set_course_time', :locals => {:course => membership.course} %> - <% if User.current == @user %> - <% (membership.roles).each do |role| %> - <% unless (role == Role.find(9) || role == Role.find(3)) %> - <%= join_in_course(membership.course, User.current) %> - <% end %> - <% end %> - <% else %> + <% if (User.current == @user && (!@user.allowed_to?(:as_teacher,membership.course)))%> + <%= join_in_course(membership.course, User.current) %> <% end %> +      <%= l(:label_x_base_courses_member, :count => membership.course.members.count) %> - (<%= "#{membership.course.members.count}" %>)   + (<%= "#{membership.course.members.count}" %>) +    <%= l(:label_homework) %> - (<%= link_to (membership.course.homeworks.count), {:controller => 'courses', :action => 'homework', :id => membership.course.id} %>) + ( + + <%= link_to (membership.course.homeworks.count), {:controller => 'courses', :action => 'homework', :id => membership.course.id} %> + + )    <%= l(:label_course_news) %> - (<%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %>) -
    @@ -42,10 +51,14 @@ <% @course = Course.find_by_extra(membership.course.extra) %> <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %> - <%= l(:label_main_teacher) %> - : <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %> - <%= l(:label_course_term) %> - : <%= @course.time %><%= @course.term %> + + <%= l(:label_main_teacher) %> + : <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %> + + + <%= l(:label_course_term) %> + : <%= @course.time %><%= @course.term %> + <% end %>
    -
    @@ -20,19 +20,41 @@
    - - <%= link_to request.host()+"/contests", contests_path %> - - - <%=link_to l(:field_homepage), home_path %> > <%= l(:label_contest_innovate) %> @@ -43,14 +65,14 @@ <% end %> <% if @contests.size > 0%> - <%= sort_contest(@s_state)%> + <%#= sort_contest(@s_state)%>
    <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
    <% elsif @is_search%> <%= render :partial => "layouts/no_content"%> <% else %> - <%= sort_contest(@s_state)%> + <%#= sort_contest(@s_state)%>
    <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
    From 0f9a82637ec5ecbb8c60cee60f50679c35008f4d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Dec 2014 15:58:33 +0800 Subject: [PATCH 10/12] =?UTF-8?q?#1716=20=E8=AF=BE=E7=A8=8B=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA-=E5=8F=91=E5=B8=83=E6=96=B0=E8=B4=B4?= =?UTF-8?q?=E7=82=B92=E6=AC=A1=E6=89=8D=E8=83=BD=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 5 +---- app/views/messages/new.html.erb | 12 ++++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 7a7d001ed..eac85e2d7 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -1,10 +1,7 @@