From 3dca2185beba966e81ba5df66c92eeb6176d4f63 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 16 Sep 2014 08:56:45 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E9=80=9A=E5=91=8A?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=AF=BC=E8=88=AA=E6=A0=8F?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E3=80=82=E5=8E=9F=E5=9B=A0=E6=9C=AA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0layout=EF=BC=8C=E8=A7=A3=E5=86=B3=EF=BC=9A=E5=8A=A0?= =?UTF-8?q?=E4=B8=8Alayout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contest_notification_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/contest_notification_controller.rb b/app/controllers/contest_notification_controller.rb index 8c6e51bd5..461b62457 100644 --- a/app/controllers/contest_notification_controller.rb +++ b/app/controllers/contest_notification_controller.rb @@ -1,4 +1,5 @@ class ContestNotificationController < ApplicationController + layout 'contest_base' def show @notification = ContestNotification.find(params[:id]) end From ffa4ec193ebaba698ee6a0f99608ffdfd8a90d57 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 16 Sep 2014 09:22:27 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E6=9F=A5=E7=9C=8B=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AF=BC=E8=88=AA=E6=A0=8F=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=EF=BC=8C=E5=8E=9F=E5=9B=A0=EF=BC=9A=E4=B8=BA=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?layout=EF=BC=8C=E8=A7=A3=E5=86=B3=EF=BC=9A=E5=8A=A0=E4=B8=8Alay?= =?UTF-8?q?out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/journals_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb index 28505a047..77ee9d648 100644 --- a/app/controllers/journals_controller.rb +++ b/app/controllers/journals_controller.rb @@ -54,6 +54,11 @@ class JournalsController < ApplicationController end (render_404; return false) unless @issue && @detail @diff = Redmine::Helpers::Diff.new(@detail.value, @detail.old_value) + respond_to do |format| + format.html { + render :layout => 'project_base' + } + end end def new From 8cc14546f89d2af0dba81270e88fd59001c286bd Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 16 Sep 2014 10:27:20 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E8=B5=84=E6=BA=90=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E4=B9=9F=E5=8F=AF=E4=BB=A5=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=EF=BC=8C=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E7=A7=81?= =?UTF-8?q?=E6=9C=89=E6=A0=87=E7=AD=BE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- app/helpers/projects_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 4525176ac..62bef8fb1 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -361,7 +361,7 @@ private def login_without_softapplication referer = request.headers['Referer'] - require_login unless referer =~ /softapplication/ + require_login unless referer =~ /softapplication/ || referer =~ /memos/ end def renderTag diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index dfacff864..47f33f34a 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -181,7 +181,7 @@ module ProjectsHelper # unless project.is_public == 1 if project.is_public != 1 - s = "#{l(:lable_private)}".html_safe + s = "#{l(:label_private)}".html_safe else s = "".html_safe end @@ -197,7 +197,7 @@ module ProjectsHelper if !project.is_public # end longjun - s = "#{l(:lable_private)}".html_safe + s = "#{l(:label_private)}".html_safe else s = "".html_safe end From ed81275d17b0f605e540ddb88b0e45a414e4d3f1 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 16 Sep 2014 10:50:49 +0800 Subject: [PATCH 4/7] =?UTF-8?q?#1256=EF=BC=8C=E7=BC=96=E8=BE=91=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E7=9A=84=E6=8C=89=E9=92=AE=E6=98=AF=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E8=80=8C=E5=BC=95=E7=94=A8=E5=92=8C=E5=88=A0=E9=99=A4=E9=83=BD?= =?UTF-8?q?=E6=98=AF=E6=96=87=E5=AD=97=EF=BC=8C=E5=B0=86=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=B9=9F=E6=94=B9=E4=B8=BA=E6=96=87=E5=AD=97=E4=BF=9D=E6=8C=81?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/show.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 9b68e80fc..577c3ff7f 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -23,7 +23,8 @@ )if !@memo.locked? && User.current.logged? %> <%= link_to( - image_tag('edit.png'), + #image_tag('edit.png'), + l(:button_edit), {:action => 'edit', :id => @memo}, :method => 'get', :title => l(:button_edit) From 56c31d6e2f11d1dc0d2de6c140d1c06a64a30d3c Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Tue, 16 Sep 2014 11:41:49 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E7=BD=91=E9=A1=B5=E6=A0=87=E9=A2=98Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 1 - app/helpers/application_helper.rb | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c1593e320..3f6e3db58 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -555,7 +555,6 @@ class ProjectsController < ApplicationController # Show @project def show - @project_type = params[:project_type] # try to redirect to the requested menu item diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ef18793ab..1112cebc6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -635,6 +635,11 @@ module ApplicationHelper end def html_title(*args) + #點擊項目版本庫 多觸發一次 字符串為"/" + #暫時解決方法 直接判斷 + if(args == ["/"]) + args = [] + end first_page = FirstPage.where("page_type = 'project'").first if args.empty? title = @html_title || [] From bce403f6245ffb168504a87d0460dbda06d989c8 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 16 Sep 2014 14:06:49 +0800 Subject: [PATCH 6/7] =?UTF-8?q?#1242=20=E7=82=B9=E5=87=BB=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BE=97=E5=88=86=E5=9C=A8=E5=BC=B9=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E6=A1=86=E4=B8=AD=E7=82=B9=E5=87=BB=E5=90=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=BE=97=E5=88=86=E6=98=8E=E7=BB=86=E5=8F=8D=E5=BA=94=E6=85=A2?= =?UTF-8?q?=E3=80=82=E5=8E=9F=E5=9B=A0=E9=9C=80=E8=A6=81=E5=90=91=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E8=AF=B7=E6=B1=82=E6=95=B0=E6=8D=AE=E3=80=82?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=EF=BC=9A=E4=BD=BF=E7=94=A8js=E5=9C=A8?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=A4=84=E7=90=86=E5=90=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E4=B8=8D=E5=9C=A8=E5=90=91=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E5=8F=91=E9=80=81=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 1 - .../projects/_issue_score_index.html.erb | 10 ++--- app/views/projects/_news_score_index.html.erb | 5 +-- .../projects/_project_score_index.html.erb | 8 ++-- .../projects/_show_projects_score.html.erb | 44 ++++++++++++++++--- app/views/projects/show_projects_score.js.erb | 2 - 6 files changed, 46 insertions(+), 24 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c1593e320..fc331e96d 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -842,7 +842,6 @@ class ProjectsController < ApplicationController @project = nil end -# added by bai def show_projects_score render :layout => false end diff --git a/app/views/projects/_issue_score_index.html.erb b/app/views/projects/_issue_score_index.html.erb index 7353ce5a3..729369280 100644 --- a/app/views/projects/_issue_score_index.html.erb +++ b/app/views/projects/_issue_score_index.html.erb @@ -1,6 +1,4 @@ - -
<%= l(:label_issue_number) %> * 4 = <%= issue_num(@project) %> * 4 = <%= format("%.2f" , issue_num(@project) * 4).to_i %>
-
<%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(@project) %> * 1 = <%= format("%.2f" , issue_journal_num(@project)).to_i %>
-
<%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(@project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(@project)).to_i %> - = <%= format("%.2f" , issue_score(@project)).to_i %>
- \ No newline at end of file +
<%= l(:label_issue_number) %> * 4 = <%= issue_num(project) %> * 4 = <%= format("%.2f" , issue_num(project) * 4).to_i %>
+
<%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(project) %> * 1 = <%= format("%.2f" , issue_journal_num(project)).to_i %>
+
<%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(project)).to_i %> + = <%= format("%.2f" , issue_score(project)).to_i %>
diff --git a/app/views/projects/_news_score_index.html.erb b/app/views/projects/_news_score_index.html.erb index b3d66efeb..c936ece05 100644 --- a/app/views/projects/_news_score_index.html.erb +++ b/app/views/projects/_news_score_index.html.erb @@ -1,5 +1,2 @@ - -
<%= l(:label_new_number) %> * 1 = <%= news_num(@project) %> * 1 = <%= format("%.2f" , news_score(@project)).to_i %>
-
<%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %>
- \ No newline at end of file +
<%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %>
\ No newline at end of file diff --git a/app/views/projects/_project_score_index.html.erb b/app/views/projects/_project_score_index.html.erb index 3cee4413c..7a3022f44 100644 --- a/app/views/projects/_project_score_index.html.erb +++ b/app/views/projects/_project_score_index.html.erb @@ -3,8 +3,8 @@ <%= l(:label_projects_score) %>
= <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> + <%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %>
-
= <%= format("%.2f" , issue_score(@project)).to_i %> + <%= format("%.2f" , news_score(@project)).to_i %> + - <%= format("%.2f" , documents_score(@project)).to_i %> + <%= format("%.2f" , changesets_score(@project)).to_i %> + - <%= format("%.2f" , board_message_score(@project)).to_i %>
-
= <%= format("%.2f" , project_scores(@project)).to_i %>
+
= <%= format("%.2f" , issue_score(project)).to_i %> + <%= format("%.2f" , news_score(project)).to_i %> + + <%= format("%.2f" , documents_score(project)).to_i %> + <%= format("%.2f" , changesets_score(project)).to_i %> + + <%= format("%.2f" , board_message_score(project)).to_i %>
+
= <%= format("%.2f" , project_scores(project)).to_i %>
\ No newline at end of file diff --git a/app/views/projects/_show_projects_score.html.erb b/app/views/projects/_show_projects_score.html.erb index 156e63f7b..57af1f138 100644 --- a/app/views/projects/_show_projects_score.html.erb +++ b/app/views/projects/_show_projects_score.html.erb @@ -21,35 +21,65 @@ + +
  • - <%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> : + <%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> : <%= format("%.2f" , project_scores(@project) ).to_i %>
  • - <%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> : + <%= link_to l(:label_issue_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= format("%.2f" , issue_score(@project)).to_i %>
  • - <%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> : + <%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> : <%= format("%.2f" , news_score(@project)).to_i %>
  • - <%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> : + <%= link_to l(:label_file_score), "javascript:void(0)", :onclick => "show_div('file_score_index')"%> : <%= format("%.2f" , documents_score(@project)).to_i %>
  • - <%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> : + <%= link_to l(:label_code_submit_score), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> : <%= format("%.2f" , changesets_score(@project)).to_i %>
  • - <%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> : + <%= link_to l(:label_topic_score), "javascript:void(0)", :onclick => "show_div('projects_topic_score_index')"%> : <%= format("%.2f" , board_message_score(@project)).to_i %>
- <%= render :partial => 'projects/project_score_index', :locals => {:index => 0 } %> + <%= render :partial => 'projects/project_score_index', :locals => {:project => @project } %>
\ No newline at end of file diff --git a/app/views/projects/show_projects_score.js.erb b/app/views/projects/show_projects_score.js.erb index 540db5395..bf84cbe73 100644 --- a/app/views/projects/show_projects_score.js.erb +++ b/app/views/projects/show_projects_score.js.erb @@ -1,5 +1,3 @@ - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/show_projects_score') %>'); showModal('ajax-modal', '400px'); $('#ajax-modal').addClass('new-watcher'); - \ No newline at end of file From aabd18329923131908f7834d0478911fb16f4c6e Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Tue, 16 Sep 2014 14:08:44 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=A7=93=E6=B0=8F=E6=96=87=E6=9C=AC=E6=A1=86=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index d0f94b119..02163889b 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -110,6 +110,8 @@ class AccountController < ApplicationController @cache_city = params[:city]||"" #城市 @cache_enterprise_name = params[:enterprise_name]||"" #企业 + firstname_code = "" + lastname_code = "" (redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration] if request.get? session[:auth_source_registration] = nil @@ -119,6 +121,8 @@ class AccountController < ApplicationController @user = User.new @user.safe_attributes = user_params if params[:identity] == "2" # 2 企业 + firstname_code = @user.firstname + lastname_code = @user.lastname @user.firstname = params[:enterprise_name] @user.lastname = l(:field_enterprise) end @@ -141,10 +145,18 @@ class AccountController < ApplicationController end if(@cache_identityy == "") + if params[:identity] == "2" + @user.firstname = firstname_code + @user.lastname = lastname_code + end flash.now[:error]= l(:label_identity)+l(:'activerecord.errors.messages.empty') return end if(@cache_city == "") + if params[:identity] == "2" + @user.firstname = firstname_code + @user.lastname = lastname_code + end flash.now[:error]= l(:label_location)+l(:'activerecord.errors.messages.empty') return end @@ -174,6 +186,10 @@ class AccountController < ApplicationController end end + if params[:identity] == "2" + @user.firstname = firstname_code + @user.lastname = lastname_code + end end # Token based account activation