Source code for the custom Mastodon (Glitchsoc) instance on berserker.town.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
745 B

# frozen_string_literal: true
module Admin
class TagsController < BaseController
before_action :set_tag
def show
authorize @tag, :show?
@time_period = (6.days.ago.to_date...Time.now.utc.to_date)
end
def update
authorize @tag, :update?
if @tag.update(tag_params.merge(reviewed_at: Time.now.utc))
redirect_to admin_tag_path(@tag.id), notice: I18n.t('admin.tags.updated_msg')
else
@time_period = (6.days.ago.to_date...Time.now.utc.to_date)
render :show
end
end
private
def set_tag
@tag = Tag.find(params[:id])
end
def tag_params
params.require(:tag).permit(:name, :display_name, :trendable, :usable, :listable)
end
end
end