mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
UX: admins embedding page follows admin ux guideline (#30122)
Conversion of /admin/customize/embedding page to follow admin UX guidelines.
This commit is contained in:

committed by
GitHub

parent
02113fc22a
commit
407fa69778
@ -8,11 +8,11 @@ class Admin::EmbeddingController < Admin::AdminController
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:embedding][:embed_by_username].blank?
|
||||
return render_json_error(I18n.t("site_settings.embed_username_required"))
|
||||
end
|
||||
raise InvalidAccess if !(%w[posts_and_topics crawlers].include?(params[:embedding][:type]))
|
||||
|
||||
Embedding.settings.each { |s| @embedding.public_send("#{s}=", params[:embedding][s]) }
|
||||
Embedding
|
||||
.send("#{params[:embedding][:type]}_settings")
|
||||
.each { |s| @embedding.public_send("#{s}=", params[:embedding][s]) }
|
||||
|
||||
if @embedding.save
|
||||
fetch_embedding
|
||||
@ -22,6 +22,12 @@ class Admin::EmbeddingController < Admin::AdminController
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def fetch_embedding
|
||||
|
Reference in New Issue
Block a user