Skip to content

Commit

Permalink
use split view by default in amendments
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Feb 20, 2024
1 parent 9ab4043 commit 5c84f48
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/cells/decidim/diff/attribute.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="diff-for-<%= data[:label].parameterize %>">
<div class="row">
<h3 class="section-heading mediumlarge-12 columns">
<%= data[:label] %>
</h3>
</div>

<div class="row diff_view diff_view_split" id="attribute-diff-unified-<%= data[:label].parameterize %>-<%= format %>">
<%= diff_split(data, "left", format) %>
<%= diff_split(data, "right", format) %>
</div>

<div class="row diff_view diff_view_unified hide" id="attribute-diff-unified-<%= data[:label].parameterize %>-<%= format %>">
<%= diff_unified(data, format) %>
</div>
</div>
34 changes: 34 additions & 0 deletions app/cells/decidim/diff/diff_mode_dropdown.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<div class="diff-view-by show-for-mediumlarge">
<div class="diff-view-by__dropdown">
<span class="diff-view-by__text">
<%= t("versions.dropdown.choose_diff_view_mode") %>
</span>

<ul class="dropdown menu" data-dropdown-menu
data-autoclose="false"
data-disable-hover="true"
data-click-open="true"
data-close-on-click="true"
role="menubar">
<li class="is-dropdown-submenu-parent" role="presentation">
<a href="#diffmode-chooser-menu" id="diff-view-selected" aria-controls="diffmode-chooser-menu" aria-haspopup="true" aria-label="<%= t("versions.dropdown.choose_diff_view_mode_menu") %>" role="menuitem">
<%= t("versions.dropdown.option_split") %>
</a>

<ul class="menu is-dropdown-submenu" id="diffmode-chooser-menu" role="menu" aria-labelledby="diff-view-selected">
<li role="presentation">
<%= link_to "#diff-view-split", class: "diff-view-mode diff-view-split", id:"diff-view-split", role: "menuitem" do %>
<%= t("versions.dropdown.option_split") %>
<% end %>
</li>

<li role="presentation">
<%= link_to "#diff-view-unified", class: "diff-view-mode diff-view-unified", id:"diff-view-unified", role: "menuitem" do %>
<%= t("versions.dropdown.option_unified") %>
<% end %>
</li>
</ul>
</li>
</ul>
</div>
</div>
2 changes: 2 additions & 0 deletions spec/lib/overrides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"/app/views/decidim/devise/shared/_omniauth_buttons_mini.html.erb" => "d3a413ce7c64959eee3b912406075f84",
# cells
"/app/cells/decidim/date_range/show.erb" => "7e050b942e447386fc96ef6528039cec",
"/app/cells/decidim/diff/attribute.erb" => "d648bc8e71e27c404d82132d6e3c3241",
"/app/cells/decidim/diff/diff_mode_dropdown.erb" => "770563c121c875159a88cd5e142658e3",
# other overrides
"/app/helpers/decidim/card_helper.rb" => "b9e7f943ae7c289b2855d328de7b371b",
"/app/commands/decidim/amendable/accept.rb" => "c561b69a7bd5b68dfc4684c11001cb2c",
Expand Down

0 comments on commit 5c84f48

Please sign in to comment.