Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/controllers/auth/sessions_controller.rb
  Minor conflict due to glitch-soc's theming code
This commit is contained in:
Thibaut Girka
2019-09-18 17:25:56 +02:00
180 changed files with 1537 additions and 432 deletions

View File

@ -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

View File

@ -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' }

View File

@ -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

View File

@ -2,4 +2,4 @@
<%= raw t('admin_mailer.new_trending_tag.body', name: @tag.name) %>
<%= raw t('application_mailer.view')%> <%= admin_tags_url(review: 'pending_review') %>
<%= raw t('application_mailer.view')%> <%= admin_tags_url(pending_review: '1') %>

View File

@ -20,7 +20,10 @@
%hr.spacer/
= f.input :password, wrapper: :with_block_label, input_html: { :autocomplete => 'off' }, hint: t('deletes.confirm_password')
- if current_user.encrypted_password.present?
= f.input :password, wrapper: :with_block_label, input_html: { :autocomplete => 'off' }, hint: t('deletes.confirm_password')
- else
= f.input :username, wrapper: :with_block_label, input_html: { :autocomplete => 'off' }, hint: t('deletes.confirm_username')
.actions
= f.button :button, t('deletes.proceed'), type: :submit, class: 'negative'

View File

@ -12,7 +12,7 @@
%samp.qr-alternative__code= current_user.otp_secret.scan(/.{4}/).join(' ')
.fields-group
= f.input :code, wrapper: :with_label, hint: t('two_factor_authentication.code_hint'), label: t('simple_form.labels.defaults.otp_attempt'), input_html: { :autocomplete => 'off' }, required: true
= f.input :otp_attempt, wrapper: :with_label, hint: t('two_factor_authentication.code_hint'), label: t('simple_form.labels.defaults.otp_attempt'), input_html: { :autocomplete => 'off' }, required: true
.actions
= f.button :button, t('two_factor_authentication.enable'), type: :submit

View File

@ -10,7 +10,7 @@
%hr/
= simple_form_for @confirmation, url: settings_two_factor_authentication_path, method: :delete do |f|
= f.input :code, wrapper: :with_label, hint: t('two_factor_authentication.code_hint'), label: t('simple_form.labels.defaults.otp_attempt'), input_html: { :autocomplete => 'off' }, required: true
= f.input :otp_attempt, wrapper: :with_label, hint: t('two_factor_authentication.code_hint'), label: t('simple_form.labels.defaults.otp_attempt'), input_html: { :autocomplete => 'off' }, required: true
.actions
= f.button :button, t('two_factor_authentication.disable'), type: :submit