about summary refs log tree commit diff
path: root/app/views/admin
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-09-18 17:25:56 +0200
committerThibaut Girka <thib@sitedethib.com>2019-09-18 17:25:56 +0200
commit5cadb4723832b91068ee51955b9d4b1336502369 (patch)
tree2e915e53ee0d25ea63ee3910ae8ced44f3295e21 /app/views/admin
parentab646fac5f582fe9bef22d8b9a4995fbb4b42d7d (diff)
parentd0c2c5278391b82ba7fa2f230bf237805ff61a0c (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/controllers/auth/sessions_controller.rb
  Minor conflict due to glitch-soc's theming code
Diffstat (limited to 'app/views/admin')
-rw-r--r--app/views/admin/dashboard/index.html.haml18
-rw-r--r--app/views/admin/tags/index.html.haml34
-rw-r--r--app/views/admin/tags/show.html.haml2
3 files changed, 37 insertions, 17 deletions
diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml
index af7a59802..06f29b79b 100644
--- a/app/views/admin/dashboard/index.html.haml
+++ b/app/views/admin/dashboard/index.html.haml
@@ -4,35 +4,35 @@
 .dashboard__counters
   %div
     = link_to admin_accounts_url(local: 1, recent: 1) do
-      .dashboard__counters__num= number_with_delimiter @users_count
+      .dashboard__counters__num= number_to_human @users_count, strip_insignificant_zeros: true
       .dashboard__counters__label= t 'admin.dashboard.total_users'
   %div
     %div
-      .dashboard__counters__num= number_with_delimiter @registrations_week
+      .dashboard__counters__num= number_to_human @registrations_week, strip_insignificant_zeros: true
       .dashboard__counters__label= t 'admin.dashboard.week_users_new'
   %div
     %div
-      .dashboard__counters__num= number_with_delimiter @logins_week
+      .dashboard__counters__num= number_to_human @logins_week, strip_insignificant_zeros: true
       .dashboard__counters__label= t 'admin.dashboard.week_users_active'
   %div
     = link_to admin_pending_accounts_path do
-      .dashboard__counters__num= number_with_delimiter @pending_users_count
+      .dashboard__counters__num= number_to_human @pending_users_count, strip_insignificant_zeros: true
       .dashboard__counters__label= t 'admin.dashboard.pending_users'
   %div
     = link_to admin_reports_url do
-      .dashboard__counters__num= number_with_delimiter @reports_count
+      .dashboard__counters__num= number_to_human @reports_count, strip_insignificant_zeros: true
       .dashboard__counters__label= t 'admin.dashboard.open_reports'
   %div
-    = link_to admin_tags_path(review: 'pending_review') do
-      .dashboard__counters__num= number_with_delimiter @pending_tags_count
+    = link_to admin_tags_path(pending_review: '1') do
+      .dashboard__counters__num= number_to_human @pending_tags_count, strip_insignificant_zeros: true
       .dashboard__counters__label= t 'admin.dashboard.pending_tags'
   %div
     %div
-      .dashboard__counters__num= number_with_delimiter @interactions_week
+      .dashboard__counters__num= number_to_human @interactions_week, strip_insignificant_zeros: true
       .dashboard__counters__label= t 'admin.dashboard.week_interactions'
   %div
     = link_to sidekiq_url do
-      .dashboard__counters__num= number_with_delimiter @queue_backlog
+      .dashboard__counters__num= number_to_human @queue_backlog, strip_insignificant_zeros: true
       .dashboard__counters__label= t 'admin.dashboard.backlog'
 
 .dashboard__widgets
diff --git a/app/views/admin/tags/index.html.haml b/app/views/admin/tags/index.html.haml
index c9af7c14d..ef05a9bd6 100644
--- a/app/views/admin/tags/index.html.haml
+++ b/app/views/admin/tags/index.html.haml
@@ -5,16 +5,36 @@
   .filter-subset
     %strong= t('admin.tags.context')
     %ul
-      %li= filter_link_to t('generic.all'), context: nil
-      %li= filter_link_to t('admin.tags.directory'), context: 'directory'
+      %li= filter_link_to t('generic.all'), directory: nil
+      %li= filter_link_to t('admin.tags.directory'), directory: '1'
 
   .filter-subset
     %strong= t('admin.tags.review')
     %ul
-      %li= filter_link_to t('generic.all'), review: nil
-      %li= filter_link_to t('admin.tags.unreviewed'), review: 'unreviewed'
-      %li= filter_link_to t('admin.tags.reviewed'), review: 'reviewed'
-      %li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{Tag.pending_review.count})"], ' '), review: 'pending_review'
+      %li= filter_link_to t('generic.all'), reviewed: nil, unreviewed: nil, pending_review: nil
+      %li= filter_link_to t('admin.tags.unreviewed'), unreviewed: '1', reviewed: nil, pending_review: nil
+      %li= filter_link_to t('admin.tags.reviewed'), reviewed: '1', unreviewed: nil, pending_review: nil
+      %li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{Tag.pending_review.count})"], ' '), pending_review: '1', reviewed: nil, unreviewed: nil
+
+  .filter-subset
+    %strong= t('generic.order_by')
+    %ul
+      %li= filter_link_to t('admin.tags.most_recent'), popular: nil, active: nil
+      %li= filter_link_to t('admin.tags.most_popular'), popular: '1', active: nil
+      %li= filter_link_to t('admin.tags.last_active'), active: '1', popular: nil
+
+= form_tag admin_tags_url, method: 'GET', class: 'simple_form' do
+  .fields-group
+    - Admin::FilterHelper::TAGS_FILTERS.each do |key|
+      = hidden_field_tag key, params[key] if params[key].present?
+
+    - %i(name).each do |key|
+      .input.string.optional
+        = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.tags.#{key}")
+
+    .actions
+      %button= t('admin.accounts.search')
+      = link_to t('admin.accounts.reset'), admin_tags_path, class: 'button negative'
 
 %hr.spacer/
 
@@ -43,7 +63,7 @@
 
 = paginate @tags
 
-- if params[:review] == 'pending_review'
+- if params[:pending_review] == '1'
   %hr.spacer/
 
   %div{ style: 'overflow: hidden' }
diff --git a/app/views/admin/tags/show.html.haml b/app/views/admin/tags/show.html.haml
index d54a43c1e..1d970d637 100644
--- a/app/views/admin/tags/show.html.haml
+++ b/app/views/admin/tags/show.html.haml
@@ -3,7 +3,7 @@
 
 .dashboard__counters
   %div
-    = link_to web_url("timelines/tag/#{@tag.name}") do
+    = link_to tag_url(@tag), target: '_blank', rel: 'noopener' do
       .dashboard__counters__num= number_with_delimiter @accounts_today
       .dashboard__counters__label= t 'admin.tags.accounts_today'
   %div