templus_models 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35c83ffacd6f178669cfb6d43114cbd6ae787305
4
- data.tar.gz: d94154d77c68b597f8e36be9fd81336b158fc0e0
3
+ metadata.gz: f05fe347b6754ab181b55d2a1c2b664d0998700d
4
+ data.tar.gz: 5e7c69d642e70080dbffa76d7fc7302aa37f61f5
5
5
  SHA512:
6
- metadata.gz: c1a2c73e6a953712e4de0c0f78f90a4191a6f26182a999f04ab7850921c0a7bd658f31f4f86b929ace106ff3a6b7dfbfd112c443196a329c027b89fc7d2ad842
7
- data.tar.gz: 727bca49082fd25ff280a3752a099094ee16fde38e66648cc3c32e838730d755b06170c42dba40d313aebc137e189d8ee04bd8b16e4714ceff8725adb417fd28
6
+ metadata.gz: d9dc659f095c0ece74d165a71d569b8b1ab72afdc17ec7641ad1bf1dc2d8ad497c741de39f0d8fd46218a45df1fc6b711a0a846771ee5b5e8c3f4e39014795fe
7
+ data.tar.gz: c718ed02cbaae3c7ab28ef6e168a14a178f0732707ffce44b5b63de168b2cdd6e9d24d12483c98c5938c61cc6128f01caab8bbd038bc3c84d683d5d3aab40e67
@@ -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='icon-#{icon}'></i><span>#{nome}</span>".html_safe, url, data: {push: true, crumb: 'wielka'})
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
@@ -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
- <%=render_link(link)%>
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
- <% if is_action_edit? && @model.present?%>
33
- <h5>Editar
34
- <small> você pode editar todos os seus dados. <%=@model.name.humanize %></small>
35
- </h5>
36
- <% elsif is_action_create? && @model.present? %>
37
- <h5>Cadastrar
38
- <small> você pode cadastrar todos os seus dados. <%=@model.name.humanize %></small>
39
- </h5>
40
- <% elsif is_action_show? && @crud_helper.present? %>
41
- <h5><%= @crud_helper.subtitle(:show) %>
42
- <small><%= @crud_helper.description(:show) %></small>
43
- </h5>
44
- <% elsif @crud_helper.present? %>
45
- <h5><%= @crud_helper.subtitle(:index) %>
46
- <small><%= @crud_helper.description(:index) %></small>
47
- </h5>
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 %>
@@ -1,3 +1,3 @@
1
1
  module TemplusModels
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-04-28 00:00:00.000000000 Z
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.2.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