From 8b7a775419073af56c50827d45a7e97f8ae5d9c8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Oct 2014 16:24:12 +0800 Subject: [PATCH 01/19] =?UTF-8?q?#1269=20=E4=BF=AE=E5=A4=8D=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE--=E6=97=A5=E5=8E=86=E4=BF=A1=E6=81=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/calendars/show.html.erb | 53 +++++++++++----------- app/views/common/_calendar.html.erb | 68 ++++++++++++++++------------- 2 files changed, 62 insertions(+), 59 deletions(-) diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb index 9166974fa..65b740203 100644 --- a/app/views/calendars/show.html.erb +++ b/app/views/calendars/show.html.erb @@ -2,38 +2,35 @@ <%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project}, :method => :get, :id => 'query_form') do %> -<%= hidden_field_tag 'set_filter', '1' %> -
"> - <%= l(:label_filter_plural) %> -
"> - <%= render :partial => 'queries/filters', :locals => {:query => @query} %> -
-
- -

- <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %> -

- -

-<%= label_tag('month', l(:label_month)) %> -<%= select_month(@month, :prefix => "month", :discard_type => true) %> -<%= label_tag('year', l(:label_year)) %> -<%= select_year(@year, :prefix => "year", :discard_type => true) %> - -<%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> -<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %> -

+ <%= hidden_field_tag 'set_filter', '1' %> +
"> + <%= l(:label_filter_plural) %> +
"> + <%= render :partial => 'queries/filters', :locals => {:query => @query} %> +
+
+

+ <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %> +

+

+ <%= label_tag('month', l(:label_month)) %> + <%= select_month(@month, :prefix => "month", :discard_type => true) %> + <%= label_tag('year', l(:label_year)) %> + <%= select_year(@year, :prefix => "year", :discard_type => true) %> + + <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> + <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %> +

<% end %> <%= error_messages_for 'query' %> <% if @query.valid? %> -<%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %> - -

- <%= l(:text_tip_issue_begin_day) %> - <%= l(:text_tip_issue_end_day) %> - <%= l(:text_tip_issue_begin_end_day) %> -

+ <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %> +

+ <%= l(:text_tip_issue_begin_day) %> + <%= l(:text_tip_issue_end_day) %> + <%= l(:text_tip_issue_begin_end_day) %> +

<% end %> <% content_for :sidebar do %> diff --git a/app/views/common/_calendar.html.erb b/app/views/common/_calendar.html.erb index 7951b68ce..83f8e217b 100644 --- a/app/views/common/_calendar.html.erb +++ b/app/views/common/_calendar.html.erb @@ -1,32 +1,38 @@ - - -<% 7.times do |i| %><% end %> - - - -<% day = calendar.startdt -while day <= calendar.enddt %> -<%= ("".html_safe) if day.cwday == calendar.first_wday %> - -<%= ''.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %> -<% day = day + 1 -end %> - - +
<%= day_name( (calendar.first_wday+i)%7 ) %>
#{(day+(11-day.cwday)%7).cweek} -

<%= day.day %>

-<% calendar.events_on(day).each do |i| %> - <% if i.is_a? Issue %> -
- <%= h("#{i.project} -") unless @project && @project == i.project %> - <%= link_to_issue i, :truncate => 30 %> - <%= render_issue_tooltip i %> -
- <% else %> - - <%= h("#{i.project} -") unless @project && @project == i.project %> - <%= link_to_version i%> - - <% end %> -<% end %> -
+ + + + <% 7.times do |i| %> + + <% end %> + + + + + <% day = calendar.startdt + while day <= calendar.enddt %> + <%= ("".html_safe) if day.cwday == calendar.first_wday %> + + <%= ''.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %> + <% day = day + 1 + end %> + +
<%= day_name( (calendar.first_wday+i)%7 ) %>
#{(day+(11-day.cwday)%7).cweek} +

<%= day.day %>

+ <% calendar.events_on(day).each do |i| %> + <% if i.is_a? Issue %> +
+ <%= h("#{i.project} -") unless @project && @project == i.project %> + <%= link_to_issue i, :truncate => 30 %> + <%= render_issue_tooltip i %> +
+ <% else %> + + <%= h("#{i.project} -") unless @project && @project == i.project %> + <%= link_to_version i%> + + <% end %> + <% end %> +
From 7f08652cd14ba8df228a5cddc3d14056802aa590 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Oct 2014 17:49:16 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=20#1250=20=E4=BF=AE=E6=94=B9=E8=B5=84?= =?UTF-8?q?=E6=96=99=E4=BF=9D=E5=AD=98=E5=90=8E=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=20=20=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9Aflash=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E5=90=8E=E8=87=AA=E5=8A=A8=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/my_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 1e58c53f1..ccdf80464 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -130,7 +130,7 @@ class MyController < ApplicationController @user.pref.save @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) set_language_if_valid @user.language - flash[:notice] = l(:notice_account_updated) + flash.now[:notice] = l(:notice_account_updated) redirect_to user_path(@user) return else @@ -160,7 +160,7 @@ class MyController < ApplicationController @user.destroy if @user.destroyed? logout_user - flash[:notice] = l(:notice_account_deleted) + flash.now[:notice] = l(:notice_account_deleted) end redirect_to home_path end @@ -170,7 +170,7 @@ class MyController < ApplicationController def password @user = User.current unless @user.change_password_allowed? - flash[:error] = l(:notice_can_t_change_password) + flash.now[:error] = l(:notice_can_t_change_password) redirect_to my_account_path return end From 8cd3dd0287f32a43a9a4b3c50fae91fe9eccaf7d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Oct 2014 09:21:10 +0800 Subject: [PATCH 03/19] =?UTF-8?q?1.#1249=20=E6=9C=AA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=92=8C=E9=9D=9E=E6=9C=AC=E4=BA=BA=E8=BF=9B=E5=85=A5=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=AF=BE=E7=A8=8B=E7=95=8C=E9=9D=A2=E6=97=B6=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E8=AF=BE=E7=A8=8B=E4=B8=8D=E6=98=BE=E7=A4=BA=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9A=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E5=92=8C=E6=89=80=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E7=9A=84=E7=94=A8=E6=88=B7=E6=98=AF=E5=90=A6=E4=B8=80?= =?UTF-8?q?=E8=87=B4=EF=BC=8C=E4=B8=8D=E4=B8=80=E8=87=B4=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=202.=E5=9B=BD=E9=99=85=E5=8C=96=E4=BB=A3=E7=A0=81=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 13 +++- app/views/my/account.html.erb | 96 +++++++++++++---------------- app/views/welcome/course.html.erb | 21 ++++--- config/locales/zh.yml | 1 + 4 files changed, 65 insertions(+), 66 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d8ecb4ef7..638a883d2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -226,7 +226,14 @@ class UsersController < ApplicationController end end - membership = @user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current)) + #@user.coursememberships.all(:conditions => Course.visible_condition(User.current)) + + if User.current == @user || User.current.admin? + membership = @user.coursememberships.all + else + membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current)) + end + membership.sort! {|older, newer| newer.created_on <=> older.created_on } @memberships = [] membership.collect { |e| @@ -235,9 +242,9 @@ class UsersController < ApplicationController ## 判断课程是否过期 [需封装] @memberships_doing = [] @memberships_done = [] - now_time = Time.now.year + #now_time = Time.now.year @memberships.map { |e| - end_time = e.course.get_time.year + #end_time = e.course.get_time.year isDone = course_endTime_timeout?(e.course) if isDone @memberships_done.push e diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index a57e35e65..3cb4fad80 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -12,8 +12,6 @@ ); - - - -
<%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %> <%= call_hook(:view_my_account_contextual, :user => @user) %> @@ -39,9 +32,7 @@

