templus_models 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/crud_helper.rb +2 -2
- data/app/raro_crud/raro_crud.rb +2 -1
- data/app/views/crud/_crud_template.html.erb +5 -1
- data/app/views/layouts/_template_raro_crud.html.erb +20 -16
- data/lib/templus_models/version.rb +1 -1
- metadata +3 -5
- data/test/dummy/tmp/pids/server.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f05fe347b6754ab181b55d2a1c2b664d0998700d
|
4
|
+
data.tar.gz: 5e7c69d642e70080dbffa76d7fc7302aa37f61f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9dc659f095c0ece74d165a71d569b8b1ab72afdc17ec7641ad1bf1dc2d8ad497c741de39f0d8fd46218a45df1fc6b711a0a846771ee5b5e8c3f4e39014795fe
|
7
|
+
data.tar.gz: c718ed02cbaae3c7ab28ef6e168a14a178f0732707ffce44b5b63de168b2cdd6e9d24d12483c98c5938c61cc6128f01caab8bbd038bc3c84d683d5d3aab40e67
|
data/app/helpers/crud_helper.rb
CHANGED
@@ -17,11 +17,11 @@ module CrudHelper
|
|
17
17
|
return @@cruds.include?(attribute.to_s)
|
18
18
|
end
|
19
19
|
|
20
|
-
def menu_helper_crud(modelo, url, nome, classe,icon='')
|
20
|
+
def menu_helper_crud(modelo, url, nome, classe, icon='')
|
21
21
|
if can?(:read, classe)
|
22
22
|
buffer = ""
|
23
23
|
buffer << "<li class='childreen #{controller.controller_name == 'crud' and params[:model] == modelo ? 'active' : '' }'>"
|
24
|
-
buffer << link_to("<i class='
|
24
|
+
buffer << link_to("<i class='#{icon}'></i><span>#{nome}</span>".html_safe, url, data: {push: true, crumb: 'wielka'})
|
25
25
|
buffer << "</li>"
|
26
26
|
buffer.html_safe
|
27
27
|
end
|
data/app/raro_crud/raro_crud.rb
CHANGED
@@ -165,7 +165,8 @@ class RaroCrud
|
|
165
165
|
data: {push: 'partial', target: '#form'},
|
166
166
|
icon: "fa fa-#{opts[:icon]}",
|
167
167
|
class: 'btn btn-small btn-primary btn-rounded',
|
168
|
-
link: "#{self.root_path}/#{opts[:link]}"
|
168
|
+
link: "#{self.root_path}/#{opts[:link]}",
|
169
|
+
can: opts[:can]
|
169
170
|
}
|
170
171
|
)
|
171
172
|
end
|
@@ -15,7 +15,11 @@
|
|
15
15
|
|
16
16
|
<% content_for :actions do %>
|
17
17
|
<% @crud_helper.top_links.each do |link| %>
|
18
|
-
|
18
|
+
<% if link[:can].present? %>
|
19
|
+
<%=render_link(link) if self.instance_eval &link[:can]%>
|
20
|
+
<% else %>
|
21
|
+
<%=render_link(link)%>
|
22
|
+
<% end %>
|
19
23
|
<%end%>
|
20
24
|
<% if @crud_helper.search_fields.present? %>
|
21
25
|
<button id="button_search_<%=@model.name.underscore%>" class="btn btn-warning btn-rounded" data-toggle="modal" data-target="#modal_search">
|
@@ -29,22 +29,26 @@
|
|
29
29
|
<div class="col-lg-12">
|
30
30
|
<div class="ibox float-e-margins">
|
31
31
|
<div class="ibox-title">
|
32
|
-
<%
|
33
|
-
|
34
|
-
<
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
<
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
<
|
47
|
-
|
32
|
+
<% unless content_for? :title %>
|
33
|
+
<% if is_action_edit? && @model.present?%>
|
34
|
+
<h5>Editar
|
35
|
+
<small> você pode editar todos os seus dados. <%=@model.name.humanize %></small>
|
36
|
+
</h5>
|
37
|
+
<% elsif is_action_create? && @model.present? %>
|
38
|
+
<h5>Cadastrar
|
39
|
+
<small> você pode cadastrar todos os seus dados. <%=@model.name.humanize %></small>
|
40
|
+
</h5>
|
41
|
+
<% elsif is_action_show? && @crud_helper.present? %>
|
42
|
+
<h5><%= @crud_helper.subtitle(:show) %>
|
43
|
+
<small><%= @crud_helper.description(:show) %></small>
|
44
|
+
</h5>
|
45
|
+
<% elsif @crud_helper.present? %>
|
46
|
+
<h5><%= @crud_helper.subtitle(:index) %>
|
47
|
+
<small><%= @crud_helper.description(:index) %></small>
|
48
|
+
</h5>
|
49
|
+
<% end %>
|
50
|
+
<% else %>
|
51
|
+
<%= yield :title %>
|
48
52
|
<% end %>
|
49
53
|
<div class="pull-right actions">
|
50
54
|
<% if content_for? :actions %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: templus_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Sol
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -405,7 +405,6 @@ files:
|
|
405
405
|
- test/dummy/tmp/cache/assets/development/sprockets/v3.0/yXXUoKEykhpZPMXWVzUf3GtTwgAtNSDCOK6TvomSdoM.cache
|
406
406
|
- test/dummy/tmp/cache/assets/development/sprockets/v3.0/zsJ7Mb8REasrj4nUuq6H0d0o74xxuUlQk7KtCJSdqMg.cache
|
407
407
|
- test/dummy/tmp/cache/assets/development/sprockets/v3.0/zwqXp6G2mEvMWMFcZeiFfb2jr3PymMGXDPQdfjBCrR0.cache
|
408
|
-
- test/dummy/tmp/pids/server.pid
|
409
408
|
- test/integration/navigation_test.rb
|
410
409
|
- test/lib/generators/crud_generator_test.rb
|
411
410
|
- test/templus_models_test.rb
|
@@ -430,7 +429,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
430
429
|
version: '0'
|
431
430
|
requirements: []
|
432
431
|
rubyforge_project:
|
433
|
-
rubygems_version: 2.
|
432
|
+
rubygems_version: 2.4.2
|
434
433
|
signing_key:
|
435
434
|
specification_version: 4
|
436
435
|
summary: Easy CRUD generator for Rails Projects
|
@@ -686,7 +685,6 @@ test_files:
|
|
686
685
|
- test/dummy/tmp/cache/assets/development/sprockets/v3.0/Z6u7GBxS_lJQoT58OLOlQ45pyYfRR9Cv3hTyfbLYbjw.cache
|
687
686
|
- test/dummy/tmp/cache/assets/development/sprockets/v3.0/zsJ7Mb8REasrj4nUuq6H0d0o74xxuUlQk7KtCJSdqMg.cache
|
688
687
|
- test/dummy/tmp/cache/assets/development/sprockets/v3.0/zwqXp6G2mEvMWMFcZeiFfb2jr3PymMGXDPQdfjBCrR0.cache
|
689
|
-
- test/dummy/tmp/pids/server.pid
|
690
688
|
- test/integration/navigation_test.rb
|
691
689
|
- test/lib/generators/crud_generator_test.rb
|
692
690
|
- test/templus_models_test.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
3853
|