#1247修复项目--配置--版本:新建版本,输入“wiki页面”为非汉字类型且字数较多时,显示异常的BUG

This commit is contained in:
sw 2014-10-22 16:08:47 +08:00
parent 82aa52e44f
commit 69dc22e218
4 changed files with 111 additions and 57 deletions

View File

@ -43,7 +43,7 @@
<div class="C" > <div class="C" >
<div class="C_top"> <div class="C_top">
<h2>快速进入课程通道</h2> <h2>快速进入课程通道</h2>
<p>只要持有课程ID和密码快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦!</p> <p>只要持有课程ID和密码快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦!</p>
</div> </div>
<div class="C_form"> <div class="C_form">
<%= form_tag({:controller => 'courses', <%= form_tag({:controller => 'courses',

View File

@ -1,23 +1,51 @@
<% if @project.shared_versions.any? %> <% if @project.shared_versions.any? %>
<table class="list versions"> <table class="list versions" style="table-layout: fixed;">
<thead><tr> <thead>
<th><%= l(:label_version) %></th> <tr>
<th><%= l(:field_effective_date) %></th> <th>
<th><%= l(:field_description) %></th> <%= l(:label_version) %>
<th><%= l(:field_status) %></th> </th>
<th><%= l(:field_sharing) %></th> <th>
<th><%= l(:label_wiki_page) %></th> <%= l(:field_effective_date) %>
</th>
<th>
<%= l(:field_description) %>
</th>
<th>
<%= l(:field_status) %>
</th>
<th>
<%= l(:field_sharing) %>
</th>
<th>
<%= l(:label_wiki_page) %>
</th>
<th style="width:15%"></th> <th style="width:15%"></th>
</tr></thead> </tr></thead>
<tbody> <tbody>
<% for version in @project.shared_versions.sort %> <% for version in @project.shared_versions.sort %>
<tr class="version <%= cycle 'odd', 'even' %> <%=h version.status %> <%= 'shared' if version.project != @project %>"> <tr class="version <%= cycle 'odd', 'even' %> <%=h version.status %> <%= 'shared' if version.project != @project %>">
<td class="name"><%= link_to_version version %></td> <td class="name">
<td class="date"><%= format_date(version.effective_date) %></td> <%= link_to_version version %>
<td class="description"><%=h version.description %></td> </td>
<td class="status"><%= l("version_status_#{version.status}") %></td> <td class="date">
<td class="sharing"><%=h format_version_sharing(version.sharing) %></td> <%= format_date(version.effective_date) %>
<td><%= link_to_if_authorized(h(version.wiki_page_title), {: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? %></td> </td>
<td class="description">
<%=h version.description %>
</td>
<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="<%= h(version.wiki_page_title)%>">
<%= link_to_if_authorized(h(version.wiki_page_title), {: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? %>
</td>
<td class="buttons"> <td class="buttons">
<% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %>
<%= link_to l(:button_edit), edit_version_path(version), :class => 'icon icon-edit' %> <%= link_to l(:button_edit), edit_version_path(version), :class => 'icon icon-edit' %>
@ -25,11 +53,13 @@
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end; reset_cycle %> <% end; reset_cycle %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %> <% end %>
<div class="contextual"> <div class="contextual">

View File

@ -1,48 +1,72 @@
<!--modified by young--> <!--modified by young-->
<div class="contextual"> <div class="contextual" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<%= link_to(l(:button_edit), edit_version_path(@version), :class => 'icon icon-edit') if User.current.allowed_to?(:manage_versions, @version.project) %> <%= link_to(l(:button_edit), edit_version_path(@version), :class => 'icon icon-edit') if User.current.allowed_to?(:manage_versions, @version.project) %>
<%= link_to_if_authorized(l(:button_edit_associated_wikipage, :page_title => @version.wiki_page_title), {:controller => 'wiki', :action => 'edit', :project_id => @version.project, :id => Wiki.titleize(@version.wiki_page_title)}, :class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @version.project.wiki.nil? %> <%= link_to_if_authorized(l(:button_edit_associated_wikipage,
<%= delete_link version_path(@version, :back_url => url_for(:controller => 'versions', :action => 'index', :project_id => @version.project)) if User.current.allowed_to?(:manage_versions, @version.project) %> :page_title => @version.wiki_page_title.truncate(30, omission: '...')),
{:controller => 'wiki',
:action => 'edit',
:project_id => @version.project,
:id => Wiki.titleize(@version.wiki_page_title)},
:class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @version.project.wiki.nil? %>
<%= delete_link version_path(@version, :back_url => url_for(:controller => 'versions',
:action => 'index',
:project_id => @version.project)) if User.current.allowed_to?(:manage_versions, @version.project) %>
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %> <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
</div> </div>
<h3><%= h(@version.name) %></h3> <h3 style="word-break: break-all;word-wrap: break-word;">
<%= h(@version.name) %>
</h3>
<div id="roadmap"> <div id="roadmap">
<%= render :partial => 'versions/overview', :locals => {:version => @version} %> <%= render :partial => 'versions/overview', :locals => {:version => @version} %>
<%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %> <%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %>
<div class="splitcontent"> <div class="splitcontent">
<% if @version.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %> <% if @version.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %>
<fieldset class="time-tracking"><legend><%= l(:label_time_tracking) %></legend> <fieldset class="time-tracking"><legend><%= l(:label_time_tracking) %></legend>
<table> <table>
<tr> <tr>
<th><%= l(:field_estimated_hours) %></th> <th>
<td class="total-hours"><%= html_hours(l_hours(@version.estimated_hours)) %></td> <%= l(:field_estimated_hours) %>
</tr> </th>
<% if User.current.allowed_to?(:view_time_entries, @project) %> <td class="total-hours">
<tr> <%= html_hours(l_hours(@version.estimated_hours)) %>
<th><%= l(:label_spent_time) %></th> </td>
<td class="total-hours"><%= html_hours(l_hours(@version.spent_hours)) %></td> </tr>
</tr> <% if User.current.allowed_to?(:view_time_entries, @project) %>
<% end %> <tr>
</table> <th>
</fieldset> <%= l(:label_spent_time) %>
<% end %> </th>
<td class="total-hours">
<%= html_hours(l_hours(@version.spent_hours)) %>
</td>
</tr>
<% end %>
</table>
</fieldset>
<% end %>
<div id="status_by" style="margin-top:10px;"><!--by young--> <div id="status_by" style="margin-top:10px;"><!--by young-->
<%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %> <%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %>
</div> </div>
</div> </div>
<% if @issues.present? %> <% if @issues.present? %>
<%= form_tag({}) do -%> <%= form_tag({}) do -%>
<table class="list related-issues"> <table class="list related-issues">
<caption><%= l(:label_related_issues) %></caption> <caption>
<%= l(:label_related_issues) %>
</caption>
<%- @issues.each do |issue| -%> <%- @issues.each do |issue| -%>
<tr class="hascontextmenu"> <tr class="hascontextmenu">
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td> <td class="checkbox">
<td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> <%= check_box_tag 'ids[]', issue.id, false, :id => nil %>
</td>
<td>
<%= link_to_issue(issue, :project => (@project != issue.project)) %>
</td>
</tr> </tr>
<% end %> <% end %>
</table> </table>

View File

@ -1,7 +1,7 @@
<%= wiki_page_breadcrumb(@page) %> <%= wiki_page_breadcrumb(@page) %>
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script> <script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<h3> <h3 style="word-break: break-all;word-wrap: break-word;">
<%= h @page.pretty_title %> <%= h @page.pretty_title %>
</h3> </h3>