mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 11:57:16 +08:00
Remove unused code for some more comments
This commit is contained in:
parent
1f7a8712fb
commit
f5e286b1f6
6 changed files with 5 additions and 70 deletions
|
@ -1,7 +1,7 @@
|
|||
class MyModuleTagsController < ApplicationController
|
||||
before_action :load_vars
|
||||
before_action :check_view_permissions, only: [:index_edit]
|
||||
before_action :check_create_permissions, only: [:new, :create]
|
||||
before_action :check_create_permissions, only: [:create]
|
||||
before_action :check_destroy_permissions, only: [:destroy]
|
||||
|
||||
def index_edit
|
||||
|
@ -22,12 +22,6 @@ class MyModuleTagsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def new
|
||||
session[:return_to] ||= request.referer
|
||||
@mt = MyModuleTag.new(my_module: @my_module)
|
||||
init_gui
|
||||
end
|
||||
|
||||
def create
|
||||
@mt = MyModuleTag.new(mt_params.merge(my_module: @my_module))
|
||||
@mt.created_by = current_user
|
||||
|
|
|
@ -3,7 +3,7 @@ class MyModulesController < ApplicationController
|
|||
include OrganizationsHelper
|
||||
|
||||
before_action :load_vars, only: [
|
||||
:show, :edit, :update, :destroy,
|
||||
:show, :update, :destroy,
|
||||
:description, :due_date, :protocols, :results,
|
||||
:samples, :activities, :activities_tab,
|
||||
:assign_samples, :unassign_samples,
|
||||
|
@ -11,7 +11,7 @@ class MyModulesController < ApplicationController
|
|||
:samples_index, :archive]
|
||||
before_action :load_vars_nested, only: [:new, :create]
|
||||
before_action :check_edit_permissions, only: [
|
||||
:edit, :update, :description, :due_date
|
||||
:update, :description, :due_date
|
||||
]
|
||||
before_action :check_destroy_permissions, only: [:destroy]
|
||||
before_action :check_view_info_permissions, only: [:show]
|
||||
|
@ -34,7 +34,6 @@ class MyModulesController < ApplicationController
|
|||
|
||||
def show
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json {
|
||||
render :json => {
|
||||
:html => render_to_string({
|
||||
|
@ -131,10 +130,6 @@ class MyModulesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
session[:return_to] ||= request.referer
|
||||
end
|
||||
|
||||
def update
|
||||
@my_module.assign_attributes(my_module_params)
|
||||
@my_module.last_modified_by = current_user
|
||||
|
@ -192,11 +187,6 @@ class MyModulesController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
if saved
|
||||
format.html {
|
||||
flash[:success] = t("my_modules.update.success_flash",
|
||||
module: @my_module.name)
|
||||
redirect_to(:back)
|
||||
}
|
||||
format.json {
|
||||
alerts = []
|
||||
alerts << "alert-red" if @my_module.is_overdue?
|
||||
|
@ -219,9 +209,6 @@ class MyModulesController < ApplicationController
|
|||
}
|
||||
}
|
||||
else
|
||||
format.html {
|
||||
render :edit
|
||||
}
|
||||
format.json {
|
||||
render json: @my_module.errors,
|
||||
status: :unprocessable_entity
|
||||
|
|
|
@ -57,12 +57,6 @@ class ProjectCommentsController < ApplicationController
|
|||
)
|
||||
)
|
||||
|
||||
format.html {
|
||||
flash[:success] = t(
|
||||
"project_comments.create.success_flash",
|
||||
project: @project.name)
|
||||
redirect_to projects_path
|
||||
}
|
||||
format.json {
|
||||
render json: {
|
||||
html: render_to_string(
|
||||
|
@ -76,7 +70,6 @@ class ProjectCommentsController < ApplicationController
|
|||
}
|
||||
else
|
||||
response.status = 400
|
||||
format.html { render :new }
|
||||
format.json {
|
||||
render json: {
|
||||
errors: @comment.errors.to_hash(true)
|
||||
|
|
|
@ -56,11 +56,6 @@ class ResultCommentsController < ApplicationController
|
|||
)
|
||||
)
|
||||
|
||||
format.html {
|
||||
flash[:success] = t(
|
||||
"result_comments.create.success_flash")
|
||||
redirect_to session.delete(:return_to)
|
||||
}
|
||||
format.json {
|
||||
render json: {
|
||||
html: render_to_string(
|
||||
|
@ -75,7 +70,6 @@ class ResultCommentsController < ApplicationController
|
|||
}
|
||||
else
|
||||
response.status = 400
|
||||
format.html { render :new }
|
||||
format.json {
|
||||
render json: {
|
||||
errors: @comment.errors.to_hash(true)
|
||||
|
|
|
@ -235,8 +235,6 @@ en:
|
|||
page_title: "Project's experiments"
|
||||
samples:
|
||||
head_title: "%{project} | Sample library"
|
||||
activities:
|
||||
head_title: "%{project} | Activity"
|
||||
reports:
|
||||
print_title: "%{project} | Report"
|
||||
index:
|
||||
|
@ -443,27 +441,12 @@ en:
|
|||
error_flash: "User %{user} not removed from project <strong>%{project}</strong>."
|
||||
|
||||
my_modules:
|
||||
show:
|
||||
head_title: "%{project} | %{module}"
|
||||
archive_action: "Archive"
|
||||
archive_confirm_text: "All samples will be unassigned from the
|
||||
task when archiving. Are you sure to archive task?"
|
||||
edit:
|
||||
head_title: "%{project} | %{module} | Edit"
|
||||
title: "Edit task %{module}"
|
||||
name: "Task name"
|
||||
due_date: "Due date"
|
||||
save: "Save task"
|
||||
description:
|
||||
title: "Edit task %{module} description"
|
||||
label: "Description"
|
||||
due_date:
|
||||
title: "Edit task %{module} due date"
|
||||
label: "Due date"
|
||||
update:
|
||||
success_flash: "Successfully modified task <strong>%{module}</strong>."
|
||||
destroy:
|
||||
success_flash: "Successfully removed task <strong>%{module}</strong> from project <strong>%{project}</strong>."
|
||||
samples:
|
||||
head_title: "%{project} | %{module} | Sample library"
|
||||
module_archive:
|
||||
|
@ -775,14 +758,6 @@ en:
|
|||
success_flash: "Successfully removed tag <strong>%{tag}</strong>."
|
||||
error_flash: "Could not remove tag <strong>%{tag}</strong>."
|
||||
|
||||
project_comments:
|
||||
new:
|
||||
head_title: "%{project} | Add comment"
|
||||
title: "Add comment to project %{project}"
|
||||
create: "Add comment"
|
||||
create:
|
||||
success_flash: "Successfully added comment to project <strong>%{project}</strong>."
|
||||
|
||||
result_texts:
|
||||
new:
|
||||
head_title: "%{project} | %{module} | Add text result"
|
||||
|
@ -1064,14 +1039,6 @@ en:
|
|||
create:
|
||||
success_flash: "Successfully added comment to step <strong>%{step}</strong>."
|
||||
|
||||
result_comments:
|
||||
new:
|
||||
head_title: "%{project} | %{module} | Add comment to result"
|
||||
title: "Add comment to result"
|
||||
create: "Add comment"
|
||||
create:
|
||||
success_flash: "Successfully added comment to result."
|
||||
|
||||
users:
|
||||
enums:
|
||||
status:
|
||||
|
|
|
@ -171,8 +171,8 @@ Rails.application.routes.draw do
|
|||
|
||||
# Show action is a popup (JSON) for individual module in full-zoom canvas,
|
||||
# as well as "module info" page for single module (HTML)
|
||||
resources :my_modules, path: '/modules', only: [:show, :update, :destroy] do
|
||||
resources :my_module_tags, path: "/tags", only: [:index, :create, :update, :destroy]
|
||||
resources :my_modules, path: '/modules', only: [:show, :update] do
|
||||
resources :my_module_tags, path: "/tags", only: [:index, :create, :destroy]
|
||||
resources :user_my_modules, path: '/users',
|
||||
only: [:index, :create, :destroy]
|
||||
resources :my_module_comments,
|
||||
|
|
Loading…
Add table
Reference in a new issue