snaptable 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/snaptable/_buttons.html.erb +18 -20
- data/app/views/snaptable/base.html.erb +4 -7
- data/app/views/snaptable/sort.js.erb +2 -1
- data/config/locales/en.yml +1 -1
- data/lib/snaptable/constructor/renderer.rb +2 -1
- data/lib/snaptable/constructor/sortable.rb +1 -1
- data/lib/snaptable/engine.rb +0 -4
- data/lib/snaptable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11ed98f7d34d0a9958c2b3e8ecebb97f6d96ae41
|
4
|
+
data.tar.gz: fadc6c8bb2d6968709836de1849a1fce7a6a68a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c7cd73a2c802bb2942e98ef8ac162267d47957c65c0b35acafdffe5b8aa4473f6dd4a53c3f03ebdfaa1327d39b58a448428498296151260ff55a847ef916725
|
7
|
+
data.tar.gz: 6d1927814485082fe9d1d45a2aff6aecb7fe9ed148a9df07efa87406e4812f2182f26e79fff3fee382d8e11cbd37ced29090be503e3d9bb3a88064ad72f16d29
|
@@ -1,20 +1,18 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
</p>
|
20
|
-
</div>
|
1
|
+
<p><%= t("table.buttons.title") %></p>
|
2
|
+
<p>
|
3
|
+
<% if add_button? %>
|
4
|
+
<%= link_to t("table.buttons.add"), request.path + "/new", class: "add" %>
|
5
|
+
<% end %>
|
6
|
+
<% if edit_button? %>
|
7
|
+
<a class="edit" href="#"><%= t("table.buttons.edit") %></a>
|
8
|
+
<% end %>
|
9
|
+
<% if show_button? %>
|
10
|
+
<a class="show" href="#"><%= t("table.buttons.show") %></a>
|
11
|
+
<% end %>
|
12
|
+
<% if delete_button? %>
|
13
|
+
<a class="delete" href="#" data-method="delete"
|
14
|
+
rel="nofollow" data-confirm="Etes-vous sûr de vouloir supprimer cette entrée ?">
|
15
|
+
<%= t("table.buttons.delete") %>
|
16
|
+
</a>
|
17
|
+
<% end %>
|
18
|
+
</p>
|
@@ -1,13 +1,10 @@
|
|
1
1
|
<div id="snaptable">
|
2
2
|
<%= render 'snaptable/search_field' if presenter.options[:search] == true %>
|
3
|
-
<%= render 'snaptable/buttons' unless presenter.options[:buttons] == false %>
|
4
|
-
|
5
|
-
<% if buttons %>
|
6
|
-
<div class="table_buttons">
|
7
|
-
<%= render buttons if buttons %>
|
8
|
-
</div>
|
9
|
-
<% end %>
|
10
3
|
|
4
|
+
<div class="table_buttons">
|
5
|
+
<%= render presenter.instance_variable_get(:@buttons) unless presenter.options[:buttons] == false %>
|
6
|
+
</div>
|
7
|
+
|
11
8
|
<table>
|
12
9
|
<thead>
|
13
10
|
<tr>
|
data/config/locales/en.yml
CHANGED
@@ -3,7 +3,8 @@ module Snaptable
|
|
3
3
|
module Renderer
|
4
4
|
|
5
5
|
def present(buttons: nil)
|
6
|
-
|
6
|
+
@buttons = buttons || "snaptable/buttons"
|
7
|
+
render_to_string('/snaptable/base', layout: false, locals: { presenter: self }).html_safe
|
7
8
|
end
|
8
9
|
|
9
10
|
def respond
|
@@ -4,7 +4,7 @@ module Snaptable
|
|
4
4
|
|
5
5
|
def sortable(column)
|
6
6
|
if model.reflect_on_association(column.gsub /_id/, '').nil?
|
7
|
-
view_context.link_to({sort: column, direction: direction(column), query: params[:query], page: page}, {remote: true, class: css_class(column)}) do
|
7
|
+
view_context.link_to({sort: column, direction: direction(column), query: params[:query], page: page, partial: @buttons}, {remote: true, class: css_class(column)}) do
|
8
8
|
model.human_attribute_name(column)
|
9
9
|
end
|
10
10
|
else
|
data/lib/snaptable/engine.rb
CHANGED
data/lib/snaptable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snaptable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khcr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|