mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-04-02 10:20:51 +08:00
Finish removing new comment forms
This commit is contained in:
parent
595b213b1a
commit
008b31df0c
6 changed files with 7 additions and 38 deletions
app
controllers
my_module_comments_controller.rbproject_comments_controller.rbresult_comments_controller.rbstep_comments_controller.rb
views/step_comments
config
|
@ -1,7 +1,7 @@
|
|||
class MyModuleCommentsController < ApplicationController
|
||||
before_action :load_vars
|
||||
before_action :check_view_permissions, only: :index
|
||||
before_action :check_add_permissions, only: [:new, :create]
|
||||
before_action :check_add_permissions, only: [:create]
|
||||
before_action :check_edit_permissions, only: [:edit, :update]
|
||||
before_action :check_destroy_permissions, only: [:destroy]
|
||||
|
||||
|
@ -38,12 +38,6 @@ class MyModuleCommentsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@comment = Comment.new(
|
||||
user: current_user
|
||||
)
|
||||
end
|
||||
|
||||
def create
|
||||
@comment = Comment.new(
|
||||
message: comment_params[:message],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class ProjectCommentsController < ApplicationController
|
||||
before_action :load_vars
|
||||
before_action :check_view_permissions, only: :index
|
||||
before_action :check_add_permissions, only: [:new, :create]
|
||||
before_action :check_add_permissions, only: [:create]
|
||||
before_action :check_edit_permissions, only: [:edit, :update]
|
||||
before_action :check_destroy_permissions, only: [:destroy]
|
||||
|
||||
|
@ -37,12 +37,6 @@ class ProjectCommentsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@comment = Comment.new(
|
||||
user: current_user
|
||||
)
|
||||
end
|
||||
|
||||
def create
|
||||
@comment = Comment.new(
|
||||
message: comment_params[:message],
|
||||
|
|
|
@ -2,7 +2,7 @@ class ResultCommentsController < ApplicationController
|
|||
before_action :load_vars
|
||||
|
||||
before_action :check_view_permissions, only: [:index]
|
||||
before_action :check_add_permissions, only: [:new, :create]
|
||||
before_action :check_add_permissions, only: [:create]
|
||||
before_action :check_edit_permissions, only: [:edit, :update]
|
||||
before_action :check_destroy_permissions, only: [:destroy]
|
||||
|
||||
|
@ -35,12 +35,6 @@ class ResultCommentsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@comment = Comment.new(
|
||||
user: current_user
|
||||
)
|
||||
end
|
||||
|
||||
def create
|
||||
@comment = Comment.new(
|
||||
message: comment_params[:message],
|
||||
|
|
|
@ -2,7 +2,7 @@ class StepCommentsController < ApplicationController
|
|||
before_action :load_vars
|
||||
|
||||
before_action :check_view_permissions, only: [:index]
|
||||
before_action :check_add_permissions, only: [:new, :create]
|
||||
before_action :check_add_permissions, only: [:create]
|
||||
before_action :check_edit_permissions, only: [:edit, :update]
|
||||
before_action :check_destroy_permissions, only: [:destroy]
|
||||
|
||||
|
@ -34,12 +34,6 @@ class StepCommentsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@comment = Comment.new(
|
||||
user: current_user
|
||||
)
|
||||
end
|
||||
|
||||
def create
|
||||
@comment = Comment.new(
|
||||
message: comment_params[:message],
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<% provide(:head_title, raw(t("step_comments.new.head_title", project: @step.my_module.project.name, module: @step.my_module.name))) %>
|
||||
<h2><%=t "step_comments.new.title", step: (@step.position + 1).to_s %></h2>
|
||||
|
||||
<%= bootstrap_form_for [@step, @comment], url: step_step_comments_path do |f| %>
|
||||
<%= f.text_area :message, style: "margin-top: 10px;" %><br />
|
||||
<%= f.submit t("step_comments.new.create"), class: 'btn btn-primary' %>
|
||||
<% end %>
|
|
@ -77,7 +77,7 @@ Rails.application.routes.draw do
|
|||
resources :user_projects, path: "/users", only: [:new, :create, :index, :edit, :update, :destroy]
|
||||
resources :project_comments,
|
||||
path: '/comments',
|
||||
only: [:new, :create, :index, :edit, :update, :destroy]
|
||||
only: [:create, :index, :edit, :update, :destroy]
|
||||
# Activities popup (JSON) for individual project in projects index,
|
||||
# as well as all activities page for single project (HTML)
|
||||
resources :project_activities, path: "/activities", only: [:index]
|
||||
|
@ -175,7 +175,7 @@ Rails.application.routes.draw do
|
|||
resources :user_my_modules, path: "/users", only: [:index, :new, :create, :destroy]
|
||||
resources :my_module_comments,
|
||||
path: '/comments',
|
||||
only: [:index, :new, :create, :edit, :update, :destroy]
|
||||
only: [:index, :create, :edit, :update, :destroy]
|
||||
resources :sample_my_modules, path: "/samples_index", only: [:index]
|
||||
resources :result_texts, only: [:new, :create]
|
||||
resources :result_assets, only: [:new, :create]
|
||||
|
@ -217,7 +217,7 @@ Rails.application.routes.draw do
|
|||
resources :results, only: [:update, :destroy] do
|
||||
resources :result_comments,
|
||||
path: '/comments',
|
||||
only: [:new, :create, :index, :edit, :update, :destroy]
|
||||
only: [:create, :index, :edit, :update, :destroy]
|
||||
end
|
||||
|
||||
resources :samples, only: [:edit, :update, :destroy]
|
||||
|
|
Loading…
Add table
Reference in a new issue