Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject

This commit is contained in:
huang 2016-10-19 15:24:49 +08:00
commit 23ff82a8cd
6 changed files with 112 additions and 17 deletions

View File

@ -6,12 +6,12 @@
}
<% end %>
$("#search_orgs_result_list").html("");
$("#search_orgs_result_list").append('<ul class="ml20">');
$("#search_orgs_result_list").append('<ul class="sy_new_tchlist fl">');
<% @orgs_not_in_project.each do |org|%>
link = "<li><label><input type='checkbox'class='mr5 fl mt3' name='orgNames[]' value='<%=org.id%>'/><span class='relateOrgName fl'> <%=org.name %> </span></label></li><div class='cl mt5'></div>";
link = "<li class='clear'><input type='checkbox'class='mr5 fl' name='orgNames[]' value='<%=org.id%>'/><span class='fl pro_new_idname'> <%=org.name %> </span></li>";
$("#search_orgs_result_list").append(link );
<%end %>
$("#search_orgs_result_list").append('</ul>')
$("#search_orgs_result_list").append('</ul>');
<% if @org_count > 15 %>
$("#paginator").html(' <%= pagination_links_full @orgs_page, @org_count ,:per_page_links => true,:remote =>true,:flag=>true%>');
$("#paginator").css("display", "block");

View File

@ -1,8 +1,8 @@
<ul>
<li><span class="relatedListName fb fl">名称</span><span class="relatedListOption fb fl">操作</span></li>
<!-- <li><span class="relatedListName fb fl">名称</span><span class="relatedListOption fb fl">操作</span></li>-->
<% orgs.each do |org| %>
<li><a href="<%= organization_path(org) %>" class="relatedListName linkBlue fl"><%= org.name %></a>
<a href = "javascript:void(0);" onclick = "cancel_relation('<%= OrgProject.where(:organization_id => org.id, :project_id => project_id).first.id %>','<%=project_id %>')" class="relatedListOption fl linkGrey3" >取消关联</a>
<li class="clear mb5"><a href="<%= organization_path(org) %>" class="fl"><%= org.name %></a>
<a href = "javascript:void(0);" onclick = "cancel_relation('<%= OrgProject.where(:organization_id => org.id, :project_id => project_id).first.id %>','<%=project_id %>')" class="fr sy_btn_grey ml5" >删除</a>
<%#= link_to "取消关联", org_project_path(:id => OrgProject.where(:organization_id => org.id, :project_id => project_id).first.id, :project_id => project_id),
:method => 'delete',:remote => true, :class => "relatedListOption fl linkGrey3" %>
</li>

View File

@ -1,3 +1,31 @@
<%= stylesheet_link_tag 'css/org' %>
<div class="sy_new_tchbox clear ">
<h2 class="pro_newsetting_title mb10 fl">关联组织</h2>
<a href="<%= new_organization_path %>" class="fr sy_btn_green ">新建组织</a>
<div class="cl mb5"></div>
<%= form_tag url_for(:controller => 'org_projects', :action => 'create', :project_id => @project.id), :id => 'join_orgs_for_project', :remote => true do %>
<input type="text" name="orgs" class="sy_new_search" placeholder="请输入组织名称" />
<div id="search_orgs_result_list"></div>
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
<a href="javascript:void(0);" class="fl sy_btn_blue mr5" onclick="join_org(<%= @project.id %>);">关联</a>
<a href="javascript:void(0);" class="fl sy_btn_grey mr5" onclick="cancel_join_orgs();">取消</a>
<% end %>
</div>
<div class="sy_new_tchbox">
<h2 class="pro_newsetting_title mb10">已关联组织</h2>
<ul>
<div id="added_orgs">
<%= render :partial => 'projects/settings/added_orgs', :locals => {:orgs => @project.organizations, :project_id => params[:id]} %>
</div>
</ul>
</div>
<!--<div class="members_left">-->
<!--<input type="text" id="orgs_not_project_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、昵称搜索" class="orgAddSearch mb20" />-->
<!--<%#= javascript_tag "observeSearchfield('orgs_not_project_member_search', null, '#{ escape_javascript autocomplete_search_organizations_path(:project_id=> @project.id, :format => 'js') }')" %>-->
@ -5,31 +33,31 @@
<!--</div>-->
<!--</div>-->
<%= stylesheet_link_tag 'css/org' %>
<%#= stylesheet_link_tag 'css/org' %>
<div>
<!-- <div>
<div class="relateOrg fl">
<span class="pic_add fl mr5 mt3"></span><span class="f14 fontBlue fl">关联组织</span>
<div class="cl mb5"></div>
<%= form_tag url_for(:controller => 'org_projects', :action => 'create', :project_id => @project.id), :id => 'join_orgs_for_project', :remote => true do %>
<%#= form_tag url_for(:controller => 'org_projects', :action => 'create', :project_id => @project.id), :id => 'join_orgs_for_project', :remote => true do %>
<input type="text" name="orgs" class="searchOrg mb5 ml20" placeholder="请输入组织名称" />
<div id="search_orgs_result_list" class="ml20"></div>
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
<a href="javascript:void(0);" class="saveBtn db fl ml20 mr15 mb5" onclick="join_org(<%= @project.id %>);">关联</a>
<a href="javascript:void(0);" class="saveBtn db fl ml20 mr15 mb5" onclick="join_org(<%#= @project.id %>);">关联</a>
<a href="javascript:void(0);" class="grey_btn db fl" onclick="cancel_join_orgs();">取消</a>
<% end %>
<%# end %>
</div>
<div class="relatedList fr">
<div class="fr mr15">
<span class="f14 fontBlue">已关联组织</span>
<div id="added_orgs">
<%= render :partial => 'projects/settings/added_orgs', :locals => {:orgs => @project.organizations, :project_id => params[:id]} %>
<%#= render :partial => 'projects/settings/added_orgs', :locals => {:orgs => @project.organizations, :project_id => params[:id]} %>
</div>
<div>
</div>
</div>
</div>
</div>
</div>-->
<script type="text/javascript">
var lastSearchCondition = '';

