socialforge/app/views/projects/settings/_new_versions.html.erb

80 lines
2.6 KiB
Plaintext

<% 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 fr" onclick="pro_st_show_ban1();">新建里程碑</a>
<div class="cl"></div>
<%= render :partial => 'projects/settings/new_versions_form', :locals => {:project => @project} %>
</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 class="fl" style="width:156px;">名称</th>
<th class="w80 fl">结束日期</th>
<th class="w350 fl">描述</th>
<th class="w50 fl">状态</th>
<th class="w150 fl">操作</th>
</tr>
</thead>
<tbody>
<% @project.shared_versions.each do |version| %>
<tr>
<th class="fl hidden" style="width:156px;" title="<%= version.name %>" >
<%= link_to version.name, version_path(version), :class => "c_blue02" %>
</th>
<th class="fl w80"><%= format_date(version.effective_date) %></th>
<th class="fl w350 hidden"><%=h version.description %></th>
<th class="fl w50"><%= l("version_status_#{version.status}") %></th>
<th class="fl w150">
<% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %>
<%= link_to l(:button_edit), edit_version_path(version, :is_setting => true), :class => 'sy_btn_blue mr5', :remote => true %>
<%= delete_link_version version_path(version, :is_setting => true), :class=>"sy_btn_grey mr5", :remote => true %>
<% end %>
</th>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
<script>
// 新建版本
function project_version_commit()
{
if(regex_version_name())
{
$("#new_project_version_form").submit();
}
}
function regex_version_name()
{
var name = $.trim($("#setting_version_name").val());
if(name.length == 0)
{
$("#project_setting_version_title").show();
return false;
}
else
{
$("#project_setting_version_title").hide();
return true;
}
}
function pro_st_show_ban1()
{
$("#pro_st_edit_ban1").toggle();
$("#setting_version_name").val("");
$("#setting_version_description").val("");
$("#setting_version_effective_date").val("");
}
function pro_st_show_ban()
{
$("#pro_st_edit_ban").toggle();
}
</script>