Skip to content

Commit

Permalink
Update views
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed May 29, 2024
1 parent c55daba commit 65ba8b4
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ module OrderReminderGeneratorExtensions

# Overridden in order to include all users, not only published accounts.
def send_reminders(component)
budgets = Decidim::Budgets::Budget.where(component: component)
budgets = Decidim::Budgets::Budget.where(component:)
pending_orders = Decidim::Budgets::Order.where(budget: budgets, checked_out_at: nil)
users = Decidim::User.entire_collection.where(id: pending_orders.pluck(:decidim_user_id).uniq)
users.each do |user|
reminder = Decidim::Reminder.find_or_create_by(user: user, component: component)
users_pending_orders = pending_orders.where(user: user)
reminder = Decidim::Reminder.find_or_create_by(user:, component:)
users_pending_orders = pending_orders.where(user:)
update_reminder_records(reminder, users_pending_orders)
if reminder.records.active.any?
Decidim::Budgets::SendVoteReminderJob.perform_later(reminder)
Expand Down
35 changes: 0 additions & 35 deletions app/views/decidim/initiatives/initiatives/_author.html.erb

This file was deleted.

111 changes: 47 additions & 64 deletions app/views/decidim/initiatives/initiatives/_committee_members.html.erb
Original file line number Diff line number Diff line change
@@ -1,73 +1,56 @@
<fieldset>
<legend><%= t ".title" %></legend>
<div class="block">
<span class="font-semibold text-xl"><%= t ".link" %></span>
<span class="help-text mb-2">
<%= t ".invite_to_committee_help" %>
</span>

<div class="card-section">
<div class="row column">
<%= t ".invite_to_committee_help" %>
</div>

<div class="row column">
<div class="card card--list">
<div class="card--list__item">
<div class="card--list__text">
<div>
<h6 class="card--list__heading heading6 lowercase" id="committee_link">
<%= decidim_initiatives.new_initiative_committee_request_url(current_initiative) %>
</h6>
</div>
</div>
<div class="card--list__data">
<%= icon_link_to "clipboard", "#", t(".invite_to_committee_help"), class: "card--list__data__icon invite-users-link" %>
</div>
</div>
</div>
<div class="initiative__form__committee">
<span>
<%= decidim_initiatives.new_initiative_committee_request_url(current_initiative) %>
</span>
<div class="ml-auto fill-secondary inline-block">
<button type="button" class="button button__sm button__text-secondary" data-clipboard-copy="#urlShareLink-committee">
<%= render_committee_tooltip %>
<span class="sr-only"><%= t("decidim.shared.share_modal.copy_share_link") %></span>
</button>
<input id="urlShareLink-committee" type="text" class="!hidden" value="<%= decidim_initiatives.new_initiative_committee_request_url(current_initiative) %>" readonly>
</div>
</div>
<div class="card-section">
<div class="table-scroll">
<table class="table-list">
<thead>
<tr>
<th><%= t ".title" %></th>
<th></th>
</tr>
</thead>
<tbody>
<% if current_initiative.committee_members.empty? %>
<tr>
<td><%= t ".no_members_yet" %></td>
<td></td>
</tr>
<% end %>
</div>

<% current_initiative.committee_members.each do |request| %>
<tr data-id="<%= request.id %>">
<td>
<%= link_to request.user&.name, "mailto:#{request.user&.email}" %>
</td>
<td class="table-list__actions">
<% if allowed_to? :approve, :initiative_committee_member, initiative: current_initiative, request: request %>
<%= icon_link_to "check",
approve_initiative_committee_request_path(current_initiative, request),
t(".approve"),
class: "action-icon--check" %>
<div class="block">
<span class="font-semibold text-xl mb-4 block"><%= t ".title" %></span>
<% if current_initiative.committee_members.empty? %>
<%= t ".no_members_yet" %>
<% end %>
<% current_initiative.committee_members.each do |request| %>
<div class="author mb-6" data-id="<%= request.id %>">
<div class="profile__group__list">
<%= card_for request.user %>
<% if allowed_to? :approve, :initiative_committee_member, initiative: current_initiative, request: request %>
<%= link_to(
approve_initiative_committee_request_path(current_initiative, request),
data: { confirm: t(".confirm_approve") },
class: "button button__sm button__transparent-secondary"
) do %>
<span><%= t(".approve") %></span>
<%= icon "check-line" %>
<% end %>

