Skip to content

Commit 13986b2

Browse files
committed
Merge branch 'develop' into 'master'
Develop See merge request !2
2 parents 5089e76 + b24a2b0 commit 13986b2

File tree

5 files changed

+52
-4
lines changed

5 files changed

+52
-4
lines changed

app/views/text_blocks/_form.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
<div class="box tabular">
44
<p><%= f.text_field :name, required: true, size: 25 %></p>
5-
<p><%= f.text_area :text, label: l(:field_text_block_text) %></p>
5+
<p><%= f.text_area :text, label: l(:field_text_block_text), rows: 10 %></p>
66
</div>
77

8+
<%= wikitoolbar_for 'text_block_text' %>
9+
810

911

1012

app/views/text_blocks/_list.html.erb

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if text_blocks.any? %>
2-
<table class="list">
2+
<table class="list textblocks">
33
<thead>
44
<tr>
55
<th><%= l :label_text_block_name %></th>
@@ -15,3 +15,26 @@
1515
<p class="nodata"><%= l :label_no_data %></p>
1616
<% end %>
1717

18+
<%= content_for :header_tags do %>
19+
<%= javascript_include_tag 'jquery.dotdotdot', plugin: 'redmine_text_blocks' %>
20+
<%= javascript_tag do %>
21+
$(document).ready(function() {
22+
$("table.list.textblocks tbody td.text div").dotdotdot({
23+
watch: 'window',
24+
});
25+
26+
// make sure text is shortened when it was initially hidden and just
27+
// becomes visible due to Redmine's tabbing in project settings:
28+
var origShowTab = window.showTab;
29+
window.showTab = function(name, url){
30+
origShowTab(name, url);
31+
$("table.list.textblocks tbody td.text div").trigger('update.dot');
32+
}
33+
});
34+
<% end %>
35+
<style type="text/css">
36+
table.list.textblocks tbody td { vertical-align: top; }
37+
table.list.textblocks tbody td.text { text-align: left; }
38+
table.list.textblocks tbody td.text div { height: 3.8em; }
39+
</style>
40+
<% end %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<tr>
22
<td><%= link_to text_block.name, (text_block.project ? edit_project_text_block_path(text_block.project, text_block) : edit_text_block_path(text_block)) %></td>
3-
<td><%= text_block.text %></td>
3+
<td class="text"><div><%= textilizable text_block.text %></div></td>
44
<td><%= delete_link(text_block.project ? project_text_block_path(text_block.project, text_block) : text_block_path(text_block)) %>
55
</tr>

app/views/text_blocks/index.html.erb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77
<%= render partial: 'list', locals: { text_blocks: @text_blocks } %>
88

99
<% html_title l :label_text_block_plural -%>
10-

assets/javascripts/jquery.dotdotdot.js

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)