Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq

This commit is contained in:
huang 2015-04-17 10:58:54 +08:00
commit 1ffa447767
5 changed files with 20 additions and 21 deletions

View File

@ -136,7 +136,7 @@ class VersionsController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_back_or_default settings_project_path(@project, :tab => 'versions')
redirect_to settings_project_path(@project, :tab => 'versions')
}
format.api { render_api_ok }
end

View File

@ -394,9 +394,9 @@ module ApplicationHelper
def format_version_name(version)
if version.project == @project
h(version)
h(truncate(version.name,:length=>20))
else
h("#{version.project} - #{version}")
h("#{version.project} - #{truncate(version.name,:length=>20)}")
end
end

View File

@ -21,15 +21,14 @@
<% @project.repositories.sort.each do |repository| %>
<tr class="pro_table_on">
<td><a href="javascript:viod(0)" title="<%= repository.identifier %>">
<%= link_to repository.identifier, ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?), :class =>"c_blue" %></a></td>
<%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?), :class =>"c_blue" %></a></td>
<td> <%= checked_image repository.is_default? %></td>
<td><%=h repository.scm_name %></td>
<%if repository.scm_name=="Git"%>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" class="c_blue" title="http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %>
<%=h repository.url.slice(project_path_cut, repository.url.length) %>">http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %>
<%=h repository.url.slice(project_path_cut, repository.url.length) %></td><!--Modified by tanxianbo-->
<%=h repository.url.slice(project_path_cut, repository.url.length) %>"> <%=truncate( 'http://' << repository.login.to_s << '_'<< repository.identifier.to_s << '@'<< ip.to_s << h( repository.url.slice(project_path_cut, repository.url.length)),:length=>20)%></td><!--Modified by tanxianbo-->
<%else %>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h repository.url %></td>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td>
<% end %>
<td><a href="javascript:viod(0)" class="c_blue" >
<% if repository.scm_name=="Git"%>

View File

@ -27,7 +27,7 @@
<td class="status"><%= l("version_status_#{version.status}") %></td>
<td class="sharing"><%=h format_version_sharing(version.sharing) %></td>
<td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="">
<%= link_to_if_authorized(h(version.wiki_page_title), {:controller => 'wiki',
<%= link_to_if_authorized(h(truncate(version.wiki_page_title,:length=>20)), {:controller => 'wiki',
:action => 'show',
:project_id => version.project,
:id => Wiki.titleize(version.wiki_page_title)}) || h(version.wiki_page_title) unless version.wiki_page_title.blank? || version.project.wiki.nil? %>
@ -57,29 +57,29 @@
<div id="pro_st_edit_ban" class="pro_st_edit_ban">
<ul>
<li >
<label class="label02"><span class="c_red">*</span>&nbsp;名称&nbsp;&nbsp;</label>
<label class="label02"><span class="c_red">*</span>名称:</label>
<%= f.text_field :name, :maxlength => 60, :required => true %>
</li>
<li >
<label class="label02">&nbsp;描述 &nbsp;&nbsp;</label>
<label class="label02">描述:</label>
<%= f.text_field :description, :maxlength => 60 %>
</li>
<li >
<label class="label02">&nbsp;状态&nbsp;&nbsp;</label>
<label class="label02">状态:</label>
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %>
</li>
<li >
<label class="label02">&nbsp;Wiki 页面&nbsp;&nbsp;</label>
<label class="label02">Wiki 页面:</label>
<%= f.text_field :wiki_page_title, :size =>60, :label => :label_wiki_page, :disabled => @project.wiki.nil? %>
</li>
<li >
<label class="label02">&nbsp;日期 &nbsp;&nbsp;</label>
<label class="label02">日期:</label>
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>" fl" %>
<%= calendar_for('version_effective_date') %>
</li>
<div class="cl mb10"></div>
<li >
<label class="label02">&nbsp;共享 &nbsp;&nbsp;</label>
<label class="label02">共享:</label>
<%= f.select :sharing, @project.versions.build.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %>
</li>
<a href="#" onclick="$('#new_project_version_form').submit();" class="blue_btn ml110">保存</a>

View File

@ -3,29 +3,29 @@
<div id="pro_st_edit_ban" class="pro_st_edit_ban_display">
<ul>
<li >
<label class="label02"><span class="c_red">*</span>&nbsp;名称&nbsp;&nbsp;</label>
<label class="label02"><span class="c_red">*</span>名称:</label>
<%= f.text_field :name, :maxlength => 60,:class=>" w280", :label => ""%>
</li>
<li >
<label class="label02">&nbsp;描述 &nbsp;&nbsp;</label>
<label class="label02">描述:</label>
<%= f.text_field :description, :maxlength => 60,:class=>" w280", :label => "" %>
</li>
<li >
<label class="label02">&nbsp;状态&nbsp;&nbsp;</label>
<label class="label02">状态:</label>
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]}, :label => "" %>
</li>
<li >
<label class="label02">&nbsp;Wiki 页面&nbsp;&nbsp;</label>
<label class="label02">Wiki 页面:</label>
<%= f.text_field :wiki_page_title, :size =>60, :label => "", :disabled => @project.wiki.nil? %>
</li>
<li >
<label class="label02">&nbsp;日期 &nbsp;&nbsp;</label>
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>'f1',:label => "" %>
<label class="label02">日期:</label>
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>"fl" ,:style=>"margin-left:7px;",:label=>""%>
<%= calendar_for('version_effective_date') %>
</li>
<div class="cl mb10"></div>
<li >
<label class="label02">&nbsp;共享 &nbsp;&nbsp;</label>
<label class="label02">共享:</label>
<%= f.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]},:label=>"" %>
</li>
</ul>