<% if allowed_to? :revoke, :initiative_committee_member, initiative: current_initiative, request: request %>
<%= icon_link_to "circle-x",
revoke_initiative_committee_request_path(current_initiative, request),
t(".revoke"),
class: "action-icon--remove",
method: :delete,
data: { confirm: t(".confirm_revoke") } %>
<% end %>
<% if allowed_to? :revoke, :initiative_committee_member, initiative: current_initiative, request: request %>
<%= link_to(
revoke_initiative_committee_request_path(current_initiative, request),
method: :delete,
data: { confirm: t(".confirm_revoke") },
class: "button button__sm button__transparent-secondary"
) do %>
<span><%= t(".revoke") %></span>
<%= icon "forbid-line" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
</div>
</div>
</div>
</fieldset>
<% end %>
</div>

<%= append_javascript_pack_tag "decidim_initiatives_admin" %>
37 changes: 0 additions & 37 deletions app/views/decidim/proposals/proposals/_linked_proposals.html.erb

This file was deleted.

24 changes: 14 additions & 10 deletions app/views/layouts/decidim/footer/_main_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<%= footer_menu.render %>

<nav role="navigation" aria-label="<%= t("layouts.decidim.footer.resources") %>">
<h2 class="h4 mb-4"><%= t("layouts.decidim.footer.resources") %></h2>
<ul class="space-y-4 break-inside-avoid">
<li class="font-semibold underline"><%= link_to t("decidim.profiles.show.activity"), decidim.last_activities_path %></li>
<li class="font-semibold underline"><%= link_to t("decidim.pages.home.extended.meetings"), Decidim::Meetings::DirectoryEngine.routes.url_helpers.root_path %></li>
<li class="font-semibold underline"><%= link_to t("layouts.decidim.footer.download_open_data"), decidim.open_data_download_path %></li>
</ul>
</nav>

<nav role="navigation" aria-label="<%= t("layouts.decidim.user_menu.profile") %>">
<h2 class="h4 mb-4"><%= t("layouts.decidim.user_menu.profile") %></h2>
<ul class="space-y-4 break-inside-avoid">
<% if current_user %>
<li class="font-semibold underline"><%= link_to t("layouts.decidim.user_menu.configuration"), decidim.account_path %></li>
<li class="font-semibold underline"><%= link_to t("layouts.decidim.user_menu.public_profile"), decidim.profile_path(current_user.nickname) %></li>
<% if current_user.public? %>
<li class="font-semibold underline"><%= link_to t("layouts.decidim.user_menu.public_profile"), decidim.profile_path(current_user.nickname) %></li>
<% end %>
<li class="font-semibold underline"><%= link_to t("layouts.decidim.user_menu.notifications"), decidim.notifications_path %></li>
<% unless current_user.private_or_no_messaging? %>
<li class="font-semibold underline"><%= link_to t("layouts.decidim.user_menu.conversations"), decidim.conversations_path %></li>
Expand All @@ -27,3 +20,14 @@
<% end %>
</ul>
</nav>

<nav role="navigation" aria-label="<%= t("layouts.decidim.footer.resources") %>">
<h2 class="h4 mb-4"><%= t("layouts.decidim.footer.resources") %></h2>
<ul class="space-y-4 break-inside-avoid">
<li class="font-semibold underline"><%= link_to t("decidim.profiles.show.activity"), decidim.last_activities_path %></li>
<li class="font-semibold underline"><%= link_to t("decidim.pages.home.extended.meetings"), Decidim::Meetings::DirectoryEngine.routes.url_helpers.root_path %></li>
<li class="font-semibold underline"><%= link_to t("layouts.decidim.footer.download_open_data"), decidim.open_data_download_path %></li>
</ul>
</nav>

<%= cell("decidim/footer_topics", nil) %>
21 changes: 0 additions & 21 deletions app/views/layouts/decidim/user_profile.html.erb

This file was deleted.

0 comments on commit 65ba8b4

Please sign in to comment.