-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from latis-sw/develop
Merge for 2.0.2
- Loading branch information
Showing
18 changed files
with
257 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class BatchDeleteController < ApplicationController | ||
def new | ||
@urls = Url | ||
.where(keyword: params[:keywords]) | ||
|
||
respond_to do |format| | ||
format.html | ||
format.js { render 'batch_delete/new', layout: false } | ||
end | ||
end | ||
|
||
def create | ||
Url.where(keyword: params[:keywords]).destroy_all | ||
respond_to do |format| | ||
format.js do | ||
redirect_to urls_path | ||
end | ||
# | ||
# respond_to do |format| | ||
# if | ||
# format.js do | ||
# redirect_to urls_path | ||
# end | ||
# else | ||
# format.js { render 'batch_delete/new', layout: false } | ||
# end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" ><span aria-hidden="true">×</span></button> | ||
<h4 class="modal-title" id="myModalLabel"><%= t('views.batch_delete.new.title')%> </h4> | ||
</div> | ||
<%= form_tag batch_delete_index_path, data: {remote: true}, id: 'batch_delete' do |f| %> | ||
<div class="modal-body"> | ||
<h5><%= t('views.batch_delete.new.urls_title')%></h4> | ||
<% @urls.map do |url| %> | ||
<dl class="padding-left-right"> | ||
<div> | ||
<span> | ||
<input type="hidden" name="keywords[]" value="<%= url.keyword %>"> | ||
<%= full_url(url) %> | ||
</span> | ||
</div> | ||
</dl> | ||
<br/> | ||
<% end %> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t('views.collection_moves.new.cancel') %></button> | ||
<input type="submit" class="btn btn-danger" value="<%= t('views.batch_delete.new.submit') %>" data-confirm="<%= t('views.batch_delete.new.submit_confirm') %>"> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$("#index-modal").html($("<%= escape_javascript(render(partial: 'batch_delete/new_modal')) %>")) | ||
$("#index-modal").modal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><%= t('views.application.nav.help') %> | ||
<span class="caret"></span></a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="<%= pages_path(page: :whats_new) %>"><%= t('views.application.nav.whatsnew') %></a></li> | ||
<li><a href="<%= faq_path %>"><%= t('views.application.nav.faq') %></a></li> | ||
<li><a href='mailto:[email protected]'><%= t('views.application.nav.contact_us') %></a></li> | ||
</ul> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class InvalidDataInterceptor | ||
def initialize(app) | ||
@app = app | ||
end | ||
|
||
def call(env) | ||
query = Rack::Utils.parse_nested_query(env['QUERY_STRING'].to_s) rescue :bad_query | ||
|
||
headers = { 'Content-Type' => 'text/plain' } | ||
|
||
if query == :bad_query | ||
[400, headers, ['Bad Request']] | ||
else | ||
@app.call(env) | ||
end | ||
end | ||
end |
Oops, something went wrong.