Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Develop

See merge request !2
  • Loading branch information
dkastl committed Sep 6, 2017
2 parents 5089e76 + b24a2b0 commit 13986b2
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/views/text_blocks/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

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

<%= wikitoolbar_for 'text_block_text' %>




25 changes: 24 additions & 1 deletion app/views/text_blocks/_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if text_blocks.any? %>
<table class="list">
<table class="list textblocks">
<thead>
<tr>
<th><%= l :label_text_block_name %></th>
Expand All @@ -15,3 +15,26 @@
<p class="nodata"><%= l :label_no_data %></p>
<% end %>

<%= content_for :header_tags do %>
<%= javascript_include_tag 'jquery.dotdotdot', plugin: 'redmine_text_blocks' %>
<%= javascript_tag do %>
$(document).ready(function() {
$("table.list.textblocks tbody td.text div").dotdotdot({
watch: 'window',
});

// make sure text is shortened when it was initially hidden and just
// becomes visible due to Redmine's tabbing in project settings:
var origShowTab = window.showTab;
window.showTab = function(name, url){
origShowTab(name, url);
$("table.list.textblocks tbody td.text div").trigger('update.dot');
}
});
<% end %>
<style type="text/css">
table.list.textblocks tbody td { vertical-align: top; }
table.list.textblocks tbody td.text { text-align: left; }
table.list.textblocks tbody td.text div { height: 3.8em; }
</style>
<% end %>
2 changes: 1 addition & 1 deletion app/views/text_blocks/_text_block.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<tr>
<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>
<td><%= text_block.text %></td>
<td class="text"><div><%= textilizable text_block.text %></div></td>
<td><%= delete_link(text_block.project ? project_text_block_path(text_block.project, text_block) : text_block_path(text_block)) %>
</tr>
1 change: 0 additions & 1 deletion app/views/text_blocks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
<%= render partial: 'list', locals: { text_blocks: @text_blocks } %>

<% html_title l :label_text_block_plural -%>

24 changes: 24 additions & 0 deletions assets/javascripts/jquery.dotdotdot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13986b2

Please sign in to comment.