From b475cd51e7d9ec28d1873ac51491b46b4bdf4957 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 24 Nov 2014 18:23:56 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=95=99=E8=A8=80=E5=AE=9E=E5=90=8D=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 1 + .../homework_attach/_journal_reply_items.html.erb | 10 ++++++++-- app/views/homework_attach/add_jour_reply.js.erb | 2 +- app/views/words/_journal_reply_items.html.erb | 4 ++-- app/views/words/_new_respond.html.erb | 4 ++-- app/views/words/create_reply.js.erb | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 89fa0e1dc..4e7768785 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -47,6 +47,7 @@ class WordsController < ApplicationController # 删除留言功能要调用destroy,也记得在destroy.js中修改 # deny api. api useless + @show_real_name = params[:show_real_name] || false parent_id = params[:reference_id] author_id = User.current.id reply_user_id = params[:reference_user_id] diff --git a/app/views/homework_attach/_journal_reply_items.html.erb b/app/views/homework_attach/_journal_reply_items.html.erb index 726efb0c1..dd09bd84f 100644 --- a/app/views/homework_attach/_journal_reply_items.html.erb +++ b/app/views/homework_attach/_journal_reply_items.html.erb @@ -1,3 +1,4 @@ +<% show_real_name ||= false %> <% reply_allow = JournalsForMessage.create_by_user? User.current %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
@@ -12,8 +13,13 @@ <% id = 'project_respond_form_'+ reply.id.to_s %> <%= link_to reply.user.name, user_path(reply.user) %> 回复 - <% if show_name %> - <%= link_to reply.at_user.name,user_path(reply.at_user) %> + <% parent_jour = JournalsForMessage.find reply.m_reply_id %> + <% if show_name && parent_jour %> + <% if show_real_name%> + <%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %> + <% else %> + <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> + <% end %> <% else %> <%= l(:label_anonymous) %> <% end %> diff --git a/app/views/homework_attach/add_jour_reply.js.erb b/app/views/homework_attach/add_jour_reply.js.erb index 564229d81..34cec1cca 100644 --- a/app/views/homework_attach/add_jour_reply.js.erb +++ b/app/views/homework_attach/add_jour_reply.js.erb @@ -1,7 +1,7 @@ <% if @save_succ %> var pre_append = $('<%= j( render :partial => "journal_reply_items", - :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm} + :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm, :show_real_name => true} ) %>').hide(); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); pre_append.fadeIn(600); diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index ebca999a6..76359794c 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -20,7 +20,7 @@ <% parent_jour = JournalsForMessage.find reply.m_reply_id %> <% if show_name && parent_jour %> <% if show_real_name%> - <%= link_to parent_jour.user.lastname+reply.user.firstname, user_path(parent_jour.user) %> + <%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %> <% else %> <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> <% end %> @@ -51,7 +51,7 @@
<% if reply_allow %> - <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %> + <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name, :show_real_name => show_real_name} %> <% end %>
diff --git a/app/views/words/_new_respond.html.erb b/app/views/words/_new_respond.html.erb index 5d615578d..a4cad1a38 100644 --- a/app/views/words/_new_respond.html.erb +++ b/app/views/words/_new_respond.html.erb @@ -1,5 +1,5 @@ - -<%= form_tag(words_create_reply_path, :remote => true) do %> +<% show_real_name ||= false%> +<%= form_tag(words_create_reply_path(:show_real_name=>show_real_name), :remote => true) do %> <%= text_area_tag 'user_notes', "", :class => 'noline', :style => "resize: none;", :rows => 4, :placeholder => l(:label_projects_feedback_respond_content), diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index eeb4e3ef6..04cbee26e 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -1,7 +1,7 @@ <% if @save_succ %> var pre_append = $('<%= j( render :partial => "words/journal_reply_items", - :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name} + :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name, :show_real_name=>@show_real_name} ) %>').hide(); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); pre_append.fadeIn(600); From 2c135f5e8d4d5b46fb991cdd45edafcb70220fbe Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Nov 2014 09:12:15 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=E8=BF=94=E5=9B=9E404?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_tag.html.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index c0ecf5c84..914226545 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -76,14 +76,16 @@ <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> From d19bf06da47a4488e423fc7a37f60dc58c1b1dd7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Nov 2014 09:16:22 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0tagform=E8=A1=A8=E5=8D=95=E5=86=85=E5=85=83?= =?UTF-8?q?=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_tag.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 914226545..d9f16a40b 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -76,14 +76,14 @@ <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index b821e2495..d11ea3333 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -49,8 +49,8 @@ <% else %> <% if is_my_homework %> - - <% if @bid.comment_status == 0 %> + + <% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0 %>
  • <%= link_to l(:button_edit), edit_homework_attach_path(homework) %> <% if homework.user == User.current || User.current.admin? %> @@ -68,10 +68,14 @@ <%= l(:button_edit) %> <% if homework.user == User.current || User.current.admin? %> - <%=l(:label_bid_respond_delete)%> + + <%=l(:label_bid_respond_delete)%> + <% else %> - <%=l(:label_logout) %> + + <%=l(:label_logout) %> + <% end %>
  • <% end %> @@ -88,7 +92,9 @@ <% elsif @bid.comment_status == 2%>
  • - <%= l(:label_anonymous_comments) %> + + <%= l(:label_anonymous_comments) %> + <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>   迟交! <% end %> diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb index a8736592c..8ef696e0c 100644 --- a/app/views/homework_attach/_homeworks_list.html.erb +++ b/app/views/homework_attach/_homeworks_list.html.erb @@ -35,16 +35,9 @@
  • 您还没交作业,请创建作业!
  • - <% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0%> -
  • <%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
  • - <% else %> -
  • - 提交作业 -
  • - <% end %>
    <% end %> diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index b3acd8f83..b382b6d46 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -55,7 +55,7 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px;line-hei .c_grey{ color:#999; font-weight:normal;} .dis ul li.wname02 a{ width:200px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} .dis ul li.wmine{ margin:12px 0 0 10px;} -.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;} +.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;line-height: 1.9;} .wzan{ margin:15px 0 0 25px; width:32px; height:44px;} .wzan a{ display: block;text-align: center;} a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;} From 5bcc76d399b8b493f6184f3f765e483db76b0e21 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Nov 2014 10:35:43 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=A1=B9=E7=9B=AE=E7=AC=AC=E4=B8=80=E9=A1=B9?= =?UTF-8?q?=E4=B8=BA=E8=AF=B7=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_attach_helper.rb | 2 +- config/settings.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb index 52a2c398a..63332e564 100644 --- a/app/helpers/homework_attach_helper.rb +++ b/app/helpers/homework_attach_helper.rb @@ -60,7 +60,7 @@ module HomeworkAttachHelper memberships = User.current.memberships.all(:conditions => cond) projects = memberships.map(&:project) not_have_project = [] - not_have_project << "" + not_have_project << Setting.please_chose not_have_project << 0 type = [] type << not_have_project diff --git a/config/settings.yml b/config/settings.yml index ccc1cac9d..381e8a302 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -256,6 +256,8 @@ course_domain: default: course.trustie.net repository_domain: default: repository.trustie.net +please_chose: + default: 请选择 plugin_redmine_ckeditor: serialized: true default: --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess From 89e5eda3976f3e2a8b145de4f26be3155814dcb7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Nov 2014 10:52:07 +0800 Subject: [PATCH 07/12] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BC=96=E8=BE=91=E8=AE=A8=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=97=B6=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=202.=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BC=96=E8=BE=91=E8=AE=A8=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=97=B6=E7=AC=AC=E4=B8=80=E6=AC=A1=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A1=AE=E5=AE=9A=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/edit.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb index 3d4b6a4d2..c50bd5dff 100644 --- a/app/views/messages/edit.html.erb +++ b/app/views/messages/edit.html.erb @@ -15,7 +15,9 @@ } do |f| %> <%= render :partial => 'form', :locals => {:f => f, :replying => !@message.parent.nil?} %> - <%= submit_tag l(:button_save) %> - <%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board, :id => @message}, 'message-form') %> + + <%= l(:button_save) %> + + <%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %> <% end %>
    From fef005d2d37ff30c3983bc72df23201d3fee8d4d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Nov 2014 11:29:09 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 5 +++-- app/views/users/search.html.erb | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0db7facbc..4049c2ae8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -376,12 +376,13 @@ class UsersController < ApplicationController "show_changesets" => true } scope = User.logged.status(@status) - scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present? + @search_by = params[:search_by] ? params[:search_by][:id] : 0 + scope = scope.like(params[:name],@search_by) if params[:name].present? @user_count = scope.count @user_pages = Paginator.new @user_count, @limit, params['page'] @user_base_tag = params[:id] ? 'base_users':'users_base' @offset ||= @user_pages.reverse_offset - unless @offset == 0 + unless @offset == 0 @users = scope.offset(@offset).limit(@limit).all.reverse else limit = @user_count % @limit diff --git a/app/views/users/search.html.erb b/app/views/users/search.html.erb index f5bbc3b8d..f8d5a7cf3 100644 --- a/app/views/users/search.html.erb +++ b/app/views/users/search.html.erb @@ -20,8 +20,8 @@ - - <%= submit_tag l(:button_create), :class => "ButtonAddTags"%> - <%= submit_tag l(:button_create_and_continue), :class => 'ButtonAddTags' %> - <%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form','preview',{:class => "ButtonColor"}%> + + <%= l(:button_create)%> + + <%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form','preview',{:class => "ButtonColor m3p10"}%> <%= javascript_tag "$('#issue_subject').focus();" %> <% end %> From 918cf6c134408a9af3a643a5f8c39459e54fbbb9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Nov 2014 14:17:39 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=B7=BB=E5=8A=A0=E6=97=B6=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/application.css | 22 ++++++++++++++++++++++ public/stylesheets/nyan.css | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 6cbd8bc7d..05b740b09 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2894,4 +2894,26 @@ div.repos_explain{ #membership_project_id option { width: 190px; +} + +input[class~='ButtonClolr'],.ButtonColor{ + + color: #fffbff !important; + padding: 5px; + width: auto; + height: 24px ; + font-family: '微软雅黑',Arial,Helvetica,sans-serif; + font-size: 15px; + text-align: center; + background: #15bccf !important; + border: 0px solid #15bccf ; + display:inline-block +} + +input[class~='m3p10'], .m3p10 { + margin: 0; + padding: 3px 10px !important; + height: 20px; + display: inline-block; + color: #ffffff; } \ No newline at end of file diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index bdec84b4c..7cee0aa9b 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -474,20 +474,6 @@ body { position: relative; top: 1px; } -input[class~='ButtonClolr'],.ButtonColor{ - - color: #fffbff !important; - padding: 5px; - width: auto; - height: 24px ; - font-family: '微软雅黑',Arial,Helvetica,sans-serif; - font-size: 15px; - text-align: center; - background: #15bccf !important; - border: 0px solid #15bccf ; - display:inline-block -} - input[class~='whiteButton'], .whiteButton { -moz-box-shadow: inset 0px 1px 0px 0px #ffffff; @@ -537,14 +523,6 @@ input[class~='whiteButton']:active, .whiteButton:active { color: #ffffff; } -input[class~='m3p10'], .m3p10 { - margin: 0; - padding: 3px 10px !important; - height: 20px; - display: inline-block; - color: #ffffff; -} - input[class~='h30'], .h30 { height: 30px; } From 874936a13124718a11e87c55d883648ffd2fb0ce Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 25 Nov 2014 16:00:52 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=A2=AB=E8=BF=98?= =?UTF-8?q?=E5=8E=9F=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 5c3503718..31463d691 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -64,7 +64,7 @@ class AttachmentsController < ApplicationController # modify by nwb # 下载添加权限设置 candown = false - if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project + if @attachment.container.class.to_s != "HomeworkAttach" && (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project project = @attachment.container.project candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) elsif @attachment.container.is_a?(Project) From 23907c5c017aa9d586c4d4320dea6c851b94f240 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Nov 2014 16:02:11 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_project_show.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 8128797c0..1a5cbd2fa 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -18,8 +18,9 @@ <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= render :partial => 'messages/form', :locals => {:f => f} %>

    - - <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %>

    + <%= l(:button_submit)%> + <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'ButtonColor m3p10' %> +

    <% end %>
    <% end %>