diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-05 21:52:56 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-05 21:52:56 +0200 |
| commit | d95947f9d738fd74d1fc16c6a1843b7f46bc0484 (patch) | |
| tree | 2e29cb5e60daa9bb5d7086cdb5f5c553dab3c0a6 /app/controllers | |
| parent | 9a7ce465b06462443ee82e8418f3c070de080ab2 (diff) | |
Whitespace fixes
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/admin_controller.rb | 4 | ||||
| -rw-r--r-- | app/controllers/nodes_controller.rb | 28 |
2 files changed, 16 insertions, 16 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index e0098b0..bfc6cd8 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | class AdminController < ApplicationController | 1 | class AdminController < ApplicationController |
| 2 | 2 | ||
| 3 | # Private | 3 | # Private |
| 4 | 4 | ||
| 5 | before_action :login_required | 5 | before_action :login_required |
| 6 | 6 | ||
| 7 | def index | 7 | def index |
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 1e1def2..380a659 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | class NodesController < ApplicationController | 1 | class NodesController < ApplicationController |
| 2 | 2 | ||
| 3 | # Private | 3 | # Private |
| 4 | 4 | ||
| 5 | layout 'admin' | 5 | layout 'admin' |
| 6 | 6 | ||
| 7 | before_action :login_required | 7 | before_action :login_required |
| 8 | before_action :find_node, :only => [ | 8 | before_action :find_node, :only => [ |
| 9 | :show, | 9 | :show, |
| 10 | :edit, | 10 | :edit, |
| 11 | :update, | 11 | :update, |
| 12 | :destroy, | 12 | :destroy, |
| 13 | :publish, | 13 | :publish, |
| 14 | :unlock | 14 | :unlock |
| @@ -27,10 +27,10 @@ class NodesController < ApplicationController | |||
| 27 | @parent_name = Node.find(@parent_id).title | 27 | @parent_name = Node.find(@parent_id).title |
| 28 | end | 28 | end |
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | def create | 31 | def create |
| 32 | params[:title] ||= "" | 32 | params[:title] ||= "" |
| 33 | 33 | ||
| 34 | @node = Node.new | 34 | @node = Node.new |
| 35 | @node.parent_id = find_parent | 35 | @node.parent_id = find_parent |
| 36 | @node.slug = slug_for(params[:title]) | 36 | @node.slug = slug_for(params[:title]) |
| @@ -49,7 +49,7 @@ class NodesController < ApplicationController | |||
| 49 | render :new | 49 | render :new |
| 50 | end | 50 | end |
| 51 | end | 51 | end |
| 52 | 52 | ||
| 53 | def show | 53 | def show |
| 54 | node = Node.find(params[:id]) | 54 | node = Node.find(params[:id]) |
| 55 | node.wipe_draft! | 55 | node.wipe_draft! |
| @@ -87,20 +87,20 @@ class NodesController < ApplicationController | |||
| 87 | def destroy | 87 | def destroy |
| 88 | @node.destroy | 88 | @node.destroy |
| 89 | end | 89 | end |
| 90 | 90 | ||
| 91 | def publish | 91 | def publish |
| 92 | @node.publish_draft! | 92 | @node.publish_draft! |
| 93 | flash[:notice] = "Draft has been published" | 93 | flash[:notice] = "Draft has been published" |
| 94 | redirect_to node_path(@node) | 94 | redirect_to node_path(@node) |
| 95 | end | 95 | end |
| 96 | 96 | ||
| 97 | def unlock | 97 | def unlock |
| 98 | if @node.unlock! | 98 | if @node.unlock! |
| 99 | flash[:notice] = "Node unlocked" | 99 | flash[:notice] = "Node unlocked" |
| 100 | else | 100 | else |
| 101 | flash[:notice] = "Already unlocked" | 101 | flash[:notice] = "Already unlocked" |
| 102 | end | 102 | end |
| 103 | 103 | ||
| 104 | redirect_to node_path(@node) | 104 | redirect_to node_path(@node) |
| 105 | end | 105 | end |
| 106 | 106 | ||
| @@ -121,11 +121,11 @@ class NodesController < ApplicationController | |||
| 121 | def page_params | 121 | def page_params |
| 122 | params.fetch(:page, {}).permit(:title, :abstract, :body, :template_name, :published_at, :user_id) | 122 | params.fetch(:page, {}).permit(:title, :abstract, :body, :template_name, :published_at, :user_id) |
| 123 | end | 123 | end |
| 124 | 124 | ||
| 125 | def find_node | 125 | def find_node |
| 126 | @node = Node.find(params[:id]) | 126 | @node = Node.find(params[:id]) |
| 127 | end | 127 | end |
| 128 | 128 | ||
| 129 | def find_parent | 129 | def find_parent |
| 130 | case params[:kind] | 130 | case params[:kind] |
| 131 | when "generic" | 131 | when "generic" |
