From 06de0c88f31b325093e0ab5981b6ddac81f90f38 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Tue, 22 Dec 2020 12:49:40 -0500 Subject: [PATCH] Progress --- app/controllers/manifests_controller.rb | 2 +- app/controllers/media_proxy_controller.rb | 4 +++- app/controllers/settings/profiles_controller.rb | 5 +---- app/views/settings/profiles/show.html.haml | 7 ++++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/manifests_controller.rb b/app/controllers/manifests_controller.rb index 238469a5..09985129 100644 --- a/app/controllers/manifests_controller.rb +++ b/app/controllers/manifests_controller.rb @@ -3,7 +3,7 @@ class ManifestsController < EmptyController def show - render json: {} #InstancePresenter.new, serializer: ManifestSerializer + render json: InstancePresenter.new, serializer: ManifestSerializer end end diff --git a/app/controllers/media_proxy_controller.rb b/app/controllers/media_proxy_controller.rb index ef5574d3..4633668e 100644 --- a/app/controllers/media_proxy_controller.rb +++ b/app/controllers/media_proxy_controller.rb @@ -8,7 +8,7 @@ class MediaProxyController < ApplicationController def show RedisLock.acquire(lock_options) do |lock| if lock.acquired? - @media_attachment = MediaAttachment.remote.find(params[:id]) + @media_attachment = MediaAttachment.find(params[:id]) redownload! if @media_attachment.needs_redownload? && !reject_media? else raise GabSocial::RaceConditionError @@ -29,6 +29,8 @@ class MediaProxyController < ApplicationController def version if request.path.ends_with?('/small') :small + elsif request.path.ends_with?('/playable') + :playable else :original end diff --git a/app/controllers/settings/profiles_controller.rb b/app/controllers/settings/profiles_controller.rb index aa580d4e..0624f4d5 100644 --- a/app/controllers/settings/profiles_controller.rb +++ b/app/controllers/settings/profiles_controller.rb @@ -17,10 +17,7 @@ class Settings::ProfilesController < Settings::BaseController def update # if verified and display_name is different, return flash error and redirect back - if @account.is_verified && params[:account][:display_name] && @account.display_name != params[:account][:display_name] - flash[:alert] = 'Unable to change Display name for verified account' - redirect_to settings_profile_path - elsif !@account.is_pro && params[:account][:username] && @account.username != params[:account][:username] + if !@account.is_pro && params[:account][:username] && @account.username != params[:account][:username] flash[:alert] = 'Unable to change username for your account. You are not GabPRO' redirect_to settings_profile_path else diff --git a/app/views/settings/profiles/show.html.haml b/app/views/settings/profiles/show.html.haml index 6506a2da..e041a11e 100644 --- a/app/views/settings/profiles/show.html.haml +++ b/app/views/settings/profiles/show.html.haml @@ -6,15 +6,16 @@ .fields-row .fields-row__column.fields-group.fields-row__column-6 + - if @account.is_pro + = f.input :username, wrapper: :with_label, input_html: { maxlength: 30 }, hint: false + - if @account.is_verified %div - %span Verified accounts cannot change their username or display name. Please contact + %span Verified accounts cannot change their display name. Please contact %a{:href => "https://gab.com/help", :style => "color:#3ACD80;text-decoration:none;outline:0;", :target => "_blank"} @help %span for more information. %br %br - - elsif @account.is_pro - = f.input :username, wrapper: :with_label, input_html: { maxlength: 30 }, hint: false - else = f.input :display_name, wrapper: :with_label, input_html: { maxlength: 30 }, hint: false = f.input :note, wrapper: :with_label, input_html: { maxlength: 500 }, hint: false