2015-04-16 10:50:53 +08:00
|
|
|
|
<script>
|
|
|
|
|
function pro_st_show_ban()
|
|
|
|
|
{
|
|
|
|
|
$("#pro_st_edit_ban").toggle();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<% if @project.shared_versions.any? %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
<table class="pro_table">
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr class="pro_table_tit">
|
2015-04-17 14:27:26 +08:00
|
|
|
|
<td class="w150"><%= l(:label_version) %></td>
|
|
|
|
|
<td class="w90" > <%= l(:field_effective_date) %></td>
|
2015-04-17 14:22:08 +08:00
|
|
|
|
<td class="w150"><%= l(:field_description) %> </td>
|
2015-04-17 14:27:26 +08:00
|
|
|
|
<td class="w90"><%= l(:field_status) %></td>
|
|
|
|
|
<td class="w90"><%= l(:field_sharing) %></td>
|
2015-04-17 14:22:08 +08:00
|
|
|
|
<td class="w150"><%= l(:label_wiki_page) %></td>
|
2015-04-17 14:27:26 +08:00
|
|
|
|
<td class="w150"></td>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
</tr>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<% for version in @project.shared_versions.sort %>
|
2015-04-23 14:04:22 +08:00
|
|
|
|
<tr class="<%= cycle 'pro_table_on', '' %>">
|
|
|
|
|
<td class="tl">
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<a class="c_blue02"><%= 'shared' if version.project != @project %> <%= link_to_version version %></a>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
</td>
|
2015-04-21 10:14:46 +08:00
|
|
|
|
<td class="description"><%= format_date(version.effective_date) %></td>
|
2015-04-23 14:04:22 +08:00
|
|
|
|
<td class="description tl" style="word-break:break-all;"><%=h version.description %></td>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<td class="status"><%= l("version_status_#{version.status}") %></td>
|
|
|
|
|
<td class="sharing"><%=h format_version_sharing(version.sharing) %></td>
|
2015-04-23 14:04:22 +08:00
|
|
|
|
<td class="tl" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="">
|
2015-04-17 10:38:39 +08:00
|
|
|
|
<%= link_to_if_authorized(h(truncate(version.wiki_page_title,:length=>20)), {:controller => 'wiki',
|
2015-04-13 21:08:26 +08:00
|
|
|
|
:action => 'show',
|
|
|
|
|
:project_id => version.project,
|
2015-04-21 10:14:46 +08:00
|
|
|
|
:id => Wiki.titleize(version.wiki_page_title)},:class=>"c_blue02") || h(version.wiki_page_title) unless version.wiki_page_title.blank? || version.project.wiki.nil? %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
</td>
|
|
|
|
|
<td >
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %>
|
|
|
|
|
<%= link_to l(:button_edit), edit_version_path(version), :class => 'c_purple' %></a>
|
2015-04-16 09:49:03 +08:00
|
|
|
|
<a href="/versions/1" class=" c_purple" data-confirm="您确定要删除吗?" ><%= delete_link_version version_path(version) %></a>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<% end %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<% end; reset_cycle %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
</tbody>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<% else %>
|
|
|
|
|
<p class="nodata">
|
|
|
|
|
<%= l(:label_no_data) %>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
</table>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
<% if @project.versions.any? %>
|
|
|
|
|
<%= link_to l(:label_close_versions), close_completed_project_versions_path(@project), :method => :put, :class =>"c_orange fr" %>
|
|
|
|
|
<% end %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
<a href="javascript:viod(0)" class="pic_add fl mr5" onclick="pro_st_show_ban();"></a>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
<%= link_to l(:label_version_new),"#", :class => 'c_blue fl',:onclick=>"pro_st_show_ban();" if User.current.allowed_to?(:manage_versions, @project) %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
<%= form_for :version, :url => project_versions_path(@project),:html=>{:id=>"new_project_version_form"} do |f| %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
<div id="pro_st_edit_ban" class="pro_st_edit_ban">
|
2015-04-16 10:50:53 +08:00
|
|
|
|
<ul>
|
|
|
|
|
<li >
|
2015-04-17 12:55:07 +08:00
|
|
|
|
<label class="label02"><span class="c_red">*</span><%=l(:field_name)%>:</label>
|
2015-04-17 14:21:43 +08:00
|
|
|
|
<%= f.text_field :name, :maxlength => 60 %>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
</li>
|
|
|
|
|
<li >
|
2015-04-17 12:55:07 +08:00
|
|
|
|
<label class="label02"><%=l(:label_version_description)%>:</label>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
<%= f.text_field :description, :maxlength => 60 %>
|
|
|
|
|
</li>
|
|
|
|
|
<li >
|
2015-04-17 12:55:07 +08:00
|
|
|
|
<label class="label02"><%=l(:field_status)%>:</label>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %>
|
|
|
|
|
</li>
|
|
|
|
|
<li >
|
2015-04-17 12:55:07 +08:00
|
|
|
|
<label class="label02"><%=l(:label_wiki_page)%>:</label>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
<%= f.text_field :wiki_page_title, :size =>60, :label => :label_wiki_page, :disabled => @project.wiki.nil? %>
|
|
|
|
|
</li>
|
|
|
|
|
<li >
|
2015-04-17 12:55:07 +08:00
|
|
|
|
<label class="label02"><%=l(:label_date)%>:</label>
|
2015-04-16 11:07:38 +08:00
|
|
|
|
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>" fl" %>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
<%= calendar_for('version_effective_date') %>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl mb10"></div>
|
|
|
|
|
<li >
|
2015-04-17 12:55:07 +08:00
|
|
|
|
<label class="label02"><%=l(:field_sharing)%>:</label>
|
2015-04-16 11:07:38 +08:00
|
|
|
|
<%= f.select :sharing, @project.versions.build.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
</li>
|
2015-04-17 12:55:07 +08:00
|
|
|
|
<a href="#" onclick="$('#new_project_version_form').submit();" class="blue_btn ml110"><%=l(:button_save)%></a>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
</ul>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
|
|
|
|
|
</div>
|
2015-04-16 10:50:53 +08:00
|
|
|
|
<% end %>
|
2015-04-13 21:08:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|