Skip to content

Commit

Permalink
change help text
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed Sep 5, 2024
1 parent 0e6c2c7 commit 5d61c80
Showing 1 changed file with 35 additions and 39 deletions.
74 changes: 35 additions & 39 deletions decidim-admin/app/views/decidim/admin/share_tokens/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,44 @@
</h2>
</div>
<div class="card-section">
<div>
<p class="help-text whitespace-pre-line"><%= t(".share_tokens_help", clipboard: icon("clipboard", class: "inline-block mb-1")).html_safe %></p>
</div>
<p class="help-text mt-xs mb-sm" style="white-space: pre-line;"><%= t(".share_tokens_help", clipboard: icon("clipboard")).html_safe %></p>
<% if @share_tokens.any? %>
<div class="card-section">
<div class="table-scroll">
<table class="table-list">
<thead>
<div class="table-scroll">
<table class="table-list">
<thead>
<tr>
<th><%= sort_link(query, :token, t("models.share_token.fields.token", scope: "decidim.admin"), default_order: :desc) %></th>
<th><%= sort_link(query, :expires_at, t("models.share_token.fields.expires_at", scope: "decidim.admin"), default_order: :desc) %></th>
<th><%= sort_link(query, :registered_only, t("models.share_token.fields.registered_only", scope: "decidim.admin"), default_order: :desc) %></th>
<th><%= sort_link(query, :times_used, t("models.share_token.fields.times_used", scope: "decidim.admin"), default_order: :desc) %></th>
<th><%= t("models.share_token.fields.actions", scope: "decidim.admin") %></th>
</tr>
</thead>
<tbody>
<% @share_tokens.each do |share_token| %>
<tr>
<th><%= sort_link(query, :token, t("models.share_token.fields.token", scope: "decidim.admin"), default_order: :desc) %></th>
<th><%= sort_link(query, :expires_at, t("models.share_token.fields.expires_at", scope: "decidim.admin"), default_order: :desc) %></th>
<th><%= sort_link(query, :registered_only, t("models.share_token.fields.registered_only", scope: "decidim.admin"), default_order: :desc) %></th>
<th><%= sort_link(query, :times_used, t("models.share_token.fields.times_used", scope: "decidim.admin"), default_order: :desc) %></th>
<th><%= t("models.share_token.fields.actions", scope: "decidim.admin") %></th>
<td id="js-token-<%= share_token.id %>"><%= share_token.token %></td>
<td><%= share_token.expires_at.present? ? ("<span class=\"text-#{share_token.expired? ? "warning" : ""}\">#{l(share_token.expires_at, format: :decidim_short)}</span>".html_safe) : content_tag(:em, t(".never")) %></td>
<td><%= t("booleans.#{share_token.registered_only.present?}") %></td>
<td><%= share_token.times_used %></td>
<td class="table-list__actions">
<%= icon_link_to "pencil", share_tokens_path(:edit, id: share_token ), t("actions.edit", scope: "decidim.admin.share_tokens"), class: "action-icon--edit" %>
<%= icon_link_to "clipboard",
"#",
t("actions.copy_link", scope: "decidim.admin.share_tokens"),
class: "action-icon--copy",
data: {
"clipboard-copy" => "#js-token-#{share_token.id}",
"clipboard-content" => share_token.url,
"clipboard-copy-label" => t(".copied"),
"clipboard-copy-message" => t(".copy_message") } %>
<%= icon_link_to "eye", share_token.url, t("actions.preview", scope: "decidim.admin.share_tokens"), class: "action-icon--preview", target: :blank %>
<%= icon_link_to "trash", share_tokens_path(:destroy, id: share_token ), t("actions.destroy", scope: "decidim.admin.share_tokens"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin.share_tokens") } %>
</td>
</tr>
</thead>
<tbody>
<% @share_tokens.each do |share_token| %>
<tr>
<td id="js-token-<%= share_token.id %>"><%= share_token.token %></td>
<td><%= share_token.expires_at.present? ? ("<span class=\"text-#{share_token.expired? ? "warning" : ""}\">#{l(share_token.expires_at, format: :decidim_short)}</span>".html_safe) : content_tag(:em, t(".never")) %></td>
<td><%= t("booleans.#{share_token.registered_only.present?}") %></td>
<td><%= share_token.times_used %></td>
<td class="table-list__actions">
<%= icon_link_to "pencil", share_tokens_path(:edit, id: share_token ), t("actions.edit", scope: "decidim.admin.share_tokens"), class: "action-icon--edit" %>
<%= icon_link_to "clipboard",
"#",
t("actions.copy_link", scope: "decidim.admin.share_tokens"),
class: "action-icon--copy",
data: {
"clipboard-copy" => "#js-token-#{share_token.id}",
"clipboard-content" => share_token.url,
"clipboard-copy-label" => t(".copied"),
"clipboard-copy-message" => t(".copy_message") } %>
<%= icon_link_to "eye", share_token.url, t("actions.preview", scope: "decidim.admin.share_tokens"), class: "action-icon--preview", target: :blank %>
<%= icon_link_to "trash", share_tokens_path(:destroy, id: share_token ), t("actions.destroy", scope: "decidim.admin.share_tokens"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin.share_tokens") } %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
</tbody>
</table>
</div>
<% else %>
<p><%= t(".empty", new_token_link: link_to(t(".create_new_token"), share_tokens_path(:new) , class: "")).html_safe %></p>
Expand Down

0 comments on commit 5d61c80

Please sign in to comment.