This commit is contained in:
sw 2014-09-16 15:38:49 +08:00
commit 7c97c0391b
13 changed files with 78 additions and 29 deletions

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,5 @@
class ContestNotificationController < ApplicationController
layout 'contest_base'
def show
@notification = ContestNotification.find(params[:id])
end

View File

@ -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

View File

@ -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

View File

@ -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 || []

View File

@ -179,7 +179,7 @@ module ProjectsHelper
# never use unless and else
# unless project.is_public == 1
if project.is_public != 1
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
s = "<span class='private_project'>#{l(:label_private)}</span>".html_safe
else
s = "".html_safe
end
@ -193,7 +193,7 @@ module ProjectsHelper
# unless project.is_public
if !project.is_public
# end longjun
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
s = "<span class='private_project'>#{l(:label_private)}</span>".html_safe
else
s = "".html_safe
end

View File

@ -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)

View File

@ -1,6 +1,4 @@
<!-- added by bai -->
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(@project) %> * 4 = <%= format("%.2f" , issue_num(@project) * 4).to_i %></div>
<div><%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(@project) %> * 1 = <%= format("%.2f" , issue_journal_num(@project)).to_i %></div>
<div><%= 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 %></div>
<!-- end -->
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(project) %> * 4 = <%= format("%.2f" , issue_num(project) * 4).to_i %></div>
<div><%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(project) %> * 1 = <%= format("%.2f" , issue_journal_num(project)).to_i %></div>
<div><%= 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 %></div>

View File

@ -1,5 +1,2 @@
<!-- added by bai -->
<div><%= l(:label_new_number) %> * 1 = <%= news_num(@project) %> * 1 = <%= format("%.2f" , news_score(@project)).to_i %></div>
<div><%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %></div>
<!-- end -->
<div><%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %></div>

View File

@ -3,8 +3,8 @@
<%= l(:label_projects_score) %>
<div> = <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> +
<%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %></div>
<div> = <%= 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 %></div>
<div> = <%= format("%.2f" , project_scores(@project)).to_i %></div>
<div> = <%= 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 %></div>
<div> = <%= format("%.2f" , project_scores(project)).to_i %></div>
<!-- end -->

View File

@ -21,35 +21,65 @@
</table>
</div>
<script type="text/javascript">
function show_div(url)
{
if(url == 'project_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/project_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'issue_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/issue_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'news_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/news_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'file_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/file_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'code_submit_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/code_submit_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'projects_topic_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/projects_topic_score_index', :locals => {:project => @project}) %>');
}
}
</script>
<div class="tabs_new">
<ul>
<li>
<%= 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 %>
</li>
<li>
<%= 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 %>
</li>
<li>
<%= 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 %>
</li>
<li>
<%= 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 %>
</li>
<li>
<%= 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 %>
</li>
<li>
<%= 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 %>
</li>
</ul>
</div>
<div id="show_score_detail">
<%= render :partial => 'projects/project_score_index', :locals => {:index => 0 } %>
<%= render :partial => 'projects/project_score_index', :locals => {:project => @project } %>
</div>
<!-- end -->

View File

@ -1,5 +1,3 @@
<!-- added by bai -->
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/show_projects_score') %>');
showModal('ajax-modal', '400px');
$('#ajax-modal').addClass('new-watcher');
<!-- end -->