项目配置,信息与模块样式调整

This commit is contained in:
daiao 2016-10-19 16:56:25 +08:00
parent c829749849
commit a9fa958f7f
4 changed files with 45 additions and 43 deletions

View File

@ -1906,7 +1906,7 @@ module ApplicationHelper
end
def check_all_links(form_name)
link_to_function_none(l(:button_check_all), "checkAll('#{form_name}', true)") + "  ".html_safe + " | "+ "  ".html_safe +
link_to_function_none(l(:button_check_all), "checkAll('#{form_name}', true)") + " ".html_safe + " | "+ " ".html_safe +
link_to_function_none(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
end

View File

@ -24,12 +24,12 @@
<% end %>
<li class="clear">
<label class="fl">公开&nbsp;&nbsp;</label>
<input class="fl ml5" id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
<input class="fl mt8" id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
<span class="fl c_grey ">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见。)</span>
</li>
<li class="clear mb10">
<label class="fl ">隐藏代码库&nbsp;&nbsp;</label>
<input class="fl ml5" id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
<input class="fl mt8" id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
</li>
<li class="clear">
<% if Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>

View File

@ -15,6 +15,45 @@
%>
<div class=" clear ml15 mr15" >
<% if roles.any? %>
<a href="javascript:void(0);" class="fr sy_btn_green mb10" onclick="add_member();">添加成员</a>
<% end %>
<div class="cl"></div>
<div class=" sy_new_tchbox clear ml10 mr10 undis" id="add_members_id">
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<div class="hw_search_box mb10">
<input id="principal_search" class="sy_new_search" placeholder="支持姓名、邮箱、登录名搜索" type="text">
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
</div>
<ul class="pro_new_idlist fl">
<div class="clear mb10" id="principals_for_new_member">
<%= render_project_members(@project) %>
</div>
</ul>
<ul class="fl pro_new_idbox">
<% roles.each do |role| %>
<li class="clear ">
<%= radio_button_tag 'membership[role_ids][]', role.id, role.name == "报告人员" || role.name == "Reporter", :class=>"fl" %>
<% if User.current.language == "zh" %>
<% if role.id == 3 %>
<div class="fl ml5" style="height:30px">管理人员</div>
<% elsif role.id == 4 %>
<div class="fl ml5" style="height:30px">开发人员</div>
<% else %>
<div class="fl ml5" style="height:30px">报告人员</div>
<% end %>
<% else %>
<div class="fl ml5" style="height:30px"><%= h role %></div>
<% end %>
</li>
<% end %>
</ul>
<div class="cl mb10"></div>
<a href="javascript:void(0);" class="fr sy_btn_grey " onclick="hidden_add_member();">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" onclick="$(this).parent().submit();">保存</a>
<%end%>
</div>
<% if members.any? %>
<table class="sy_new_table clear mb15" cellpadding="0" cellspacing="0">
<thead>
@ -76,45 +115,8 @@
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<% if roles.any? %>
<a href="javascript:void(0);" class="fl sy_btn_green mb10" onclick="add_member();">添加成员</a>
<% end %>
</div>
<div class=" sy_new_tchbox clear ml10 mr10 undis" id="add_members_id">
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<div class="hw_search_box mb10">
<input id="principal_search" class="sy_new_search" placeholder="支持姓名、邮箱、登录名搜索" type="text">
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
</div>
<ul class="pro_new_idlist fl">
<div class="clear mb10" id="principals_for_new_member">
<%= render_project_members(@project) %>
</div>
</ul>
<ul class="fl pro_new_idbox">
<% roles.each do |role| %>
<li class="clear ">
<%= radio_button_tag 'membership[role_ids][]', role.id, role.name == "报告人员" || role.name == "Reporter", :class=>"fl" %>
<% if User.current.language == "zh" %>
<% if role.id == 3 %>
<div class="fl ml5" style="height:30px">管理人员</div>
<% elsif role.id == 4 %>
<div class="fl ml5" style="height:30px">开发人员</div>
<% else %>
<div class="fl ml5" style="height:30px">报告人员</div>
<% end %>
<% else %>
<div class="fl ml5" style="height:30px"><%= h role %></div>
<% end %>
</li>
<% end %>
</ul>
<div class="cl mb10"></div>
<a href="javascript:void(0);" class="fr sy_btn_grey " onclick="hidden_add_member();">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" onclick="$(this).parent().submit();">保存</a>
<%end%>
</div>

View File

@ -3,13 +3,13 @@
<%= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %>
<% Redmine::AccessControl.available_project_modules.each do |m| %>
<li class="clear ">
<%= check_box_tag('enabled_module_names[]', m, @project.module_enabled?(m), :class=>"fl").html_safe -%>
<%= check_box_tag('enabled_module_names[]', m, @project.module_enabled?(m), :class=>"fl mt8").html_safe -%>
<p class="fl ml5"><%= l_or_humanize(m, :prefix => "project_module_").html_safe %></p>
</li>
<% end %>
<li class="clear ">
<input class="fl" type="checkbox">
<p class="fl ml5"><%= check_all_links('modules-form').html_safe %></p>
<input class="fl mt8" type="checkbox">
<p class="fl ml5"><%= check_all_links('modules-form').html_safe %></p>
</li>
<% end %>
<li class="clear">