Stub filtering for popped bubbles
This commit is contained in:
@@ -4,7 +4,8 @@ class BubblesController < ApplicationController
|
||||
before_action :set_bubble, only: %i[ show edit update ]
|
||||
|
||||
def index
|
||||
@bubbles = @bucket.bubbles.not_popped
|
||||
@bubbles = @bucket.bubbles
|
||||
@bubbles = params.include?(:popped) ? @bubbles.popped : @bubbles.not_popped
|
||||
|
||||
if params[:term].present?
|
||||
@bubbles = @bubbles.mentioning(params[:term])
|
||||
|
||||
@@ -22,6 +22,6 @@ module BubblesHelper
|
||||
end
|
||||
|
||||
def bubble_filter_params
|
||||
params.permit(:term, :tag_id, :assignee_id)
|
||||
params.permit(:popped, :term, :tag_id, :assignee_id)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<path d="m305.9 85.7c-3.9-17.2 7.3-35.5 23.8-39.2 16.6-3.7 34.4 8.1 38.3 25.2l7.2 32.2c3.9 17.2-7.3 35.5-23.8 39.2-16.6 3.7-34.4-8.1-38.3-25.2z"/>
|
||||
<path d="m504.4 876.2c-3.9-17.2 7.3-35.5 23.8-39.2 16.6-3.7 34.4 8.1 38.3 25.2l7.2 32.2c3.9 17.2-7.3 35.5-23.8 39.2-16.6 3.7-34.4-8.1-38.3-25.2z"/>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
<% else %>
|
||||
<svg class="bubble__svg" viewBox="0 0 990 990" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m0 0h990v990h-990z" fill="none" stroke="none" />
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
<h1 class="txt-large">
|
||||
<div class="filter" data-controller="dialog" data-action="keydown.esc->dialog#close">
|
||||
<button class="btn btn--plain filter__button" data-action="click->dialog#toggle" data-dialog-modal-value="true">
|
||||
Most active
|
||||
<% if params[:popped] %>
|
||||
Popped
|
||||
<% else %>
|
||||
Most active
|
||||
<% end %>
|
||||
</button>
|
||||
|
||||
<dialog class="filter__popup panel fill-white shadow" data-dialog-target="dialog">
|
||||
<menu class="filter__menu flex flex-column gap-half unpad margin-none txt-medium">
|
||||
<li><a href="#" class="filter__button">Most active</a></li>
|
||||
<li><%= link_to "Most active", bucket_bubbles_path(bucket, bubble_filter_params.without(:popped)), class: "filter__button" %></li>
|
||||
<li><a href="#" class="filter__button">Most discussed</a></li>
|
||||
<li><a href="#" class="filter__button">Most boosted</a></li>
|
||||
<li><a href="#" class="filter__button">Newest</a></li>
|
||||
<li><a href="#" class="filter__button">Oldest</a></li>
|
||||
<li><a href="#" class="filter__button">Popped</a></li>
|
||||
<li><%= link_to "Popped", bucket_bubbles_path(bucket, bubble_filter_params.merge(popped: true)), class: "filter__button" %></li>
|
||||
</menu>
|
||||
</dialog>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user