Remove unused code for some more comments

This commit is contained in:
Luka Murn 2016-11-22 14:52:43 +01:00
parent 1f7a8712fb
commit f5e286b1f6
6 changed files with 5 additions and 70 deletions

View file

@ -1,7 +1,7 @@
class MyModuleTagsController < ApplicationController class MyModuleTagsController < ApplicationController
before_action :load_vars before_action :load_vars
before_action :check_view_permissions, only: [:index_edit] 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] before_action :check_destroy_permissions, only: [:destroy]
def index_edit def index_edit
@ -22,12 +22,6 @@ class MyModuleTagsController < ApplicationController
end end
end end
def new
session[:return_to] ||= request.referer
@mt = MyModuleTag.new(my_module: @my_module)
init_gui
end
def create def create
@mt = MyModuleTag.new(mt_params.merge(my_module: @my_module)) @mt = MyModuleTag.new(mt_params.merge(my_module: @my_module))
@mt.created_by = current_user @mt.created_by = current_user

View file

@ -3,7 +3,7 @@ class MyModulesController < ApplicationController
include OrganizationsHelper include OrganizationsHelper
before_action :load_vars, only: [ before_action :load_vars, only: [
:show, :edit, :update, :destroy, :show, :update, :destroy,
:description, :due_date, :protocols, :results, :description, :due_date, :protocols, :results,
:samples, :activities, :activities_tab, :samples, :activities, :activities_tab,
:assign_samples, :unassign_samples, :assign_samples, :unassign_samples,
@ -11,7 +11,7 @@ class MyModulesController < ApplicationController
:samples_index, :archive] :samples_index, :archive]
before_action :load_vars_nested, only: [:new, :create] before_action :load_vars_nested, only: [:new, :create]
before_action :check_edit_permissions, only: [ 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_destroy_permissions, only: [:destroy]
before_action :check_view_info_permissions, only: [:show] before_action :check_view_info_permissions, only: [:show]
@ -34,7 +34,6 @@ class MyModulesController < ApplicationController
def show def show
respond_to do |format| respond_to do |format|
format.html
format.json { format.json {
render :json => { render :json => {
:html => render_to_string({ :html => render_to_string({
@ -131,10 +130,6 @@ class MyModulesController < ApplicationController
end end
end end
def edit
session[:return_to] ||= request.referer
end
def update def update
@my_module.assign_attributes(my_module_params) @my_module.assign_attributes(my_module_params)
@my_module.last_modified_by = current_user @my_module.last_modified_by = current_user
@ -192,11 +187,6 @@ class MyModulesController < ApplicationController
respond_to do |format| respond_to do |format|
if saved if saved
format.html {
flash[:success] = t("my_modules.update.success_flash",
module: @my_module.name)
redirect_to(:back)
}
format.json { format.json {
alerts = [] alerts = []
alerts << "alert-red" if @my_module.is_overdue? alerts << "alert-red" if @my_module.is_overdue?
@ -219,9 +209,6 @@ class MyModulesController < ApplicationController
} }
} }
else else
format.html {
render :edit
}
format.json { format.json {
render json: @my_module.errors, render json: @my_module.errors,
status: :unprocessable_entity status: :unprocessable_entity

View file

@ -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 { format.json {
render json: { render json: {
html: render_to_string( html: render_to_string(
@ -76,7 +70,6 @@ class ProjectCommentsController < ApplicationController
} }
else else
response.status = 400 response.status = 400
format.html { render :new }
format.json { format.json {
render json: { render json: {
errors: @comment.errors.to_hash(true) errors: @comment.errors.to_hash(true)

View file

@ -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 { format.json {
render json: { render json: {
html: render_to_string( html: render_to_string(
@ -75,7 +70,6 @@ class ResultCommentsController < ApplicationController
} }
else else
response.status = 400 response.status = 400
format.html { render :new }
format.json { format.json {
render json: { render json: {
errors: @comment.errors.to_hash(true) errors: @comment.errors.to_hash(true)

View file

@ -235,8 +235,6 @@ en:
page_title: "Project's experiments" page_title: "Project's experiments"
samples: samples:
head_title: "%{project} | Sample library" head_title: "%{project} | Sample library"
activities:
head_title: "%{project} | Activity"
reports: reports:
print_title: "%{project} | Report" print_title: "%{project} | Report"
index: index:
@ -443,27 +441,12 @@ en:
error_flash: "User %{user} not removed from project <strong>%{project}</strong>." error_flash: "User %{user} not removed from project <strong>%{project}</strong>."
my_modules: 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: description:
title: "Edit task %{module} description" title: "Edit task %{module} description"
label: "Description" label: "Description"
due_date: due_date:
title: "Edit task %{module} due date" title: "Edit task %{module} due date"
label: "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: samples:
head_title: "%{project} | %{module} | Sample library" head_title: "%{project} | %{module} | Sample library"
module_archive: module_archive:
@ -775,14 +758,6 @@ en:
success_flash: "Successfully removed tag <strong>%{tag}</strong>." success_flash: "Successfully removed tag <strong>%{tag}</strong>."
error_flash: "Could not remove 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: result_texts:
new: new:
head_title: "%{project} | %{module} | Add text result" head_title: "%{project} | %{module} | Add text result"
@ -1064,14 +1039,6 @@ en:
create: create:
success_flash: "Successfully added comment to step <strong>%{step}</strong>." 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: users:
enums: enums:
status: status:

View file

@ -171,8 +171,8 @@ Rails.application.routes.draw do
# Show action is a popup (JSON) for individual module in full-zoom canvas, # Show action is a popup (JSON) for individual module in full-zoom canvas,
# as well as "module info" page for single module (HTML) # as well as "module info" page for single module (HTML)
resources :my_modules, path: '/modules', only: [:show, :update, :destroy] do resources :my_modules, path: '/modules', only: [:show, :update] do
resources :my_module_tags, path: "/tags", only: [:index, :create, :update, :destroy] resources :my_module_tags, path: "/tags", only: [:index, :create, :destroy]
resources :user_my_modules, path: '/users', resources :user_my_modules, path: '/users',
only: [:index, :create, :destroy] only: [:index, :create, :destroy]
resources :my_module_comments, resources :my_module_comments,