Skip to content

Commit

Permalink
active links
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed Sep 7, 2023
1 parent 3888878 commit d553408
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/packs/stylesheets/partials/_conferences.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
@include button-styles($color);
}

.button.active-btn {
opacity: 1;
}

.button.inactive-btn {
opacity: 0.5;
}

.card.card--conference.#{$class} {
@include card-styles($color);
}
Expand Down
8 changes: 7 additions & 1 deletion app/views/capitalitat/_conferences_buttons.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<div class="flex flex--sc mb-s">
<% custom_conference_types = Rails.application.secrets.custom_conference_types || [] %>
<% current_type = params[:type] %>
<% all_active = current_type.blank? %>
<% custom_conference_types.each do |item| %>
<% hashtag = item[:hashtag] %>
<% if Decidim::Conference.exists?(Decidim::Conference.filtered_by_hashtag(hashtag)) %>
<% is_active = all_active || current_type == item[:key] %>
<%= link_to I18n.t(item[:key], scope: "decidim.conferences.custom_conference_types"),
conferences_path(type: item[:key]), class: "button button--sc #{item[:key]} conference-button" %>
conferences_path(type: item[:key]),
class: "button button--sc #{item[:key]} conference-button #{is_active ? 'active-btn' : 'inactive-btn'}" %>
<% end %>
<% end %>
</div>

0 comments on commit d553408

Please sign in to comment.