Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Подтверждение удаления комментариев #7

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ group :assets do
gem 'therubyracer', :platforms => :ruby

gem 'uglifier', '>= 1.0.3'
gem 'i18n-js'
end

gem 'jquery-rails'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ GEM
hike (1.2.1)
httpauth (0.2.0)
i18n (0.6.1)
i18n-js (2.1.2)
i18n
journey (1.0.4)
jquery-rails (2.1.3)
railties (>= 3.1.0, < 5.0)
Expand Down Expand Up @@ -251,6 +253,7 @@ DEPENDENCIES
draper
factory_girl_rails
haml-rails
i18n-js
jquery-rails
js-routes
kaminari
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require i18n
//= require chosen-jquery
//= require jquery.query-2.1.7
//= require_tree .
Expand Down
6 changes: 4 additions & 2 deletions app/assets/javascripts/group_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ $(function(){
})

$(".del_selected").on("click", function(){
$(".group_actions input:checked")
.parents("tr").find(".del_msg").data("confirm", "").click()
if (confirm(I18n.t('js.are_you_sure'))) {
$(".group_actions input:checked")
.parents("tr").find(".del_msg").data("confirm", "").click()
}
});

$(".read_selected").on("click", function(){
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/i18n/translations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var I18n = I18n || {};
I18n.translations = {"en":{"js":{"are_you_sure":"Are you sure?"}},"ru":{"js":{"are_you_sure":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b?"}}};
1 change: 0 additions & 1 deletion app/views/web/mail_applications/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
.well

= link_to "#",
:data => { :confirm => t(:are_you_sure?) },
:class => "btn btn-danger del_selected" do
%i.icon-trash
= t("delete_selected")
Expand Down
3 changes: 3 additions & 0 deletions config/i18n-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
translations:
- file: 'app/assets/javascripts/i18n/translations.js'
only: '*.js'
3 changes: 3 additions & 0 deletions config/locales/en.javascripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
en:
js:
are_you_sure: "Are you sure?"
3 changes: 3 additions & 0 deletions config/locales/ru.javascripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ru:
js:
are_you_sure: "Вы уверены?"