Updated routes for admins dashboard

• Updated:
- routes for admins dashboard (expenses, group categories, promotions, trending hashtags) that were in the /settings path but are now in the /admin path
- /filters to be in /settings/filters

• Removed:
- authorize_follow route
This commit is contained in:
mgabdev
2021-01-13 18:06:45 -05:00
parent 27389883dd
commit 8aeae9c45d
21 changed files with 50 additions and 53 deletions

View File

@@ -1,6 +0,0 @@
- content_for :page_title do
= t('monthly_funding.title')
= form_tag settings_expenses_url, :method => :post do
= text_field_tag "amount", "", placeholder: "0-100", :value => @amount
= submit_tag "Submit"

View File

@@ -0,0 +1,16 @@
.fields-row
.fields-row__column.fields-row__column-6.fields-group
= f.input :phrase, as: :string, wrapper: :with_label, hint: false
.fields-row__column.fields-row__column-6.fields-group
= f.input :expires_in, wrapper: :with_label, collection: [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].map(&:to_i), label_method: lambda { |i| I18n.t("invites.expires_in.#{i}") }, prompt: I18n.t('invites.expires_in_prompt')
.fields-group
= f.input :context, wrapper: :with_block_label, collection: CustomFilter::VALID_CONTEXTS, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label_method: lambda { |context| I18n.t("filters.contexts.#{context}") }, include_blank: false
%hr.spacer/
.fields-group
= f.input :irreversible, wrapper: :with_label
.fields-group
= f.input :whole_word, wrapper: :with_label

View File

@@ -0,0 +1,8 @@
- content_for :page_title do
= t('filters.edit.title')
= simple_form_for @filter, url: settings_filter_path(@filter), method: :put do |f|
= render 'fields', f: f
.actions
= f.button :button, t('generic.save_changes'), type: :submit

View File

@@ -0,0 +1,20 @@
- content_for :page_title do
= t('filters.index.title')
.table-wrapper
%table.table
%thead
%tr
%th= t('simple_form.labels.defaults.phrase')
%th= t('simple_form.labels.defaults.context')
%th
%tbody
- @filters.each do |filter|
%tr
%td= filter.phrase
%td= filter.context.map { |context| I18n.t("filters.contexts.#{context}") }.join(', ')
%td
= table_link_to 'pencil', t('filters.edit.title'), edit_settings_filter_path(filter)
= table_link_to 'times', t('filters.index.delete'), settings_filter_path(filter), method: :delete
= link_to t('filters.new.title'), new_settings_filter_path, class: 'button'

View File

@@ -0,0 +1,8 @@
- content_for :page_title do
= t('filters.new.title')
= simple_form_for @filter, url: settings_filters_path do |f|
= render 'fields', f: f
.actions
= f.button :button, t('filters.new.title'), type: :submit

View File

@@ -1,5 +0,0 @@
%tr
%td= group_categories.created_at
%td= group_categories.text
%td
= table_link_to 'trash', t('group_categories.delete'), settings_group_categories_path(group_categories), method: :delete

View File

@@ -1,20 +0,0 @@
- content_for :page_title do
= t('group_categories.title')
= form_tag settings_group_categories_url, method: 'POST', class: 'simple_form' do
.fields-group
.input.string.optional
= text_field_tag :text, params[:text], class: 'string optional', placeholder: I18n.t("group_categories.text")
.actions
%button= t('group_categories.create')
.table-wrapper
%table.table
%thead
%tr
%th= t('categories.created_at')
%th= t('categories.text')
%th
%tbody
= render @categories

View File

@@ -1,8 +0,0 @@
%tr
%td= promotion.timeline_id
%td= promotion.status_id
%td= promotion.expires_at
%td= promotion.position
%td
= table_link_to 'pencil', t('promotions.edit'), edit_settings_promotion_path(promotion)
= table_link_to 'trash', t('promotions.delete'), settings_promotion_path(promotion), method: :delete, data: { confirm: t('settings.promotions.are_you_sure') }

View File

@@ -1,14 +0,0 @@
- content_for :page_title do
= t('promotions.title')
= simple_form_for @promotion, url: settings_promotion_path(@promotion) do |f|
= render 'shared/error_messages', object: @promotion
.fields-group
= f.input :timeline_id, wrapper: :with_label, label: t('promotions.timeline_id')
= f.input :status_id, wrapper: :with_label, label: t('promotions.status_id')
= f.input :expires_at, as: :string, wrapper: :with_label, label: t('promotions.expires_at')
= f.input :position, wrapper: :with_label, label: t('promotions.position')
.actions
= f.button :button, t('generic.save_changes'), type: :submit

View File

@@ -1,16 +0,0 @@
- content_for :page_title do
= t('promotions.title')
.table-wrapper
%table.table
%thead
%tr
%th= t('promotions.timeline_id')
%th= t('promotions.status_id')
%th= t('promotions.expires_at')
%th= t('promotions.position')
%th
%tbody
= render @promotions
= link_to t('promotions.create'), new_settings_promotion_path, class: 'button'

View File

@@ -1,14 +0,0 @@
- content_for :page_title do
= t('.title')
= simple_form_for @promotion, url: settings_promotions_path do |f|
= render 'shared/error_messages', object: @promotion
.fields-group
= f.input :timeline_id, wrapper: :with_label, label: t('promotions.timeline_id')
= f.input :status_id, wrapper: :with_label, label: t('promotions.status_id')
= f.input :expires_at, as: :string, wrapper: :with_label, label: t('promotions.expires_at')
= f.input :position, wrapper: :with_label, label: t('promotions.position')
.actions
= f.button :button, t('.create'), type: :submit

View File

@@ -1,6 +0,0 @@
- content_for :page_title do
= 'Trending Hashtags'
= form_tag settings_trending_hashtags_url, :method => :post do
= text_field_tag "trending_hashtags", "", :style => 'width:400px', placeholder: "StopTheSteal, Trump2020, Election2020", :value => @trending_hashtags
= submit_tag "Submit"