From 6530c657eece0f5e556823b98e179abf3db02e21 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 08:55:55 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E8=AF=BE=E7=A8=8Ballow=5Fjoin=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=A2=9E=E5=8A=A0=E8=AF=BE=E7=A8=8B=E7=9A=84=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=EF=BC=8C=E5=87=8F=E5=B0=91=E8=AF=BE=E7=A8=8B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 6507b3178..f91ccf550 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -29,7 +29,7 @@ class CoursesController < ApplicationController if course @state = 4 else - unless (allow_join && User.current.member_of_course?(course)) + unless (allow_join(course) && User.current.member_of_course?(course)) if params[:course_password] == course.password members = [] members << Member.new(:role_ids => [10], :user_id => User.current.id) @@ -700,8 +700,8 @@ class CoursesController < ApplicationController private - def allow_join - if course_endTime_timeout? Course.find(params[:object_id]) + def allow_join course + if course_endTime_timeout? course respond_to do |format| format.js { @state = 2 From 898fe7e9c983fe2af78b712cdb809d6d4dc9196e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 09:28:38 +0800 Subject: [PATCH 02/12] =?UTF-8?q?#982=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E6=B3=95=E9=80=89=E6=8B=A9=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E7=9A=84BUG=20=E4=BF=AE=E5=A4=8D=E5=AD=A6?= =?UTF-8?q?=E6=A0=A1=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_form.html.erb | 2 +- app/views/my/account.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index 1b1c86b64..4324c5d47 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -2,7 +2,7 @@ function get_options(value) { $.ajax({ type: "POST", - url: '/school/get_options/' + encodeURIComponent(value), + url: 'http://<%= Setting.host_name%>/school/get_options/' + encodeURIComponent(value), data: 'text', success: function (data) { $("#occupation").html(data); diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 8f118de05..2ff3f4c90 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -16,10 +16,10 @@ function get_options(value) { $.ajax({ type: "POST", - url: '<%= Setting.host_name == "micros.nudt.edu.cn" ? '/ros/school/get_options/' : '/school/get_options/'%>' + encodeURIComponent(value), + url: 'http://<%= Setting.host_name%>/school/get_options/' + encodeURIComponent(value), data: 'text', success: function (data) { - $("#province").val(value) + $("#province").val(value); $("#schoollist").html(data); } }); From dbd14ec23c0dbdc60ed86623339ce8e745d74fc4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 09:51:12 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99?= =?UTF-8?q?=E4=B8=AD=E5=AD=A6=E6=A0=A1=E7=BC=96=E8=BE=91=E6=A1=86=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 2ff3f4c90..ab77620fd 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -110,7 +110,7 @@ <%= l(:field_occupation) %> * - + <% end %>

From 5592aadbbf84807571d8398e5ae131667c422b94 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 10:18:49 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8DMicros=E7=89=88?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=B4=B4=E5=90=A7=E5=92=8Cwiki=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_form.html.erb | 2 +- app/views/wiki/edit.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb index 0db5a0f70..556238732 100644 --- a/app/views/forums/_form.html.erb +++ b/app/views/forums/_form.html.erb @@ -18,7 +18,7 @@ <%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %>
- +

<%= f.text_area :description, :required => true, :id => 'editor01' %>

diff --git a/app/views/wiki/edit.html.erb b/app/views/wiki/edit.html.erb index ba82865ad..30e8b73ae 100644 --- a/app/views/wiki/edit.html.erb +++ b/app/views/wiki/edit.html.erb @@ -1,6 +1,6 @@ <%= wiki_page_breadcrumb(@page) %> - +

<%= h @page.pretty_title %>

<%= form_for @content, :as => :content, From a001f85502798da5b2b6a3ee1c7ab1596875579a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 13:49:03 +0800 Subject: [PATCH 05/12] =?UTF-8?q?#1379=201.=E9=9A=90=E8=97=8F=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E7=B1=BB=E5=9E=8B=202.=E5=8F=96=E6=B6=88=E6=97=A0?= =?UTF-8?q?=E6=95=88=E4=BD=9C=E4=B8=9A=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework_form.html.erb | 1 - app/views/courses/_homework_form.html.erb | 1 - app/views/layouts/base_homework.html.erb | 99 ++++++++++++++++------- app/views/memos/_form.html.erb | 1 - config/locales/zh.yml | 1 + 5 files changed, 69 insertions(+), 34 deletions(-) diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index 145e01f1c..2b7578a96 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -21,7 +21,6 @@ <%= error_messages_for 'bid' %> -

<%= l(:label_homeworks_form_new_description) %>

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %> diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index b397b8d8f..646deb16e 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -21,7 +21,6 @@ <%= error_messages_for 'bid' %> -

<%= l(:label_homeworks_form_new_description) %>

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %> diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 01813bf52..7808f268e 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -33,17 +33,26 @@ - - + - + <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %> + +
高校课程实践社区<%= l(:label_user_location) %> : + <%= l(:label_user_location) %> : +
- <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %>

<%= link_to "主页", home_path %> - > <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> > - <%= link_to(course.name.to_s, homework_course_path(course)) if course %> - > - <%= link_to(@bid.name, respond_path(@bid)) %>

+

<%= link_to "主页", home_path %> + > + <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> + > + + <%= link_to(course.name.to_s, homework_course_path(course)) if course %> + + > + <%= link_to(@bid.name, respond_path(@bid)) %> +

+

@@ -93,26 +102,42 @@ + + <%= l(:label_new_course_description) %> : + + - + - - + + - - + + - - + + @@ -120,26 +145,34 @@ - - - - <% unless @user.user_extensions.nil? || @user.user_extensions.school.nil? %> - - <% end %> - -
- <%= l(:label_new_course_description) %> :
<%= textilizable course.description %> + <%= textilizable course.description %> +
<%= l(:label_create_time) %> :<%= format_time course.created_at %> + <%= l(:label_create_time) %> : + + <%= format_time course.created_at %> +
主讲老师 :<%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %><%= l(:lable_course_teacher) %> : + <%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %> +
<%= l(:label_class_period) %> :<%= course.class_period.to_s %> <%= l(:label_class_hour) %> + <%= l(:label_class_period) %> : + + <%= course.class_period.to_s %>  + <%= l(:label_class_hour) %> +
<%= course.time.to_s %> <%= course.term %>
<%= l(:label_teacher_work_unit) %> :<%= link_to @user.user_extensions.school,"http://course.trustie.net/?school_id=#{@user.user_extensions.school.id}" %>
- -
+ + + <%= l(:label_teacher_work_unit) %> : + + + <% unless @user.user_extensions.nil? || @user.user_extensions.school.nil? %> + + <%= link_to @user.user_extensions.school,"http://#{Setting.host_course}/?school_id=#{@user.user_extensions.school.id}" %> + + <% end %> + + + +
- - + - + <% unless @bid.parent_id.nil? %> @@ -160,7 +193,9 @@
<%= l(:label_limit_time) %>: <%= @bid.deadline %> + <%= l(:label_limit_time) %>: + <%= @bid.deadline %> +
作业类型: <%= @bid.homework_type==Bid::HomeworkFile ? "提交文件" : "提交项目" %>
- +
<%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %> + <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %> +
@@ -238,7 +273,9 @@
diff --git a/app/views/memos/_form.html.erb b/app/views/memos/_form.html.erb index 116f97149..b22983d2a 100644 --- a/app/views/memos/_form.html.erb +++ b/app/views/memos/_form.html.erb @@ -1,6 +1,5 @@ <%= error_messages_for 'bid' %> -

<%= l(:label_homeworks_form_new_description) %>

+

+ <%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", + :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %> +

<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %> <%= calendar_for('bid_deadline')%>

-

<%= f.select :is_evaluation, is_evaluation_option %> +

+ <%= f.select :is_evaluation, is_evaluation_option %>

-

<%= f.select :proportion, proportion_option %> +

+ <%= f.select :proportion, proportion_option %>

-

<%= hidden_field_tag 'course_id', @course.id %> +

+ <%= hidden_field_tag 'course_id', @course.id %>

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

<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>

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

+ <%= render :partial => 'attachments/form', :locals => {:container => @homework} %> +

\ No newline at end of file diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index edc90f8cc..b7b832fb5 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -6,7 +6,9 @@ - <%= h html_title %> + + <%= h html_title %> + <%= csrf_meta_tag %> @@ -32,7 +34,11 @@ - + - - + +
高校课程实践社区<%= l(:label_user_location) %> : + + <%= l(:label_user_location) %> : + +
<%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %>

<%= link_to "主页", home_path %> - > <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %> - > <%= link_to @course.name, nil %>

+ <%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %> + +

+ <%= link_to "主页", home_path %> + > <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %> + > <%= link_to @course.name, nil %> +

+
@@ -67,7 +79,9 @@ - + - + -
<%= link_to @course.name,course_path(@course) %> + <%= link_to @course.name,course_path(@course) %> +
@@ -101,17 +115,23 @@ <% if User.current.member_of_course?(@course) %> <%= link_to "#{teacherCount(@course)}", course_member_path(@course, :role => 1), :course => '1' %> <% else %> - <%= teacherCount(@course)%> + + <%= teacherCount(@course)%> + <% end%> <% if User.current.member_of_course?(@course) %> <%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %> <% else %> - <%= studentCount(@course)%> + + <%= studentCount(@course)%> + <% end %> <%= link_to files_count, course_files_path(@course) %> + <%= link_to files_count, course_files_path(@course) %> +
<%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %> @@ -122,7 +142,6 @@ <%= l(:label_x_course_data, :count => files_count) %>
@@ -134,45 +153,74 @@ - <%= l(:label_main_teacher) %> : - <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %> + + <%= l(:label_main_teacher) %> : + + + <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %> + - - <%= l(:label_setup_time) %> : - <%= @course.setup_time %> + + <%= l(:label_setup_time) %> : + + + <%= @course.setup_time %> + - <%= l(:label_endup_time) %> : - <%= @course.endup_time %> + + <%= l(:label_endup_time) %> : + + + <%= @course.endup_time %> + - <%= l(:label_class_period) %> : - <%= @course.class_period %> <%= l(:label_class_hour) %> + + <%= l(:label_class_period) %> : + + + <%= @course.class_period %>  + <%= l(:label_class_hour) %> + - <%= l(:label_main_term) %> : - <%= @course.time %> <%= @course.term %> + + <%= l(:label_main_term) %> : + + + <%= @course.time %> + <%= @course.term %> + <% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %> - <%= l(:label_teacher_work_unit) %> : - <%= @course.teacher.user_extensions.school %> + + <%= l(:label_teacher_work_unit) %> : + + + + <%= @course.teacher.user_extensions.school %> + + <% else %> - <%= l(:label_teacher_work_unit) %> : - <%= l(:field_course_un) %> + + <%= l(:label_teacher_work_unit) %> : + + + <%= l(:field_course_un) %> + <% end %> - -
@@ -180,11 +228,9 @@
<%= l(:label_new_course_description) %>
-
<% if @course.description && !@course.description.blank? %>
- <%= textilizable @course.description %>
<% else %> @@ -193,7 +239,10 @@
<% end %>
- <%= l(:label_create_time) %>:<%= format_time(@course.created_at) %> + + <%= l(:label_create_time) %>: + + <%= format_time(@course.created_at) %>
@@ -233,10 +282,6 @@
  • <%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => link_class(:feedback) %>
  • - - <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0)) %> - - <% end %> <%= render_flash_messages %> @@ -250,7 +295,9 @@ <%= render :partial => 'layouts/base_footer' %> diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 7808f268e..92d2cc84e 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -8,7 +8,9 @@ - <%=h html_title %> + + <%=h html_title %> + <%= csrf_meta_tag %> <%= favicon %> @@ -124,7 +126,9 @@ - <%= l(:lable_course_teacher) %> : + + <%= l(:lable_course_teacher) %> : + <%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %> @@ -141,8 +145,13 @@ - <%= l(:label_main_term) %> : - <%= course.time.to_s %> <%= course.term %> + + <%= l(:label_main_term) %> : + + + <%= course.time.to_s %> + <%= course.term %> + From 216537a8440e9a9f85b74625abb14c5a2ec5c76d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 14:21:33 +0800 Subject: [PATCH 07/12] =?UTF-8?q?#1278=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=B8=BA=E5=BC=80=E8=AE=BE=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=8D=95?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course.html.erb | 14 +++++--------- app/views/courses/index.html.erb | 6 ------ config/locales/zh.yml | 1 + 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index 239f2da26..5d5064be0 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -11,7 +11,9 @@

    <%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%> <% unless @course.is_public == 1 %> - <%= l(:label_private) %> + + <%= l(:label_private) %> + <% end %> <%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%>

    @@ -19,9 +21,8 @@ <%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%> <% @admin = @course.course_infos%> <%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%> - <% unless @course.teacher.user_extensions.school.nil? %> - <%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %> + <%= link_to(@course.school.try(:name), school_course_list_path(@course.school)) if @course.school %> <% end %> <% end %>

    @@ -52,7 +53,6 @@

    - <%= 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])) %>

    @@ -62,7 +62,7 @@ <% if(course_endTime_timeout? @course) %> - 课程学期已结束 + <%= l(:lable_course_end) %> <% else %> <%= join_in_course_for_list(@course, User.current,['regular'])%> @@ -80,10 +80,6 @@
    <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> - <%# desc = course.short_description.nil? ? "" : course.short_description%> - <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
    diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index 907be64a4..f781ab5c4 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -39,8 +39,6 @@
    <%if @courses%> <%= render_course_hierarchy(@courses)%> - <%#= render :partial => 'course', :locals => {:course => @courses.first}%> - <%#= "hello".html_safe %> <%end%>
    @@ -56,10 +54,6 @@

    <% end %> -<%# other_formats_links do |f| %> - <%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> -<%# end %> - <% content_for :sidebar do %> <%= form_tag({}, :method => :get) do %>

    <%= l(:label_project_plural) %>

    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 21b7514be..43bb6812a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2162,3 +2162,4 @@ zh: lable_teacher_evaluation_no: 老师还未进行评价 lable_teacher_evaluation: 作业综评 lable_course_teacher: 主讲老师 + lable_course_end: 课程学期已结束 From 87788ab34caffb3e84dde726be67cdf64274e8ec Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 15:33:48 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 25 +--------- app/helpers/courses_helper.rb | 1 - app/views/courses/_course.html.erb | 1 - app/views/courses/show.html.erb | 68 +++++++++++++++++---------- 4 files changed, 46 insertions(+), 49 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index f91ccf550..93626b86b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -427,9 +427,7 @@ class CoursesController < ApplicationController @course_type = params[:course_type] @school_id = params[:school_id] per_page_option = 10 - - - if @school_id == "0" or @school_id.nil? + if @school_id == "0" || @school_id.nil? @courses_all = Course.active.visible. joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id") else @@ -437,49 +435,37 @@ class CoursesController < ApplicationController joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id"). where("#{Course.table_name}.school_id = ?", @school_id) end - @course_count = @courses_all.count @course_pages = Paginator.new @course_count, per_page_option, params['page'] - @course_activity_count=Hash.new @courses_all.each do |course| @course_activity_count[course.id]=0 end - - case params[:course_sort_type] when '0' @courses = @courses_all.order("created_at desc") @s_type = 0 @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page) - - @course_activity_count=get_course_activity @courses, @course_activity_count + @course_activity_count=get_course_activity @courses, @course_activity_count when '1' @courses = @courses_all.order("course_ac_para desc") @s_type = 1 @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page) - @course_activity_count=get_course_activity @courses, @course_activity_count when '2' @courses = @courses_all.order("watchers_count desc") @s_type = 2 @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page) - @course_activity_count=get_course_activity @courses, @course_activity_count - when '3' - @course_activity_count=get_course_activity @courses_all, @course_activity_count - @courses=handle_course @courses_all, @course_activity_count - @s_type = 3 @courses = @courses[@course_pages.offset, @course_pages.per_page] else @s_type = 0 @courses = @courses_all.order("created_at desc") @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page) - @course_activity_count=get_course_activity @courses, @course_activity_count end @@ -521,18 +507,14 @@ class CoursesController < ApplicationController # 新建作业 def new_homework @homework = Bid.new - @homework.proportion @homework.safe_attributes = params[:bid] if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] )) render :layout => 'base_courses' else render_403 end - end - - def toggleCourse @course_prefs = Course.find_by_extra(@course.extra) unless (@course_prefs.teacher == User.current || User.current.admin?) @@ -722,7 +704,4 @@ class CoursesController < ApplicationController render_404 end end - - - end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 3a8b1b09a..3555a0b0c 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -479,7 +479,6 @@ module CoursesHelper type << option2 type end - #获取课程动态 def get_course_activity courses, activities @course_ids=activities.keys() diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index 5d5064be0..9298c253c 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -47,7 +47,6 @@

    <%= content_tag('span', "#{garble @course.members.count}", :class => "info") %> - <%#= content_tag('span', l(:label_x_member, :count => @course.members.count)) %> <%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>

    diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 6ea67c7cd..ee7d995e7 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -9,17 +9,20 @@
    - + <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure",:class => "tableth") %> - <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype",:class => "tableth") %> <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> - - <%# @containers.each do |container| %> - <%# next if container.attachments.empty? -%> - <%# if container.is_a?(Version) -%> - - <%# end -%> <% if @curse_attachments != nil %> <% @curse_attachments.each do |file| %> <%if file.is_public == 0 && !User.current.member_of?(@project)%> <%next%> <%end%> "> - - - + + - + + - - <% end -%> - <%# reset_cycle %> <% end -%> - - -
    <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %> + <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %> + +

    + - <% if e.event_type == "issue" %> <% end %> @@ -51,30 +65,33 @@ <% end %> - <% end -%> <% if (@events_pages.page == @events_pages.last_page) %>
    - <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %> + + <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %> + <% if @canShowRealName %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> - (<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %> - ) + (<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>) <% else %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> <% end %> @@ -32,15 +35,26 @@

    <%= h(truncate(strip_tags(e.event_description).gsub(/ /, ' '), length: 30, omission: '...')) %> -

    <%= l :label_activity_time %> - :  <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %> + + + <%= l :label_activity_time %> + :  + <%= format_activity_day(day) %> + <%= format_time(e.event_datetime, false) %> + - <%= link_to l(:label_find_all_comments), issue_path(e.id) %> <%= l(:label_comments_count, :count => e.journals.count) %> + + <%= link_to l(:label_find_all_comments), issue_path(e.id) %> + + + <%= l(:label_comments_count, :count => e.journals.count) %> +
    - + @@ -88,24 +105,27 @@
    <%= image_tag(url_to_avatar(@user), :class => "avatar") %> + <%= image_tag(url_to_avatar(@user), :class => "avatar") %> + + <%= l(:label_user_create_project) %> + <%= link_to @course.name %> + ! + -
    <% if @canShowRealName %> - (<%= link_to_user(@user, @canShowRealName) %> - ) + (<%= link_to_user(@user, @canShowRealName) %>) <% else %> <%= link_to_user(@user)%> <% end %> - <%= l(:label_user_create_project) %> <%= link_to @course.name %> - !
    <%= l :label_create_time %> - : <%= format_time(@course.created_at) %> + + <%= l :label_create_time %>: + <%= format_time(@course.created_at) %>
    - + From b84e19846bb20f1a095dfef4d72c28a46be3f14a Mon Sep 17 00:00:00 2001 From: gonglexin <18008490802@163.com> Date: Tue, 21 Oct 2014 15:38:25 +0800 Subject: [PATCH 09/12] =?UTF-8?q?#1360=20=E5=88=A0=E9=99=A4=E6=88=90?= =?UTF-8?q?=E5=91=98=E6=97=B6=E7=BB=99=E5=87=BA=E7=A1=AE=E8=AE=A4=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=88=A0=E9=99=A4=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings/_members.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index f685e4543..5432db8e6 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -51,7 +51,7 @@ :class => 'icon icon-edit' %> <%= delete_link membership_path(member), :remote => true, - :data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %> + :data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %> <% end %> From 164297e30fa91e0c3bba5264cec940448aff335e Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 21 Oct 2014 16:34:46 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E8=A6=81=E7=82=B9=E4=B8=A4=E6=AC=A1=E6=8F=90=E4=BA=A4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/_course_show.html.erb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 51764341d..6977385d8 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -178,7 +178,7 @@ <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= render :partial => 'form', :locals => {:f => f, :replying => true} %> <%#= submit_tag l(:button_submit) %> - + <%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %> <% end %>
    @@ -188,12 +188,13 @@ <% html_title @topic.subject %> \ No newline at end of file From c76439c5152b3c8443f9fdeb38cb8468117b0740 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 16:38:16 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=20#1381=E4=BF=AE=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=9B=B8=E5=85=B3=E5=86=85=E5=AE=B9=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E3=80=81=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=88=97=E8=A1=A8=E8=A1=A8=E5=A4=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8=E7=9A=84BUG=20=202.=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=20=203.?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90=E5=88=97=E8=A1=A8=E4=B9=9F?= =?UTF-8?q?=E6=9C=89=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98=EF=BC=8C=E4=B8=80?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_file.html.erb | 8 +-- .../_course_show_all_attachment.html.erb | 59 +++++++---------- .../_course_sort_by_attachtypel.html.erb | 60 +++++++++-------- app/views/files/_show_all_attachment.html.erb | 53 +++++++-------- app/views/files/_sort_by_attachtypel.html.erb | 66 ++++++++++--------- app/views/files/getattachtype.js.erb | 20 +++--- app/views/files/index.html.erb | 19 +++--- app/views/memos/_form.html.erb | 9 --- config/locales/zh.yml | 1 + 9 files changed, 141 insertions(+), 154 deletions(-) diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index cb0084b25..d00a51bc1 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -2,11 +2,11 @@ <% attachmenttypes = @course.attachmenttypes %> <% sufixtypes = @course.contenttypes %> -<%= t(:label_user_course) %>资源共享区 + + <%= l(:label_coursefile_sharingarea) %> +
    - - <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @course) %>
    <%= 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, @course) %> @@ -55,7 +55,7 @@ <% if sufixtypes.any? %>   - <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes), + <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') + options_for_select(sufixtypes), :onchange => "course_attachment_contenttypes_searchex(this.value)" %> <% end %>
    diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb index 3ce583cb8..b70e6e3b6 100644 --- a/app/views/files/_course_show_all_attachment.html.erb +++ b/app/views/files/_course_show_all_attachment.html.erb @@ -9,57 +9,55 @@
    - <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %> - <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> <%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%> <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> - - <%# @containers.each do |container| %> - <%# next if container.attachments.empty? -%> - <%# if container.is_a?(Version) -%> - - <%# end -%> <% if @curse_attachments != nil %> <% @curse_attachments.each do |file| %> <%if file.is_public == 0 && !User.current.member_of_course?(@course)%> <%next%> <%end%> "> - - - + + + - + - - <% end -%> <% end %> - <%# reset_cycle %> - <%# end -%> - - - - -
    <%= image_tag(url_to_avatar(@user), :class => "avatar") %> + <%= image_tag(url_to_avatar(@user), :class => "avatar") %> + + <%= l(:label_user_create_project) %> + <%= link_to @course.name %> + ! + -
    <% if @canShowRealName %> - (<%= link_to_user(@user, @canShowRealName) %> - ) + (<%= link_to_user(@user, @canShowRealName) %>) <% else %> <%= link_to_user(@user)%> <% end %> - - <%= l(:label_user_create_project) %> <%= link_to @course.name %> - !
    <%= l :label_create_time %> - : <%= format_time(@course.created_at) %> + + <%= l :label_create_time %>: + <%= format_time(@course.created_at) %>
    <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= number_to_human_size(file.filesize) %> + <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + + <%= number_to_human_size(file.filesize) %> + - <%= file.attachmentstype.typeName unless file.attachmentstype.nil? %> - - <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> - + + <%= file.attachmentstype.typeName unless file.attachmentstype.nil? %> + + + <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> + + + <%= file.show_suffix_type %> <%= file.show_suffix_type %> - <%= file.file_dense_str %> + + <%= file.file_dense_str %> +   - - <%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, - :attachment => file} %> - + + <%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, + :attachment => file} %> + + + <%= file.downloads %> <%= file.downloads %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -77,13 +75,6 @@
    diff --git a/app/views/files/_course_sort_by_attachtypel.html.erb b/app/views/files/_course_sort_by_attachtypel.html.erb index 5a0cdba02..feb8d736d 100644 --- a/app/views/files/_course_sort_by_attachtypel.html.erb +++ b/app/views/files/_course_sort_by_attachtypel.html.erb @@ -3,25 +3,22 @@ <% attachmenttypes = @course.attachmenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @course) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @course) %> - +
    - - <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %> - <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> - <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %> - <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %> - <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %> - <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %> - <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %> - <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> - + <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %> + <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> + <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> + <%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%> + <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> + <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> + <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> @@ -33,28 +30,36 @@ <% end %> <% if isTypeOk(file, selAttachType, selContentType) %> "> - - + + - + - -
    <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> + + <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> +   - - <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, - :attachment => file, :contentype => selContentType} %> - + + <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, + :attachment => file, :contentype => selContentType} %> + + + <%= file.show_suffix_type %> <%= file.show_suffix_type %> - <%= file.file_dense_str %> + + <%= file.file_dense_str %> +   - - <%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, - :attachment => file} %> - + + <%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, + :attachment => file} %> + + + <%= file.downloads %> <%= file.downloads %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -75,9 +80,6 @@ <% end -%> <% reset_cycle %> <% end -%> - - -
    diff --git a/app/views/files/_show_all_attachment.html.erb b/app/views/files/_show_all_attachment.html.erb index c1df86b32..3520d5576 100644 --- a/app/views/files/_show_all_attachment.html.erb +++ b/app/views/files/_show_all_attachment.html.erb @@ -15,52 +15,51 @@
    <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= number_to_human_size(file.filesize) %> + <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + + <%= number_to_human_size(file.filesize) %> + - <%= file.attachmentstype.typeName %> + + <%= file.attachmentstype.typeName %> + <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> <%= file.show_suffix_type %> + <%= file.show_suffix_type %> + - <%= file.file_dense_str %> + + <%= file.file_dense_str %> +   - - <%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, - :attachment => file} %> - + + <%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, + :attachment => file} %> + + + <%= file.downloads %> <%= file.downloads %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -73,15 +72,13 @@ <%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
    - +
    diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb index 6c6e11791..5faa73b0f 100644 --- a/app/views/files/_sort_by_attachtypel.html.erb +++ b/app/views/files/_sort_by_attachtypel.html.erb @@ -3,7 +3,7 @@ <% attachmenttypes = @project.attachmenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> - +
    @@ -13,15 +13,13 @@ - <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %> - <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> - <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %> - <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %> - <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %> - <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %> - <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %> - <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> - + <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %> + <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> + <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> + <%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%> + <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> + <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> + <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> @@ -33,28 +31,38 @@ <% end %> <% if isTypeOk(file, selAttachType, selContentType) %> "> - - - + + + - + - - @@ -75,9 +84,6 @@ <% end -%> <% reset_cycle %> <% end -%> - - -
    <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= number_to_human_size(file.filesize) %> + <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + + <%= number_to_human_size(file.filesize) %> + - <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> + + <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> +   - - <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, - :attachment => file, :contentype => selContentType} %> - + + <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, + :attachment => file, :contentype => selContentType} %> + + + <%= file.show_suffix_type %> <%= file.show_suffix_type %> - <%= file.file_dense_str %> + + <%= file.file_dense_str %> +   - - <%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, - :attachment => file} %> - + + <%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, + :attachment => file} %> + + + <%= file.downloads %> <%= file.downloads %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -67,7 +75,8 @@ <%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
    -
    diff --git a/app/views/files/getattachtype.js.erb b/app/views/files/getattachtype.js.erb index 88722073f..7acf849ce 100644 --- a/app/views/files/getattachtype.js.erb +++ b/app/views/files/getattachtype.js.erb @@ -1,13 +1,13 @@ <% if @attachtype==0 && @contenttype=='0' %> -<% if @project%> -$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>'); -<% elsif @course%> -$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>'); -<%end%> + <% if @project%> + $("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>'); + <% elsif @course%> + $("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>'); + <%end%> <%else%> -<% if @project%> -$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>') -<% elsif @course%> -$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>') -<%end%>; + <% if @project%> + $("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>') + <% elsif @course%> + $("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>') + <%end%>; <%end%> diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 69b41fc28..e3f022e37 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -120,16 +120,15 @@ function course_attachment_contenttypes_searchex(value) { <% if @course%> - $.ajax({ - - url: '<%=getattachtype_course_files_path(course_id: @course)%>', - type: "POST", - data: { - type: $('#attachment_browse').val(), - contentType: encodeURIComponent(value) - } - - }).complete(eval_ajax); + $.ajax({ + url: '<%=getattachtype_course_files_path(course_id: @course)%>', + type: "POST", + data: { + type: $('#attachment_browse').val(), + contentType: encodeURIComponent(value) + } + + }).complete(eval_ajax); <%end%> } function course_attachtype_edit(value) { diff --git a/app/views/memos/_form.html.erb b/app/views/memos/_form.html.erb index b22983d2a..41ea73fcd 100644 --- a/app/views/memos/_form.html.erb +++ b/app/views/memos/_form.html.erb @@ -1,12 +1,3 @@ <%= error_messages_for 'bid' %> - -

    <%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %>

    <%= hidden_field_tag 'subject', ||=@memo.subject %> \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 43bb6812a..f453b21c3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2163,3 +2163,4 @@ zh: lable_teacher_evaluation: 作业综评 lable_course_teacher: 主讲老师 lable_course_end: 课程学期已结束 + lable_file_sharingarea: 资源共享区 From 0ba1477f1bd86aa3269f6b96ca393bcd58d80994 Mon Sep 17 00:00:00 2001 From: gonglexin <18008490802@163.com> Date: Tue, 21 Oct 2014 16:51:30 +0800 Subject: [PATCH 12/12] =?UTF-8?q?#1360=20=E7=BF=BB=E9=A1=B5=E6=88=96?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=B9=8B=E5=89=8D=E8=8B=A5=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BA=86=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=99=E7=BB=99=E5=87=BA=E6=8F=90=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/courses/settings/_members.html.erb | 6 +++++- app/views/members/autocomplete.js.erb | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index 5432db8e6..ab0f20257 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -82,7 +82,11 @@

    <%= l(:label_role_plural) %>: <% roles.each do |role| %> - + <% if role.id == 10 %> + + <% else %> + + <% end %> <% end %>

    <%= submit_tag l(:button_add), :id => 'member-add-submit' %>

    diff --git a/app/views/members/autocomplete.js.erb b/app/views/members/autocomplete.js.erb index 5ef01c04d..d1e7a884b 100644 --- a/app/views/members/autocomplete.js.erb +++ b/app/views/members/autocomplete.js.erb @@ -1,6 +1,11 @@ <% if @project%> $('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>'); <% elsif @course%> + var checked = $("#principals input:checked").size(); + if(checked > 0) + { + alert('翻页或搜索后将丢失当前选择的用户数据!'); + } $('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_course_members(@course)) %>'); <%end%> var collection=$("#principals_for_new_member").children("#principals").children("label");