# HG changeset patch # User olivier # Date 1439306287 -7200 # Tue Aug 11 17:18:07 2015 +0200 # Branch 3.1-stable # Node ID 4530fc832914f9b0b9f9802d7e9bbeac411620a0 # Parent d6875328ffbcd415da50b8896a00ee679042d6e5 #18770 - Collapsable-divs-History-and-roadmap.patch diff -r d6875328ffbc -r 4530fc832914 app/views/issues/_history.html.erb --- a/app/views/issues/_history.html.erb Sun Jul 26 07:10:55 2015 +0000 +++ b/app/views/issues/_history.html.erb Tue Aug 11 17:18:07 2015 +0200 @@ -1,23 +1,33 @@ <% reply_links = authorize_for('issues', 'edit') -%> +
<% for journal in journals %>
-

#<%= journal.indice %> +
+

#<%= journal.indice %> <%= avatar(journal.user, :size => "24") %> +   <%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %> + <%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}", + "toggleAllExpanderDivs(this)", :class => 'toggle-all') %> + <%= content_tag('span', l(:field_is_private), :class => 'private') if journal.private_notes? %>

+
+
<% if journal.details.any? %> -
    +
      <% details_to_strings(journal.visible_details).each do |string| %> -
    • <%= string %>
    • +
    • <%= string %>
    • <% end %> -
    +
<% end %> <%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %> +

<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %> <% end %> +
<% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, issue.project) || User.current.allowed_to?(:edit_own_issue_notes, issue.project) %> diff -r d6875328ffbc -r 4530fc832914 app/views/issues/show.html.erb --- a/app/views/issues/show.html.erb Sun Jul 26 07:10:55 2015 +0000 +++ b/app/views/issues/show.html.erb Tue Aug 11 17:18:07 2015 +0200 @@ -75,16 +75,25 @@ <% if @issue.description? || @issue.attachments.any? -%>
<% if @issue.description? %> -
-
- <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> -
- -

<%=l(:field_description)%>

-
- <%= textilizable @issue, :description, :attachments => @issue.attachments %> -
-
+
+
+
+
+ <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> +
+ +

+   + <%=l(:field_description)%> +

+
+
+
+ <%= textilizable @issue, :description, :attachments => @issue.attachments %> +
+
+
+
<% end %> <%= link_to_attachments @issue, :thumbnails => true %> <% end -%> diff -r d6875328ffbc -r 4530fc832914 app/views/versions/index.html.erb --- a/app/views/versions/index.html.erb Sun Jul 26 07:10:55 2015 +0000 +++ b/app/views/versions/index.html.erb Tue Aug 11 17:18:07 2015 +0200 @@ -9,30 +9,43 @@

<%= l(:label_no_data) %>

<% else %>
+ <% #[OHO-2015-08-07] changes to make issue description collapsable: added DIV levels %> +
<% @versions.each do |version| %> -
-
-

<%= link_to_version version, :name => version_anchor(version) %>

-
+
+
+
+

+   + <%= link_to_version version, :name => version_anchor(version) %> + <%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}", + "toggleAllExpanderDivs(this)", :class => 'toggle-all') %> +

+
+
+
<%= render :partial => 'versions/overview', :locals => {:version => version} %> <%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> <% if (issues = @issues_by_version[version]) && issues.size > 0 %> <%= form_tag({}) do -%> - - + + <% issues.each do |issue| -%> - - - - + + + + <% end -%> - + <% end %> <% end %> <%= call_hook :view_projects_roadmap_version_bottom, :version => version %> -
+
+ <% end %> +
+ <% #[OHO-end] %> <% end %> @@ -83,12 +96,12 @@ <%= link_to_function l(:label_completed_versions), '$("#toggle-completed-versions").toggleClass("collapsed"); $("#completed-versions").toggle()', :id => 'toggle-completed-versions', :class => 'collapsible collapsed' %> +

-

<% end %> <% end %> diff -r d6875328ffbc -r 4530fc832914 public/javascripts/application.js --- a/public/javascripts/application.js Sun Jul 26 07:10:55 2015 +0000 +++ b/public/javascripts/application.js Tue Aug 11 17:18:07 2015 +0200 @@ -62,6 +62,46 @@ } } +function toggleExpanderDiv(el) { + var expItem = $(el).parents('div.expander-item').first(); + var n = expItem.next(); + expItem.toggleClass('open'); + while (n.length && !n.hasClass('group')) { + n.toggle(); + n = n.next('expItem'); + } +} + +function collapseAllExpanderDivs(el) { + var exp = $(el).parents('div.expander').first(); + exp.find('div.expander-item').each(function(index) { + if ($(this).hasClass('group')) { + $(this).removeClass('open'); + } else { + $(this).hide(); + } + }); +} +function expandAllExpanderDivs(el) { + var exp = $(el).parents('div.expander').first(); + exp.find('div.expander-item').each(function(index) { + if ($(this).hasClass('group')) { + $(this).addClass('open'); + } else { + $(this).show(); + } + }); +} + +function toggleAllExpanderDivs(el) { + var expItem = $(el).parents('div.expander-item').first(); + if (expItem.hasClass('open')) { + collapseAllExpanderDivs(el); + } else { + expandAllExpanderDivs(el); + } +} + function toggleFieldset(el) { var fieldset = $(el).parents('fieldset').first(); fieldset.toggleClass('collapsed'); diff -r d6875328ffbc -r 4530fc832914 public/stylesheets/application.css --- a/public/stylesheets/application.css Sun Jul 26 07:10:55 2015 +0000 +++ b/public/stylesheets/application.css Tue Aug 11 17:18:07 2015 +0200 @@ -183,8 +183,8 @@ tr.entry.file td.filename a { margin-left: 16px; } tr.entry.file td.filename_no_report a { margin-left: 16px; } -tr span.expander {background-image: url(../images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;} -tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);} +tr span.expander, div span.expander {background-image: url(../images/bullet_toggle_plus.png); background-repeat: no-repeat; padding-left: 8px; margin-left: 0; cursor: pointer;} +tr.open span.expander, div.open span.expander {background-image: url(../images/bullet_toggle_minus.png); background-repeat: no-repeat;} tr.changeset { height: 20px } tr.changeset ul, ol { margin-top: 0px; margin-bottom: 0px; } @@ -233,8 +233,8 @@ table.list tbody tr.group td { padding: 0.8em 0 0.5em 0.3em; font-weight: bold; border-bottom: 1px solid #ccc; text-align:left; } table.list tbody tr.group span.count {position:relative; top:-1px; color:#fff; font-size:10px; background:#9DB9D5; padding:0px 6px 1px 6px; border-radius:3px; margin-left:4px;} -tr.group a.toggle-all { color: #aaa; font-size: 80%; font-weight: normal; display:none;} -tr.group:hover a.toggle-all { display:inline;} +tr.group a.toggle-all, div.group a.toggle-all { color: #aaa; font-size: 80%; font-weight: normal; display:none;} +tr.group:hover a.toggle-all, div.group:hover a.toggle-all { display:inline;} a.toggle-all:hover {text-decoration:none;} table.list tbody tr:hover { background-color:#ffffdd; }