View File

@ -1,9 +1,12 @@
<script>
function pro_st_show_ban1()
{
$("#pro_st_edit_ban1").toggle();
}
function pro_st_show_ban()
{
$("#pro_st_edit_ban").toggle();
}
</script>
<% if @project.shared_versions.any? %>
<table class="pro_table">
@ -89,8 +92,70 @@
<% end %>
<% if @project.shared_versions.empty? %>
<div class="pro_new_prompt ml15 mr15 mb10"><p><%= l(:milestone_no_data) %></p></div>
<% end %>
<div class=" sy_new_tchbox clear " >
<a href="javascript:void(0);" class=" sy_btn_green mb10" onclick="pro_st_show_ban1();">新建里程碑</a>
<%= form_for :version, :url => project_versions_path(@project),:html=>{:id=>"new_project_version_form"} do |f| %>
<div id="pro_st_edit_ban1" style="display:none;">
<ul class="pro_newsetting_con mb15">
<li class="mb10 clear">
<label class="label02"><span class="c_red f12">*</span>&nbsp;<%= l(:field_name) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :name, :maxlength => 60, :class=>"w650 fl", :style=>"height: 28px;" %>
</li>
<li class="mb10 clear">
<label class="fl">&nbsp;<%= l(:label_version_description) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :description, :maxlength => 60, :class=>"w650 fl", :style=>"height: 28px;"%>
</li>
<li class="mb10 clear">
<label class=" fl">&nbsp;<%= l(:milestone_date_closed) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>"issues_calendar_input fl", :placeholder=>"结束日期", :style=>"height: 28px;" %>
<%= calendar_for('version_effective_date') %>
</li>
<li class="mb10 clear">
<label class="fl">&nbsp;<%= l(:field_status) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]}, :style=>"border:1px solid #e5e5e5 height:28px;" %>
</li>
<div class="cl mb10"></div>
</ul>
<a href="javascript:void(0);" class="fr sy_btn_grey " onclick="pro_st_show_ban1();">取消</a><a href="javascript:void(0);" onclick="$('#new_project_version_form').submit();" class="fr sy_btn_blue mr5">保存</a>
</div>
<% end %>
</div>
<% if @project.shared_versions.any? %>
<div class=" clear ml15 mr15" >
<table class="sy_new_table clear mb15" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>名称</th>
<th>结束日期</th>
<th>描述</th>
<th>状态</th>
<th >操作</th>
</tr>
</thead>
<tbody>
<% for version in @project.shared_versions.sort %>
<tr>
<th>
<a><%= 'shared' if version.project != @project %> <%= link_to_version version %></a>
</th>
<th><%= format_date(version.effective_date) %></th>
<th><%=h version.description %></th>
<th><%= l("version_status_#{version.status}") %></th>
<th>
<% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %>
<%= link_to l(:button_edit), edit_version_path(version), :class => 'sy_btn_blue mr5' %></a>
<a href="/versions/1" data-confirm="您确定要删除吗?" ><%= delete_link_version version_path(version), :class=>"sy_btn_grey mr5" %></a>
<% end %>
</th>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>

View File

@ -202,6 +202,7 @@ zh:
label_subject_empty: 主题不能为空
label_no_data: 没有任何数据可供显示
milestone_no_data: 尚未创建里程碑
label_repository_no_data: 每个项目只能创建一个版本库!
# 项目、课程、用户公用
label_settings: 配置

View File

@ -1460,6 +1460,7 @@ zh:
label_bids_credit_number:
field_budget: 奖励
field_deadline: 截止日期
milestone_date_closed: 结束日期
field_is_evaluation: 是否启动互评
field_proportion: 教师评分比例
label_tags_selected: 已选标签