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 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/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 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 diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c1593e320..c40ac384a 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 @@ -842,7 +841,6 @@ class ProjectsController < ApplicationController @project = nil end -# added by bai def show_projects_score render :layout => false end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1b0f25fcf..38b97a501 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 || [] diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 5ae2b0864..a19819a02 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -179,7 +179,7 @@ module ProjectsHelper # never use unless and else # 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 @@ -193,7 +193,7 @@ module ProjectsHelper # unless project.is_public if !project.is_public # end longjun - s = "#{l(:lable_private)}".html_safe + s = "#{l(:label_private)}".html_safe else s = "".html_safe end 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) 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 @@ + +
- <%= 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