Merge pull request #902 from biosistemika/rails-5.1

Merge rails-5.1 into decoupling-settings-page
This commit is contained in:
Luka Murn 2017-12-07 09:25:11 +01:00 committed by GitHub
commit 86ac07c69f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 31 deletions

View file

@ -29,6 +29,8 @@
//= require nested_form_fields
//= require highlight.pack
//= require tinymce-jquery
//= require jsPlumb-2.0.4-min
//= require jsnetworkx
//= require_directory ./sitewide
//= require jquery.dataTables.yadcf
//= require datatables

View file

@ -25,6 +25,7 @@
})
.on("ajax:complete", function(){
animateSpinner(null, false);
$(id).find('.selectpicker').selectpicker();
});
}

View file

@ -46,7 +46,7 @@ class MyModuleTagsController < ApplicationController
respond_to do |format|
format.json do
redirect_to my_module_tags_edit_path(format: :json),
redirect_to my_module_tags_edit_path(format: :json), turbolinks: false,
status: 303
end
end
@ -58,7 +58,7 @@ class MyModuleTagsController < ApplicationController
respond_to do |format|
format.json do
redirect_to my_module_tags_edit_path(format: :json),
redirect_to my_module_tags_edit_path(format: :json), turbolinks: false,
status: 303
end
end

View file

@ -35,9 +35,13 @@ class TagsController < ApplicationController
flash[:success] = flash_success
redirect_to session.delete(:return_to)
}
format.json {
redirect_to my_module_tags_edit_path(params[:my_module_id], @tag, format: :json), :status => 303
}
format.json do
redirect_to my_module_tags_edit_path(params[:my_module_id],
@tag,
format: :json),
turbolinks: false,
status: 303
end
end
else
flash_error = t("tags.create.error_flash")
@ -46,10 +50,14 @@ class TagsController < ApplicationController
flash[:error] = flash_error
render :new
}
format.json {
format.json do
# TODO
redirect_to my_module_tags_edit_path(params[:my_module_id], @tag, format: :json), :status => 303
}
redirect_to my_module_tags_edit_path(params[:my_module_id],
@tag,
format: :json),
turbolinks: false,
status: 303
end
end
end
end
@ -59,9 +67,13 @@ class TagsController < ApplicationController
if @tag.update_attributes(tag_params)
respond_to do |format|
format.html
format.json {
redirect_to my_module_tags_edit_path(params[:my_module_id], @tag, format: :json), :status => 303
}
format.json do
redirect_to my_module_tags_edit_path(params[:my_module_id],
@tag,
format: :json),
turbolinks: false,
status: 303
end
end
else
respond_to do |format|
@ -84,9 +96,13 @@ class TagsController < ApplicationController
flash[:success] = flash_success
redirect_to root_path
}
format.json {
redirect_to my_module_tags_edit_path(params[:my_module_id], @tag, format: :json), :status => 303
}
format.json do
redirect_to my_module_tags_edit_path(params[:my_module_id],
@tag,
format: :json),
turbolinks: false,
status: 303
end
end
else
flash_error = t(
@ -98,10 +114,12 @@ class TagsController < ApplicationController
flash[:error] = flash_error
redirect_to root_path
}
format.json {
format.json do
# TODO
redirect_to my_module_tags_edit_path(format: :json), :status => 303
}
redirect_to my_module_tags_edit_path(format: :json),
turbolinks: false,
status: 303
end
end
end
end

View file

@ -94,9 +94,11 @@ class UserMyModulesController < ApplicationController
)
respond_to do |format|
format.json {
redirect_to my_module_users_edit_path(format: :json), :status => 303
}
format.json do
redirect_to my_module_users_edit_path(format: :json),
turbolinks: false,
status: 303
end
end
else
respond_to do |format|

View file

@ -66,9 +66,9 @@ class UserProjectsController < ApplicationController
)
respond_to do |format|
format.json {
redirect_to :action => :index_edit, :format => :json
}
format.json do
redirect_to project_users_edit_path(format: :json), turbolinks: false
end
end
else
error = t('user_projects.create.can_add_user_to_project')
@ -110,9 +110,9 @@ class UserProjectsController < ApplicationController
)
respond_to do |format|
format.json {
redirect_to :action => :index_edit, :format => :json
}
format.json do
redirect_to project_users_edit_path(format: :json), turbolinks: false
end
end
else
respond_to do |format|
@ -145,9 +145,11 @@ class UserProjectsController < ApplicationController
generate_notification(current_user, @up.user, false, false, @project)
respond_to do |format|
format.json {
redirect_to project_users_edit_path(format: :json), :status => 303
}
format.json do
redirect_to project_users_edit_path(format: :json),
turbolinks: false,
status: 303
end
end
else
respond_to do |format|

View file

@ -65,8 +65,6 @@
<%= render partial: "my_modules/modals/manage_module_tags_modal", locals: { my_module: nil } %>
<!-- Include all the neccesary JS libraries -->
<%= javascript_include_tag("jsPlumb-2.0.4-min") %>
<%= javascript_include_tag("jsnetworkx") %>
<%= javascript_include_tag("eventPause-min") %>
<%= javascript_include_tag("projects/canvas") %>