<%= l(:label_my_account) %>

<%= error_messages_for 'user' %> -
- <%= labelled_form_for :user, @user, :url => {:action => "account"}, :html => {:id => 'my_account_form', @@ -70,7 +61,6 @@
@@ -95,10 +86,10 @@

<% else %> <% if @user.user_extensions.gender == 0 %> -

- <%= l(:label_gender) %>   - <%= select_tag 'gender', "".html_safe, :class => 'gender' %> -

+

+ <%= l(:label_gender) %>   + <%= select_tag 'gender', "".html_safe, :class => 'gender' %> +

<% else %>

<%= l(:label_gender) %>   @@ -107,12 +98,11 @@ <% end %> <% end %> - -

<% if User.current.user_extensions.school.nil? %> - <%= l(:field_occupation) %> * + <%= l(:field_occupation) %>  + * @@ -126,8 +116,7 @@

- -

学校列表

+

<%= l(:lable_school_list)%>

  
    @@ -234,39 +223,40 @@ <% unless @user.user_extensions.identity == 2 %> -

    - <%= l(:label_identity) %> - - - - <% end %> - - - <% else %> - - - -

    +

    + <%= l(:label_identity) %> + + + + <% end %> + + +

    + <% else %> +

    + + + +

    <% end %>
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 51f082ae6..d28c89aa8 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -39,19 +39,20 @@
- <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> + + <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> <% else %> - <% if @school_id == "0" %> - <% else %> - <% if @school_id.nil? %> - <%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> -
- <% else %> - <%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> -
- <% end %> + <% if @school_id == "0" %> + <% else %> + <% if @school_id.nil? %> + <%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> +
+ <% else %> + <%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> +
<% end %> <% end %> + <% end %>
<% unless @course_page.nil? %> <%= @course_page.title %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 7ddff7d04..c4fe1d833 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2145,3 +2145,4 @@ zh: lable_sure_exit_project: 是否确认退出该项目 lable_input_class: 在此输入课时 lable_input_class_vilidate: 学时只能为整数 + lable_school_list: 学校列表 From 2e3ff531f67c9aaf6a1a94def30ae0b01fda2536 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Oct 2014 09:53:58 +0800 Subject: [PATCH 04/19] =?UTF-8?q?1.#1181=E8=AF=BE=E7=A8=8B=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98=202.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E9=A6=96=E9=A1=B5=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=8A=A8=E6=80=81=E6=98=BE=E7=A4=BA=E6=8C=89=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E9=95=BF=E5=BA=A6=E6=88=AA=E5=8F=96=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=8D=E5=8D=8F=E8=B0=83=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/welcome_helper.rb | 10 +++++----- app/views/layouts/base_courses.html.erb | 2 +- app/views/welcome/index.html.erb | 4 +--- config/locales/zh.yml | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 26d61f94e..5dcf55d49 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -303,27 +303,27 @@ module WelcomeHelper str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << - link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url) + link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url) when 'issue', 'message' , 'bid' , 'wiki-page' , 'document' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << - link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) + link_to(event.event_title, event.event_url) when 'reply' ,'Reply', 'Memo' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << - link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url) + link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url) when 'attachment' str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ': '.html_safe << - link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << + link_to(event.event_title, event.event_url) << link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container.project), :class => "attachments_list_color") else str << content_tag("span", "更新了") << content_tag("span", find_all_event_type(event)) << - ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) + ': '.html_safe << link_to(event.event_title, event.event_url) end str rescue Exception => e diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index e3c137fb4..91ab68fdf 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -189,7 +189,7 @@
- <% if @course.description && @course.description.size>0 %> + <% if @course.description && @course.description.lstrip.rstrip.size>0 %>
<%= textilizable @course.description %> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index c4f7f27a7..8b610bdbc 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -75,9 +75,7 @@
    - <% #projects = find_miracle_project(10, 3) %> <% @projects.map do |project| %> -
  • <%= image_tag(get_project_avatar(project), :class => "avatar-4") %> @@ -122,7 +120,7 @@ <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
    -
    +
    <%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index c4fe1d833..a3ec030c4 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1634,7 +1634,7 @@ zh: label_issue_cancel_query: 取消查询 field_reward_type: 奖励类型 label_tags_no: 暂无标签! - label_course_description_no: 你还未对该课程添加描述! + label_course_description_no: 该课程未添加描述! label_bid_publish: 发布了 label_bid_project: 项目 label_project_no_follow: 该项目暂未被关注! From 75b9fccb84a95b0ed4a33acc1a35d4fa68e93a02 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 10 Oct 2014 10:49:21 +0800 Subject: [PATCH 05/19] =?UTF-8?q?#1309=20=E9=A1=B9=E7=9B=AE--=E9=85=8D?= =?UTF-8?q?=E7=BD=AE--=E6=A8=A1=E5=9D=97=EF=BC=9A=E4=B8=8D=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E7=9B=B8=E5=85=B3=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=8D=B4?= =?UTF-8?q?=E4=B9=9F=E8=83=BD=E5=9C=A8=E9=A1=B9=E7=9B=AE=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E6=98=BE=E7=A4=BA,=E8=A7=A3=E5=86=B3=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD=EF=BC=8C=E4=B8=8D=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E7=9A=84=E6=A8=A1=E5=9D=97=E4=B8=8D=E5=86=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E3=80=82admin=E9=A6=96=E9=A1=B5=E5=AE=9A=E5=88=B6?= =?UTF-8?q?=E4=B8=AD=E8=AE=BE=E7=BD=AE=E4=B8=8D=E6=98=BE=E7=A4=BA=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E6=97=B6=EF=BC=8C=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E8=AF=BE=E7=A8=8Btab=E9=A1=B5=E4=B9=9F?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/redmine.rb | 10 +++++----- plugins/redmine_code_review/init.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/redmine.rb b/lib/redmine.rb index 55511c5b5..8803a544f 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -384,20 +384,20 @@ Redmine::MenuManager.map :project_menu do |menu| # menu.push :activity, { :controller => 'activities', :action => 'index' } #menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id # :if => Proc.new { |p| p.shared_versions.any? } - menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural + menu.push :issues, { :controller => 'issues', :action => 'index' },:if => Proc.new {|p| p.enabled_module_names.include?('issues') } ,:param => :project_id, :caption => :label_issue_plural # menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, # :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } # menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt # menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar - menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural + menu.push :news, { :controller => 'news', :action => 'index' }, :if => Proc.new {|p| p.enabled_module_names.include?('news') },:param => :project_id, :caption => :label_news_plural # menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural # menu.push :wiki, { :controller => 'wiki', :action => 'show', :id => nil }, :param => :project_id, # :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, - :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural + :if => Proc.new { |p| p.boards.any? && p.enabled_module_names.include?('boards') }, :caption => :label_board_plural #menu.push :files, { :controller => 'files', :action => 'index' }, :param => :project_id, :caption => :label_file_new menu.push :repository, { :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil }, - :if => Proc.new { |p| p.repository && !p.repository.new_record? && !( !User.current.member_of?(p) && p.hidden_repo ) } + :if => Proc.new { |p| p.repository && !p.repository.new_record? && !( !User.current.member_of?(p) && p.hidden_repo ) && p.enabled_module_names.include?('repository') } menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true end @@ -415,7 +415,7 @@ Redmine::MenuManager.map :course_menu do |menu| end Redmine::MenuManager.map :user_menu do |menu| menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain } - menu.push :user_course, {:controller => 'users', :action => 'user_courses'} + menu.push :user_course, {:controller => 'users', :action => 'user_courses'},:if => Proc.new {|c| FirstPage.where("page_type = 'project'").first.show_course != 2} #menu.push :user_homework, {:controller => 'users', :action => 'user_homeworks'} by huang menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain} # menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} by huang diff --git a/plugins/redmine_code_review/init.rb b/plugins/redmine_code_review/init.rb index 651de0baf..53841c8f2 100644 --- a/plugins/redmine_code_review/init.rb +++ b/plugins/redmine_code_review/init.rb @@ -73,7 +73,7 @@ Redmine::Plugin.register :redmine_code_review do menu :project_menu, :code_review, { :controller => 'code_review', :action => 'index' }, :caption => :code_reviews, :if => Proc.new{|project| setting = CodeReviewProjectSetting.find_or_create(project) - project.repository != nil and setting and !setting.hide_code_review_tab + project.repository != nil and setting and !setting.hide_code_review_tab and project.enabled_module_names.include?('code_review') }, :after => :repository From a6efe10984aaacff13b9a7929b6db668959b4fd2 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 10 Oct 2014 11:46:59 +0800 Subject: [PATCH 06/19] =?UTF-8?q?1=E3=80=81#1313=20=E8=AF=BE=E7=A8=8B/?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=EF=BC=9A=E8=B5=84=E6=BA=90=E5=BA=93=E2=80=9C?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=AC=A1=E6=95=B0=E2=80=9C=E5=AD=97=E6=A0=B7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF,=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B6=E6=A0=B7=E5=BC=8F=E3=80=822?= =?UTF-8?q?=E3=80=81=E9=A1=B9=E7=9B=AE=E7=BC=BA=E9=99=B7=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=8B=BE=E4=B8=8A=E4=B9=9F=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=8E=9F=E5=9B=A0=EF=BC=9A=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=8C=B9=E9=85=8D=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B9=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../files/_course_show_all_attachment.html.erb | 14 +++++++------- lib/redmine.rb | 2 +- public/stylesheets/application.css | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb index fbf398c36..15ef36580 100644 --- a/app/views/files/_course_show_all_attachment.html.erb +++ b/app/views/files/_course_show_all_attachment.html.erb @@ -13,14 +13,14 @@ - <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %> + <%= 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") %> - <%= 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('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") %> diff --git a/lib/redmine.rb b/lib/redmine.rb index 8803a544f..708d25829 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -384,7 +384,7 @@ Redmine::MenuManager.map :project_menu do |menu| # menu.push :activity, { :controller => 'activities', :action => 'index' } #menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id # :if => Proc.new { |p| p.shared_versions.any? } - menu.push :issues, { :controller => 'issues', :action => 'index' },:if => Proc.new {|p| p.enabled_module_names.include?('issues') } ,:param => :project_id, :caption => :label_issue_plural + menu.push :issues, { :controller => 'issues', :action => 'index' },:if => Proc.new {|p| p.enabled_module_names.include?('issue_tracking') } ,:param => :project_id, :caption => :label_issue_plural # menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, # :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } # menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 38af97023..a9b0ef4eb 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2813,4 +2813,4 @@ div.repos_explain{ cursor: pointer; } -.tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;} +.list .tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;} From 0f492047a5833fbe75eef77d5191abd80b8754fa Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Oct 2014 13:52:33 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=BC=9A=E6=98=BE=E7=A4=BA=E7=A7=81=E6=9C=89=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8A=A8=E6=80=81=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/welcome_helper.rb | 3 ++- lib/redmine/activity/fetcher.rb | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 5dcf55d49..1139deb35 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -405,7 +405,8 @@ module WelcomeHelper "show_bids" => true, "show_contest" => true } - activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages', 'bids', 'news', 'contestnotification'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' } + activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages', 'bids', 'news', 'contestnotification'].include?(t) ? + nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' } activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'}) end diff --git a/lib/redmine/activity/fetcher.rb b/lib/redmine/activity/fetcher.rb index 2caef48b8..ba2033775 100644 --- a/lib/redmine/activity/fetcher.rb +++ b/lib/redmine/activity/fetcher.rb @@ -109,12 +109,17 @@ module Redmine end if cur_objs cur_objs.each do |cur_obj| - if cur_obj.class == Issue - if cur_obj.project != nil && cur_obj.project.project_status != nil - e += [cur_obj] - end - else + #if cur_obj.class.to_s == 'Issue' + # if cur_obj.project != nil && cur_obj.project.project_status != nil && cur_obj.project.is_public == 1 + # e += [cur_obj] + # end + #else + # e += [cur_obj] + #end + if cur_obj.project != nil && cur_obj.project.project_status != nil && cur_obj.project.is_public == true e += [cur_obj] + #else + # e += [cur_obj] end end end From 5180c959a84e409cad84d79e20c60f299dadeda5 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Oct 2014 14:09:43 +0800 Subject: [PATCH 08/19] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=20=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?--=E6=96=B0=E9=97=BB=E3=80=81=E8=AF=BE=E7=A8=8B--=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E9=80=9A=E7=9F=A5=20=E5=88=97=E8=A1=A8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=202.=E4=BC=98=E5=8C=96=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_news.html.erb | 39 ++++++++++++++++++++------- app/views/news/_project_news.html.erb | 16 ++++++++--- public/stylesheets/application.css | 5 ++-- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index f8bd9c638..ea94244d5 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -74,7 +74,6 @@ <%= labelled_form_for @news, :url => course_news_index_path(@course), :html => {:id => 'news-form', :multipart => true} do |f| %> <%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %> - <%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %> <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>| <%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> | @@ -90,26 +89,48 @@

    <% else %> <% @newss.each do |news| %> - - + diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb index 35f76dfaa..75f33d1d3 100644 --- a/app/views/news/_project_news.html.erb +++ b/app/views/news/_project_news.html.erb @@ -101,21 +101,29 @@
    <%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + <%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + + + <%= textilizable(news, :description) %> + + - - + +
    - <%= link_to_user(news.author) if news.respond_to?(:author) %><%= l(:label_project_notice) %><%= link_to h(news.title), news_path(news) %> - <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @couese) %> + + <%= link_to_user(news.author) if news.respond_to?(:author) %> + + + <%= l(:label_project_notice) %> + + + <%= link_to h(news.title), news_path(news) %> + + + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @couese) %> +
    - <%= textilizable(news, :description) %>
    <%= l :label_update_time %> - : <%= format_time(news.created_on) %><%= link_to l(:label_project_newother), news_path(news) %><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %> + + <%= l :label_update_time %> + :  + <%= format_time(news.created_on) %> + + + <%= link_to l(:label_project_newother), news_path(news) %> + <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %> +
    - +
    <%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + <%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + <% if @project.project_type == 1 %> <% else %> <% end %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 38af97023..6c78af85a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -749,8 +749,9 @@ ul.user_course_sort li{list-style-type:none; } .font_description{ font-size:14px; - line-height: 1.5em; - + line-height: 1.5em; + word-break:break-all; + word-wrap: break-word; } .font_description2{ font-size:13px; From 2dc5b1f18ca33d7cc8abb129f21d023e9eb42cb2 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Oct 2014 14:39:07 +0800 Subject: [PATCH 09/19] =?UTF-8?q?#1198=20=E9=A1=B9=E7=9B=AE--=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=96=B0=E9=97=BB--=E6=96=B0=E9=97=BB=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E3=80=81=E8=AF=BE=E7=A8=8B--=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5--=E6=B7=BB=E5=8A=A0=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=EF=BC=9A=E9=80=9A=E7=9F=A5=E6=88=96=E8=AF=84=E8=AE=BA=E4=B8=AD?= =?UTF-8?q?=E5=90=AB=E5=9B=BE=E7=89=87=E5=86=85=E5=AE=B9=EF=BC=8C=E5=85=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_show.html.erb | 5 +++-- app/views/news/_project_show.html.erb | 31 ++++++++++++++++++++------- public/stylesheets/application.css | 5 +++++ 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 03731373c..6e03e8e34 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -123,9 +123,10 @@ + + diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 66580ddd5..665094cc8 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -80,7 +80,9 @@
    - <%= textilizable(@news, :description) %> + + <%= textilizable(@news, :description) %> +
    <%= link_to_attachments @news %>
    @@ -115,22 +117,35 @@ <% next if comment.new_record? %>
    - <%= link_to_user(news.author) if news.respond_to?(:author) %><%= l(:label_project_notice) %><%= link_to h(news.title), news_path(news) %> + <%= link_to_user(news.author) if news.respond_to?(:author) %> + <%= l(:label_project_notice) %> + <%= link_to h(news.title), news_path(news) %> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
    - <%= link_to_user(news.author) if news.respond_to?(:author) %><%= l(:label_project_newshare) %> <%= link_to h(news.title), news_path(news) %> - <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> + <%= link_to_user(news.author) if news.respond_to?(:author) %> + <%= l(:label_project_newshare) %> + <%= link_to h(news.title), news_path(news) %> + + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> +
    -

    + <%= textilizable(comment.comments) %> -

    <%= format_time(comment.created_on) %>
    - + diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 6c78af85a..5316838d3 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -753,6 +753,11 @@ ul.user_course_sort li{list-style-type:none; word-break:break-all; word-wrap: break-word; } +.font_description img{ + max-width: 90%; + max-height: 90%; /* 设置最大宽度和高度 */ +} + .font_description2{ font-size:13px; line-height: 1.5em; From 794f607b66d7e9b62863dda0dd0680fc775f46d6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Oct 2014 14:51:05 +0800 Subject: [PATCH 10/19] =?UTF-8?q?#1346=20=E4=BF=AE=E5=A4=8D=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=87=BA=E7=9A=84=E8=AF=BE=E7=A8=8B=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E3=80=81=E7=BC=BA=E9=99=B7=E7=AD=89=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A0=B7=E5=BC=8F=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=9A=84BUG=20=E8=A7=A3=E5=86=B3=E6=96=B9?= =?UTF-8?q?=E6=A1=88=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_show_bids.html.erb | 2 +- app/views/tags/_show_contests.html.erb | 2 +- app/views/tags/_show_courses.html.erb | 2 +- app/views/tags/_show_issues.html.erb | 2 +- app/views/tags/_show_open_source_projects.html.erb | 2 +- app/views/tags/_show_projects.html.erb | 2 +- app/views/tags/index.html.erb | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/tags/_show_bids.html.erb b/app/views/tags/_show_bids.html.erb index e789979e1..ef6c5ad52 100644 --- a/app/views/tags/_show_bids.html.erb +++ b/app/views/tags/_show_bids.html.erb @@ -6,7 +6,7 @@ <%= l(:label_tags_bid) %>:<%= link_to "#{bid.name}", :controller => "bids",:action => "show",:id => bid.id %>
    - <%= l(:label_tags_bid_description) %>:<%= bid.description %> + <%= l(:label_tags_bid_description) %>:<%= textilizable bid.description %> <%= bid.updated_on %>

    diff --git a/app/views/tags/_show_contests.html.erb b/app/views/tags/_show_contests.html.erb index 4eded773a..c711a36ea 100644 --- a/app/views/tags/_show_contests.html.erb +++ b/app/views/tags/_show_contests.html.erb @@ -6,7 +6,7 @@ <%= l(:label_tags_contest) %>:<%= link_to "#{contest.name}", :controller => "contests",:action => "show_contest",:id => contest.id %>
    - <%= l(:label_tags_contest_description) %>:<%= contest.description %> + <%= l(:label_tags_contest_description) %>:<%= textilizable contest.description %> <%= contest.updated_on %>

    diff --git a/app/views/tags/_show_courses.html.erb b/app/views/tags/_show_courses.html.erb index c99e3e22d..1e118541b 100644 --- a/app/views/tags/_show_courses.html.erb +++ b/app/views/tags/_show_courses.html.erb @@ -5,7 +5,7 @@

    <%= l(:label_course) %>:<%= link_to "#{course.name}",course_path(course) %>
    - <%= l(:label_new_course_description) %>:<%= course.description %> + <%= l(:label_new_course_description) %>:<%= textilizable course.description %> <%= course.updated_at %>

    diff --git a/app/views/tags/_show_issues.html.erb b/app/views/tags/_show_issues.html.erb index 399caf513..ea35dbff5 100644 --- a/app/views/tags/_show_issues.html.erb +++ b/app/views/tags/_show_issues.html.erb @@ -5,7 +5,7 @@

    <%= l(:label_tags_issue) %><%= link_to "#{issue.subject}",:controller => "issues",:action => "show",:id => issue.id %>
    - <%= l(:label_tags_issue_description) %>:<%= issue.description %> + <%= l(:label_tags_issue_description) %>:<%= textilizable issue.description %>

    <% end %> diff --git a/app/views/tags/_show_open_source_projects.html.erb b/app/views/tags/_show_open_source_projects.html.erb index 8ea67f9a7..5f9dae299 100644 --- a/app/views/tags/_show_open_source_projects.html.erb +++ b/app/views/tags/_show_open_source_projects.html.erb @@ -6,7 +6,7 @@

    <%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "open_source_projects",:action => "show",:id => prj.id %>
    - <%= l(:label_tags_project_description) %><%= prj.short_description %> + <%= l(:label_tags_project_description) %><%= textilizable prj.short_description %>

    diff --git a/app/views/tags/_show_projects.html.erb b/app/views/tags/_show_projects.html.erb index 5dade07ef..7ed32cba1 100644 --- a/app/views/tags/_show_projects.html.erb +++ b/app/views/tags/_show_projects.html.erb @@ -6,7 +6,7 @@

    <%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "projects",:action => "show",:id => prj.id %>
    - <%= l(:label_tags_project_description) %><%= prj.description %> + <%= l(:label_tags_project_description) %><%= textilizable prj.description %>

    diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index a5cda9944..bf2c8c31c 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -41,8 +41,8 @@ :show_flag => @obj_flag} %> - + - + <% end %> From 379e721191d43978174634c67ce243aa5b7913a8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Oct 2014 15:43:18 +0800 Subject: [PATCH 11/19] =?UTF-8?q?#1345=20=E4=BF=AE=E6=94=B9=E8=80=81?= =?UTF-8?q?=E5=B8=88=E7=BB=BC=E8=AF=84=E4=BB=B7=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_comprehensive_evaluation.html.erb | 78 +++++++------------ .../_teacher_evaluation.html.erb | 8 ++ config/locales/zh.yml | 2 + 3 files changed, 37 insertions(+), 51 deletions(-) create mode 100644 app/views/homework_attach/_teacher_evaluation.html.erb diff --git a/app/views/homework_attach/_comprehensive_evaluation.html.erb b/app/views/homework_attach/_comprehensive_evaluation.html.erb index 59654c52c..ac1793271 100644 --- a/app/views/homework_attach/_comprehensive_evaluation.html.erb +++ b/app/views/homework_attach/_comprehensive_evaluation.html.erb @@ -1,55 +1,31 @@ <% is_teacher = is_course_teacher User.current,homework.bid.courses.first %> -<% if comprehensive_evaluation != nil && comprehensive_evaluation.count > 0 %> -
    -
    - 作业综评: - <% if teaher_score != "0.00" %> - <%= render :partial => 'show_score', locals: {:stars => teaher_score} %> - <% end %> -
    -
    -
    <%= comprehensive_evaluation.first.notes%>
    + +
    +
    + <%= l(:lable_teacher_evaluation)%>: + <% if teaher_score != "0.00" %> + <%= render :partial => 'show_score', locals: {:stars => teaher_score} %> + <% end %> +
    +
    + <%= comprehensive_evaluation.first.notes if !comprehensive_evaluation.nil? && comprehensive_evaluation.count > 0%>
    - <% if is_teacher %> - <%= render :partial => 'evaluation', :locals => {:homework => homework} %> -
    - <%= render :partial => 'evaluation_add_jour', - :locals => {:homework_attach => homework, - :sta => 0, - :is_comprehensive_evaluation => 1, - :comprehensive_evaluation => comprehensive_evaluation.first.notes} %> -
    - <% end %>
    -<% else %> - <% if is_teacher %> -
    -
    - 作业综评: - <% if teaher_score != "0.00" %> - <%= render :partial => 'show_score', locals: {:stars => teaher_score} %> - <% end %> -
    - <%= render :partial => 'evaluation', :locals => {:homework => homework} %> -
    - <%= render :partial => 'evaluation_add_jour', - :locals => {:homework_attach => homework, - :sta => 0, - :is_comprehensive_evaluation => 1, - :comprehensive_evaluation => nil} %> -
    -
    - <% else %> -
    -
    - 作业综评: - <% if teaher_score != "0.00" %> - <%= render :partial => 'show_score', locals: {:stars => teaher_score} %> - <% end %> -
    - <% if teaher_score == "0.00" %> -
    老师还未进行评价!
    - <% end %> -
    + <% if(teaher_score == "0.00" && !(!comprehensive_evaluation.nil? && comprehensive_evaluation.count > 0))%> + <% if is_teacher %> + <%#= render :partial => 'teacher_evaluation', + :locals => {:homework => homework, :comprehensive_evaluation => comprehensive_evaluation} %> + <% else %> +
    + <%= l(:lable_teacher_evaluation_no) %> +
    + <% end %> <% end %> -<% end %> \ No newline at end of file +
    +
    + +
    + <% if is_teacher %> + <%= render :partial => 'teacher_evaluation',:locals => {:homework => homework} %> + <% end %> +
    \ No newline at end of file diff --git a/app/views/homework_attach/_teacher_evaluation.html.erb b/app/views/homework_attach/_teacher_evaluation.html.erb new file mode 100644 index 000000000..485238416 --- /dev/null +++ b/app/views/homework_attach/_teacher_evaluation.html.erb @@ -0,0 +1,8 @@ +<%= render :partial => 'evaluation', :locals => {:homework => homework} %> +
    + <%= render :partial => 'evaluation_add_jour', + :locals => {:homework_attach => homework, + :sta => 0, + :is_comprehensive_evaluation => 1, + :comprehensive_evaluation => l(:label_leave_a_message)} %> +
    \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a3ec030c4..ce0222e52 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2146,3 +2146,5 @@ zh: lable_input_class: 在此输入课时 lable_input_class_vilidate: 学时只能为整数 lable_school_list: 学校列表 + lable_teacher_evaluation_no: 老师还未进行评价 + lable_teacher_evaluation: 作业综评 From 0633d5661eabadaf9e3ba99315be12501ab31671 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 10 Oct 2014 17:13:06 +0800 Subject: [PATCH 12/19] =?UTF-8?q?1=E3=80=81=E8=AF=BE=E7=A8=8B=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=EF=BC=8C=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E8=B5=84=E6=BA=90=E4=B8=8B=E8=BD=BD=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=B7=BB=E5=8A=A0=E3=80=822=E3=80=81?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA=E5=8C=BA=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA=E9=99=84=E4=BB=B6=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E7=A7=81=E6=9C=89=E8=AE=BE=E7=BD=AE=E6=97=A0=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8E=9F=E5=9B=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E6=9C=AA=E5=A4=84=E7=90=86=E8=AE=A8=E8=AE=BA=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=83=85=E5=86=B5=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=A4=E6=96=AD=E5=B9=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 10 +++++----- app/controllers/attachments_controller.rb | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3ab894c69..0d9fe62a8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -257,12 +257,12 @@ class ApplicationController < ActionController::Base def authorize_attachment_download(ctrl = params[:controller], action = params[:action], global = false) if @attachment.container_type == "Memo" allowed = User.current.allowed_to?(:memos_attachments_download,nil,:global => true) - elsif @attachment.container_type == "Project" - return true - elsif @attachment.container_type == "course" - return true + elsif @attachment.container_type == "Message" && !@project.nil? + allowed = User.current.allowed_to?(:projects_attachments_download,@project,:global => false) + elsif @attachment.container_type == "Message" && !@course.nil? + allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false) elsif @attachment.container_type == "contest" - return true + return true else return true end diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index c511b5ace..08469ac48 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -22,7 +22,7 @@ class AttachmentsController < ApplicationController before_filter :delete_authorize, :only => :destroy before_filter :authorize_global, :only => :upload before_filter :authorize_attachment_download, :only => :download - before_filter :login_without_softapplication, only: [:download] + #before_filter :login_without_softapplication, only: [:download] accept_api_auth :show, :download, :upload require 'iconv' @@ -68,12 +68,20 @@ class AttachmentsController < ApplicationController elsif @attachment.container.is_a?(Project) project = @attachment.container candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) + elsif (@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board && + @attachment.container.board.project + project = @attachment.container.board.project + candown = User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course course = @attachment.container.course candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) elsif @attachment.container.is_a?(Course) course = @attachment.container candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) + elsif (@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board && + @attachment.container.board.course + course = @attachment.container.board.course + candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3 candown = true else @@ -321,8 +329,11 @@ private raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename if @attachment.container_type == 'Course' @course = @attachment.course - elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course + elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course_id)) && @attachment.container.course @course = @attachment.container.course + elsif !@attachment.container.nil? && ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board && + @attachment.container.board.course) + @course = @attachment.container.board.course else unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' @project = @attachment.project From 1333ea7a79ab4535997d6a0509341fb63733222a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 11 Oct 2014 10:22:44 +0800 Subject: [PATCH 13/19] =?UTF-8?q?#1349=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=E6=97=B6?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=AD=97=E6=95=B0=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index 0856da976..4eab5658c 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -6,11 +6,11 @@ <% unless replying %>


    - <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %> + <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :maxlength => 254 %>

    <% else %>


    - <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %> + <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %>

    <% end %>

    From 543bf2645e4f833cf9f4225db86a5d3f168f8745 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 11 Oct 2014 10:41:25 +0800 Subject: [PATCH 14/19] =?UTF-8?q?#1348=20=E4=BF=AE=E6=94=B9=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E8=BF=9F=E4=BA=A4=E5=88=A4=E6=96=AD=20=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9A=E8=BF=9F=E4=BA=A4=E5=8F=AA?= =?UTF-8?q?=E6=AF=94=E8=BE=83=E5=B9=B4=E6=9C=88=E6=97=A5=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E6=97=B6=E5=88=86=E7=A7=92=E4=B9=9F=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 3ed809fe0..0326f218c 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -78,7 +78,7 @@ <% end %>

    From ef3e0798cc527d9d21c83661c8e48ca43d899fb0 Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 11 Oct 2014 11:06:37 +0800 Subject: [PATCH 15/19] =?UTF-8?q?1=E3=80=81=E8=AF=BE=E7=A8=8B=E3=80=81?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=B2=A1=E6=9C=89=E5=85=AC=E5=BC=80=E5=AD=97?= =?UTF-8?q?=E6=A0=B7=E9=97=AE=E9=A2=98=E3=80=822=E3=80=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=99=84=E4=BB=B6=E7=A7=81=E6=9C=89=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E9=81=97=E6=BC=8F=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=9A=84=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=83=85=E5=86=B5=E6=B7=BB=E5=8A=A0=E3=80=82?= =?UTF-8?q?3=E3=80=81=E7=BC=96=E8=BE=91=E9=99=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E3=80=81=E5=85=AC=E5=BC=80=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E7=BC=96=E8=BE=91=E4=BF=9D=E5=AD=98=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/attachment.rb | 11 +++++++ app/views/attachments/_form_course.html.erb | 2 ++ .../lib/acts_as_attachable.rb | 30 +++++++++++-------- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index e25434e6e..90cfed429 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -411,6 +411,17 @@ class Attachment < ActiveRecord::Base end end + # Finds an attachment that matches the given token + def self.find_by_token_only(token) + if token.to_s =~ /^(\d+)\.([0-9a-f]+)$/ + attachment_id, attachment_digest = $1, $2 + attachment = Attachment.where(:id => attachment_id, :digest => attachment_digest).first + if attachment + attachment + end + end + end + # Bulk attaches a set of files to an object # # Returns a Hash of the results: diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index e5fbd3f82..a56c5d1d4 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -7,6 +7,7 @@ <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + <%= l(:field_is_public)%>: <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> @@ -18,6 +19,7 @@ <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + <%= l(:field_is_public)%>: <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb index f6dc31c64..5e344d735 100644 --- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb +++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb @@ -79,9 +79,11 @@ module Redmine if res.is_public if( (self.class.to_s=="Project" && self.is_public == false) || (self.has_attribute?(:project) && self.project && self.project.is_public == false) || + (self.has_attribute?(:board) && self.board.project && self.board.project.is_public == false) || (self.class.to_s=="HomeworkAttach" && self.bid.reward_type == 3) || (self.class.to_s=="Course" && self.is_public == false) || - (self.has_attribute?(:course) && self.course && self.course.is_public == false) + (self.has_attribute?(:course) && self.course && self.course.is_public == false) || + (self.has_attribute?(:board) && self.board.course && self.board.course.is_public == false) ) res.is_public = false end @@ -120,18 +122,22 @@ module Redmine end if attachments.is_a?(Array) attachments.each do |attachment| - next unless attachment.is_a?(Hash) - a = nil - if file = attachment['file'] - next unless file.size > 0 - a = Attachment.create(:file => file, :author => author) - elsif token = attachment['token'] - a = Attachment.find_by_token(token) - next unless a - a.filename = attachment['filename'] unless attachment['filename'].blank? - a.content_type = attachment['content_type'] + if attachment.is_a?(Hash) + a = nil + file = attachment['file'] + token = attachment['token'] + t = file && file.size > 0 + if file && file.size > 0 + a = Attachment.create(:file => file, :author => author) + elsif token + a = Attachment.find_by_token_only(token) + if a + a.filename = attachment['filename'] unless attachment['filename'].blank? + a.content_type = attachment['content_type'] + end + end end - if !attachment[:is_public] + if a && !attachment[:is_public] a.is_public = false end set_attachment_public(a) From dfc536bff963f8d93b7d0386bca0d1c0326dd634 Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 11 Oct 2014 11:55:25 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E9=99=84=E4=BB=B6=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=97=B6=E8=AE=BE=E7=BD=AE=E7=A7=81=E6=9C=89=E4=B8=BA=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form_course.html.erb | 4 ++-- lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index a56c5d1d4..0446db37d 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -8,7 +8,7 @@ link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> <%= l(:field_is_public)%>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public')%> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <% end %> @@ -20,7 +20,7 @@ link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> <%= l(:field_is_public)%>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public')%> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <% end %> diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb index 5e344d735..85871a19c 100644 --- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb +++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb @@ -137,8 +137,10 @@ module Redmine end end end - if a && !attachment[:is_public] + if a && !attachment['is_public_checkbox'] a.is_public = false + elsif a && attachment['is_public_checkbox'] + a.is_public = true end set_attachment_public(a) next unless a From 00278d8571124c9100289650386a0c5a23cda338 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 11 Oct 2014 14:18:18 +0800 Subject: [PATCH 17/19] =?UTF-8?q?#1347=20=20=E4=BF=AE=E5=A4=8D=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=A0=87=E7=AD=BE=E6=90=9C=E7=B4=A2=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=98=BE=E7=A4=BA=E8=B6=85=E5=87=BA=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/users.html.erb | 2 +- app/views/tags/_show_attachments.html.erb | 2 +- public/stylesheets/application.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/users.html.erb b/app/views/admin/users.html.erb index 4a76a42ef..c70196a2f 100644 --- a/app/views/admin/users.html.erb +++ b/app/views/admin/users.html.erb @@ -26,7 +26,7 @@  
    -
    <%= image_tag(url_to_avatar(comment.author), :class => "avatar")%> + <%= image_tag(url_to_avatar(comment.author), :class => "avatar")%> + - + + + - - + +
    <%= link_to_user(comment.author) if comment.respond_to?(:author) %> <%= l(:label_project_newadd) %><%= l(:label_comment_plural) %> + <%= link_to_user(comment.author) if comment.respond_to?(:author) %> + <%= l(:label_project_newadd) %> + <%= l(:label_comment_plural) %> +
    -

    + <%= textilizable(comment.comments) %> -

    <%= format_time(comment.created_on) %><%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> + <%= format_time(comment.created_on) %> + + <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, + :data => {:confirm => l(:text_are_you_sure)}, + :method => :delete, + :title => l(:button_delete) %> +
    - <% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %> + <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %> 迟交 <% end %>
    +
    <%= sort_header_tag('login', :caption => l(:field_login)) %> diff --git a/app/views/tags/_show_attachments.html.erb b/app/views/tags/_show_attachments.html.erb index 8b0bb1f8b..83fb857f4 100644 --- a/app/views/tags/_show_attachments.html.erb +++ b/app/views/tags/_show_attachments.html.erb @@ -4,7 +4,7 @@
    <% attachments_results.each do |file| %>

    -

    +
    diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 50dc9393d..d7bf08fb5 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1389,7 +1389,7 @@ a.toggle-all:hover {text-decoration:none;} table.list tbody tr:hover { background-color:#ffffdd; } table.list tbody tr.group:hover { background-color:inherit; } -table td {padding:2px;} +table td {padding:2px;word-break: break-all;word-wrap: break-word;} table p {margin:0;} .odd {background-color:#f6f7f8;} .even {background-color: #fff;} From 0d6116d216fc9e21dd2d795f952a9371faa3b266 Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 11 Oct 2014 14:47:48 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=99=84=E4=BB=B6=E6=97=B6=E5=85=AC=E5=BC=80?= =?UTF-8?q?=E4=B8=8E=E5=90=A6=E5=B1=9E=E6=80=A7=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 16de21226..52050ee06 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -5,7 +5,7 @@ <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> <%= l(:field_is_public)%>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> <%= if attachment.id.nil? #待补充代码 else From 3dca123b0f5af5bee7213da94b1b87b16e14aa5d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 11 Oct 2014 14:51:28 +0800 Subject: [PATCH 19/19] =?UTF-8?q?#1209=20=E4=BF=AE=E5=A4=8D=E8=80=81?= =?UTF-8?q?=E5=B8=88=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84BUg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 0393206b7..a7d804321 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -17,6 +17,7 @@ class ZipdownController < ApplicationController @project = obj.courses[0] end end + def assort obj_class = params[:obj_class] obj_id = params[:obj_id] @@ -76,18 +77,18 @@ class ZipdownController < ApplicationController homeattaches = bid.homeworks #记录所有作业是不是有附件,有一个附件就改为true - has_file = false + #has_file = false # 得到每一个人所有文件打包的zip文件 # 并将每一个人的zip打包为一个并返回路径 user_zip_paths = homeattaches.map do |homeattach| if homeattach.attachments.count > 0 zip_homework_by_user homeattach - has_file = true unless has_file + #has_file = true unless has_file end end - unless has_file - render file: 'public/no_file_fond.html' , :layout => 'course_base' - end + #unless has_file + # render file: 'public/no_file_fond.html' , :layout => 'course_base' + #end zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER #@paths = homeworks_attach_path