parent
a04122bb8e
commit
988f8b7918
|
@ -29,6 +29,9 @@ class SettingsController < ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
hidden_non_project = Setting.find_by_name("hidden_non_project")
|
||||
@text = (hidden_non_project && hidden_non_project.value == "0") ? l(:label_show_non_project) : l(:label_hidden_non_project)
|
||||
|
||||
@notifiables = Redmine::Notifiable.all
|
||||
if request.post? && params[:settings] && params[:settings].is_a?(Hash)
|
||||
settings = (params[:settings] || {}).dup.symbolize_keys
|
||||
|
@ -70,4 +73,20 @@ class SettingsController < ApplicationController
|
|||
rescue Redmine::PluginNotFound
|
||||
render_404
|
||||
end
|
||||
|
||||
#隐藏/显示非项目信息
|
||||
def hidden_non_project
|
||||
@notifiable = Setting.find_by_name("hidden_non_project")
|
||||
if @notifiable
|
||||
@notifiable.value == "1" ? @notifiable.value = 0 : @notifiable.value = 1
|
||||
@notifiable.save
|
||||
else
|
||||
@notifiable = Setting.new()
|
||||
@notifiable.name = "hidden_non_project"
|
||||
@notifiable.value = 0
|
||||
@notifiable.save
|
||||
end
|
||||
|
||||
redirect_to settings_url
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<h3><%= l(:label_settings) %></h3>
|
||||
<h3 style="float: left;"><%=l(:label_settings)%></h3>
|
||||
<%= link_to @text,settings_hidden_non_project_path,:id => "hidden_non_project",:style => "float: right;margin-right: 60px;margin-top: 9px;"%>
|
||||
<div class="clear"></div>
|
||||
|
||||
<%= render_tabs administration_settings_tabs %>
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<% if @notifiable.value == "0"%>
|
||||
$("#hidden_non_project").replaceWith("<%= escape_javascript(link_to '显示非项目信息',settings_hidden_non_project_path,:id => 'hidden_non_project',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
|
||||
<% else%>
|
||||
$("#hidden_non_project").replaceWith("<%= escape_javascript(link_to '隐藏非项目信息',settings_hidden_non_project_path,:id => 'hidden_non_project',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
|
||||
<% end%>
|
|
@ -2031,4 +2031,6 @@ zh:
|
|||
modal_valid_unpassing: 该分班已经存在
|
||||
|
||||
mail_footer: 点击修改邮件发送设置
|
||||
label_show_non_project: 显示非项目信息
|
||||
label_hidden_non_project: 隐藏非项目信息
|
||||
|
||||
|
|
|
@ -736,6 +736,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'settings', :controller => 'settings', :action => 'index', :via => :get
|
||||
match 'settings/edit', :via => [:get, :post]
|
||||
match 'settings/plugin/:id', :to => 'settings#plugin', :via => [:get, :post], :as => 'plugin_settings'
|
||||
match 'settings/hidden_non_project', :via => [:get, :post]
|
||||
|
||||
match 'sys/projects', :via => :get
|
||||
match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
|
||||
|
|
|
@ -266,6 +266,8 @@ repository_domain:
|
|||
default: repository.trustie.net
|
||||
please_chose:
|
||||
default: 请选择
|
||||
hidden_non_project:
|
||||
default: 1
|
||||
plugin_redmine_ckeditor:
|
||||
serialized: true
|
||||
default: --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
|
||||
|
|
Loading…
Reference in New Issue