WIP Rename "projects" page, make content editable
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
22
app/controllers/contributions/other_controller.rb
Normal file
22
app/controllers/contributions/other_controller.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class Contributions::OtherController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
before_action :set_content_editing
|
||||
|
||||
# GET /contributions/other
|
||||
def index
|
||||
@content_title = EditableContent.find_or_create_by(
|
||||
path: "contributions/other", key: "title"
|
||||
)
|
||||
@content_body = EditableContent.find_or_create_by(
|
||||
path: "contributions/other", key: "body", rich_text: true
|
||||
)
|
||||
@current_section = :contributions
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_content_editing
|
||||
return unless params[:edit] && current_user.is_admin?
|
||||
@edit_content = true
|
||||
end
|
||||
end
|
||||
@@ -1,8 +0,0 @@
|
||||
class Contributions::ProjectsController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
|
||||
# GET /contributions
|
||||
def index
|
||||
@current_section = :contributions
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user