-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve design of "Related Documents" section (#13705)
* Improve design of "Want to find out more?" section * Added metadata to directory * fix small CSS issues, fix typo * Update decidim-core/app/views/decidim/application/_collection.html.erb Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro> * add translation key * Normalize locales * Fix stylelint * Run erblint * Update decidim-core/config/locales/en.yml --------- Co-authored-by: andra-panaite <andra.panaite@tremend.com> Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
- Loading branch information
1 parent
4b15845
commit 3dab13c
Showing
3 changed files
with
79 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 30 additions & 18 deletions
48
decidim-core/app/views/decidim/application/_collection.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
<% unless attachment_collection.unused? %> | ||
<button id="dropdown-documents-trigger-<%= attachment_collection.id %>" class="documents__collection-trigger" data-component="dropdown" data-target="dropdown-menu-documents-<%= attachment_collection.id %>" aria-expanded="false"> | ||
<span> | ||
<span class="documents__collection-trigger__icon"> | ||
<%= icon "folder-line" %> | ||
<%= icon "folder-open-line" %> | ||
</span> | ||
<%= decidim_escape_translated(attachment_collection.name) %> | ||
</span> | ||
<%= icon "arrow-down-s-fill" %> | ||
<%= icon "arrow-up-s-fill" %> | ||
</button> | ||
<div class="documents__dropdown-container"> | ||
<button id="dropdown-documents-trigger-<%= attachment_collection.id %>" class="documents__collection-trigger" data-component="dropdown" data-target="dropdown-menu-documents-<%= attachment_collection.id %>" aria-expanded="false"> | ||
<div class="documents-details"> | ||
<span> | ||
<span class="documents__collection-trigger__icon"> | ||
<%= icon "folder-line" %> | ||
<%= icon "folder-open-line" %> | ||
</span> | ||
<%= decidim_escape_translated(attachment_collection.name) %> | ||
</span> | ||
|
||
<div id="dropdown-menu-documents-<%= attachment_collection.id %>" class="documents__collection-content" aria-hidden="true"> | ||
<% if (description = attachment_collection.description).present? %> | ||
<p><%= decidim_escape_translated(description) %></p> | ||
<% end %> | ||
<div class="card__list-metadata"> | ||
<div><%= icon "file-text-line" %><%= t("decidim.documents", count: documents.count) %></div> | ||
<% sum = 0 | ||
documents.each { |document| sum += document.file_size.to_i } %> | ||
<div><%= icon "scales-2-line" %><%= number_to_human_size(sum) %></div> | ||
</div> | ||
</div> | ||
|
||
<div class="documents__container"> | ||
<% documents.each do |document| %> | ||
<%= render partial: "decidim/application/document", formats: [:html], locals: { document: } %> | ||
<%= icon "arrow-down-s-fill" %> | ||
<%= icon "arrow-up-s-fill" %> | ||
</button> | ||
|
||
<div id="dropdown-menu-documents-<%= attachment_collection.id %>" class="documents__collection-content" aria-hidden="true"> | ||
<% if (description = attachment_collection.description).present? %> | ||
<p><%= decidim_escape_translated(description) %></p> | ||
<% end %> | ||
|
||
<div class="documents__container"> | ||
<% documents.each do |document| %> | ||
<%= render partial: "decidim/application/document", formats: [:html], locals: { document: } %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters