Skip to content

Commit

Permalink
Pens micro clustering page
Browse files Browse the repository at this point in the history
  • Loading branch information
ujh committed Apr 25, 2024
1 parent 9612b56 commit 7d7c6ae
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/admins/pens/micro_clusters_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def index
.serializable_hash
.to_json
end
format.html
end
end

Expand Down
4 changes: 4 additions & 0 deletions app/models/admin_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def micro_clusters_to_assign_count
.count
end

def pens_micro_clusters_to_assign_count
Pens::MicroCluster.unassigned.without_ignored.count
end

def macro_cluster_count
@macro_cluster_count ||= MacroCluster.count
end
Expand Down
9 changes: 8 additions & 1 deletion app/views/admins/dashboards/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ table class="table table-striped"
tr
td= CollectedPen.count
tr
td= "#{Pens::MicroCluster.count} (micro clusters)"
td
= "#{Pens::MicroCluster.count} micro clusters"
- if @stats.pens_micro_clusters_to_assign_count.positive?
b
| (
|  
= link_to "#{@stats.pens_micro_clusters_to_assign_count} to assign", admins_pens_micro_clusters_path
| )
tr
td Number of "Currently Inked"
td= CurrentlyInked.count
Expand Down
1 change: 1 addition & 0 deletions app/views/admins/pens/micro_clusters/index.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
div id="pens-micro-clusters-app"
4 changes: 4 additions & 0 deletions app/views/layouts/admin/_header.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ nav class="fpc-header navbar navbar-dark navbar-expand-md" id="header"
li= link_to "Ignored", ignored_admins_micro_clusters_path, class: "dropdown-item"
li= link_to "Brand Clustering app", new_admins_brand_cluster_path, class: "dropdown-item"
li= link_to "Brand Clusters", admins_brand_clusters_path, class: "dropdown-item"
li class="nav-item dropdown"
a href="#" class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false" Pens
ul class="dropdown-menu"
li= link_to "Clustering app", admins_pens_micro_clusters_path, class: "dropdown-item"
li= link_to "Sidekiq", sidekiq_web_path, class: "nav-link"
li= link_to "Blog", admins_blog_posts_path, class: "nav-link"
li class="dropdown"
Expand Down

0 comments on commit 7d7c6ae

Please sign in to comment.