rails_admin_history_rollback 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6e20a8fab8465b8a087ad2c4c2488d8b5b1996d
4
- data.tar.gz: 4fd1ba4ff7ea0ffb40a28d89802aaa396f2c04dc
3
+ metadata.gz: 22e90d3b227acb55c2a5eba6bc4073ef41be1172
4
+ data.tar.gz: 59121658bc7eb3f812bde8864bcae64498db0dff
5
5
  SHA512:
6
- metadata.gz: 52bbbd2a7bd4194ba80d72ccbe312c763f5d9251f2c94c725521bbb2ddb70d935d2c8d00ad6aa6f7e69d212936263cee64c51d3ba5525fb4718471a5e7d5238a
7
- data.tar.gz: f4800ac9aa9bdc03b154d05d90e8ed352b693512616798b7ee40259cdc56883e82b2abd3ce820d2210df978eedd41d2748233a09e0f1b86d117c25af3bf3e2c9
6
+ metadata.gz: cd52324da788ae84e15be02b0f24170b5234a038729793018ab39af98dc099d88e1fa3368cbd06eda57e6696a8db1f9127f45764b88b8686c8a38291ddf2d422
7
+ data.tar.gz: cc20fe97527628ba2239595ee7231a4460659941fbc7f08fda3361faee4ef0a63e2a62b83bc335d781509114fd87b5497d5865fd0526ac962420653e250de249
@@ -49,10 +49,10 @@
49
49
  dialog.find('.cancel-action').unbind().click(function(){
50
50
  dialog.modal('hide');
51
51
  return false;
52
- }).html('Cancel');
52
+ }).html(table.data('cancel'));
53
53
 
54
54
  dialog.find('#version tr').prettyTextDiff();
55
- saveButton.attr('href', table.data('rollbackurl')).html('Rollback');
55
+ saveButton.attr('href', table.data('rollbackurl')).data('confirm', table.data('confirm')).html(table.data('rollback'));
56
56
  },
57
57
 
58
58
  _getModal: function() {
@@ -8,8 +8,8 @@
8
8
  %tr
9
9
  %th.shrink.user= t("admin.table_headers.username")
10
10
  %th.shrink.items= t("admin.table_headers.item")
11
- %th.changes= t("admin.table_headers.changes")
12
- %th.rollback= t("admin.table_headers.rollback")
11
+ %th.changes= t("admin.history_rollback.table_headers.changes")
12
+ %th.rollback= t("admin.history_rollback.table_headers.rollback")
13
13
  %tbody
14
14
  - @history.each do |t|
15
15
  - abstract_model = RailsAdmin.config(t.table).abstract_model
@@ -25,4 +25,4 @@
25
25
  - label = Object.const_defined?(t.table) ? t.table.constantize.model_name.human : t.table
26
26
  %td= "#{label} ##{t.item}"
27
27
  %td= t.message
28
- %td= link_to("View changes", "#", class: "changeset", :data => {:url => url_for(action: action(:history_index, abstract_model).action_name, model_name: abstract_model.to_param, version_id: t.version_id)})
28
+ %td= link_to(t("admin.history_rollback.table_headers.view_changes"), "#", class: "changeset", :data => {:url => url_for(action: action(:history_index, abstract_model).action_name, model_name: abstract_model.to_param, version_id: t.version_id)})
@@ -1,8 +1,8 @@
1
- %table#version.table.table-striped{:data => { :title => "#{@abstract_model} version ##{@version.index + 1} <small>[#{@version.event}]</small>", :rollbackurl => url_for(action: action(:history_index, @abstract_model).action_name, model_name: @abstract_model.to_param, version_id: @version.id)}}
1
+ %table#version.table.table-striped{:data => { :title => "#{@abstract_model} version ##{@version.index + 1} <small>[#{@version.event}]</small>", :rollbackurl => url_for(action: action(:history_index, @abstract_model).action_name, model_name: @abstract_model.to_param, version_id: @version.id), rollback: t("admin.history_rollback.table_headers.rollback"), cancel: t("admin.history_rollback.cancel"), confirm: t("admin.history_rollback.confirm")}}
2
2
  %thead
3
3
  %tr
4
- %th Field
5
- %th{:colspan => 3} Changes
4
+ %th= "#{t('admin.history_rollback.table_headers.field')}"
5
+ %th{:colspan => 3}= "#{t('admin.history_rollback.table_headers.changes')}"
6
6
  %tbody
7
7
  - @version.changeset.sort.each do |changes|
8
8
  %tr
@@ -26,7 +26,7 @@
26
26
  - columns << { property_name: "username", css_class: "username", link_text: t('admin.table_headers.username') }
27
27
  - columns << { property_name: "item", css_class: "item", link_text: t('admin.table_headers.item') } if @general
28
28
  - columns << { property_name: "message", css_class: "message", link_text: t('admin.table_headers.message') }
29
- - columns << { property_name: "rollback", css_class: "rollback", link_text: t('admin.table_headers.rollback') }
29
+ - columns << { property_name: "rollback", css_class: "rollback", link_text: t('admin.history_rollback.table_headers.rollback') }
30
30
 
31
31
  - columns.each do |column|
32
32
  - property_name = column[:property_name]
@@ -50,7 +50,7 @@
50
50
  - else
51
51
  %td= "#{@abstract_model.config.label} ##{object.item}"
52
52
  %td= object.message.in?(['delete', 'new']) ? t("admin.actions.#{object.message}.done").capitalize : object.message
53
- %td= link_to("View changes", "#", class: "changeset", :data => {:url => url_for(action: action(:history_index, @abstract_model).action_name, model_name: @abstract_model.to_param, version_id: object.version_id)})
53
+ %td= link_to(t("admin.history_rollback.table_headers.view_changes"), "#", class: "changeset", :data => {:url => url_for(action: action(:history_index, @abstract_model).action_name, model_name: @abstract_model.to_param, version_id: object.version_id)})
54
54
 
55
55
  - unless params[:all] || !@history.respond_to?(:current_page)
56
56
  = paginate(@history, theme: 'twitter-bootstrap', remote: true)
@@ -1,4 +1,10 @@
1
1
  en:
2
2
  admin:
3
- table_headers:
4
- rollback: "Rollback"
3
+ history_rollback:
4
+ cancel: "Cancel"
5
+ confirm: "Are you sure?"
6
+ table_headers:
7
+ changes: "Changes"
8
+ field: "Field"
9
+ rollback: "Rollback"
10
+ view_changes: "View changes"
@@ -0,0 +1,10 @@
1
+ en:
2
+ admin:
3
+ history_rollback:
4
+ cancel: "取消"
5
+ confirm: "确定要还原?"
6
+ table_headers:
7
+ changes: "变化"
8
+ field: "字段"
9
+ rollback: "还原"
10
+ view_changes: "查看"
@@ -1,3 +1,3 @@
1
1
  module RailsAdminHistoryRollback
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_history_rollback
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rikki Pitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-09 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -70,6 +70,7 @@ files:
70
70
  - app/views/rails_admin/main/_version.html.haml
71
71
  - app/views/rails_admin/main/history.html.haml
72
72
  - config/locales/history_rollback.en.yml
73
+ - config/locales/history_rollback.zh_cn.yml
73
74
  - lib/rails_admin_history_rollback.rb
74
75
  - lib/rails_admin_history_rollback/config/actions/history_index.rb
75
76
  - lib/rails_admin_history_rollback/engine.rb
@@ -95,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
96
  version: '0'
96
97
  requirements: []
97
98
  rubyforge_project:
98
- rubygems_version: 2.4.5
99
+ rubygems_version: 2.4.7
99
100
  signing_key:
100
101
  specification_version: 4
101
102
  summary: History rollback with paper_trail for rails_admin