loldesign_publisher 1.3.4 → 1.3.6

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: 3ece8ae5fa81e12b2d69712258a9083e53aef1d3
4
- data.tar.gz: 2089e68a41ea44715cc457197008f274efb1ddd5
3
+ metadata.gz: 5ebb9a91c2245335160aa0fc358454b28eaecb91
4
+ data.tar.gz: 2bf2dee7188e2ca5e42d555d2d9ffeed291ffdd8
5
5
  SHA512:
6
- metadata.gz: 7d68e78357899efc0f065d4b005b47dfe2f60417f7ab699514c66622d13c9b241fa944fad4d0de01f6750ddf351308f7312159c967e43e428890feec8fdea862
7
- data.tar.gz: cf01913a399b51c1bb637857ade484126e642b5709412b6fbdaeddb6028cf611245d0fd35e9002547c461fa49d71b73a8a371a51172e5d38e66eda4e7b692ece
6
+ metadata.gz: d8279becd20cdc2a16fb1a3d0ee392ea28765d55b6da45dabe8cda63e62a1771a71f3c9a1872faf255dc1e2b5d86614c1b06d00977fa1eac86c8b4ca24f1c072
7
+ data.tar.gz: 85fd3c31cabc40e1fbbabdd4bd7d764b7efb2ebfb8cec46b9126b7f5030c2b04cc3de93e81d8e5ff4189b0ade41516286278cb2a6692780aaf5a92a035ad0ca7
data/README.rdoc CHANGED
@@ -1,3 +1,192 @@
1
+ = Loldesign Publisher
2
+
3
+ == About
4
+ Loldesign Publisher gem has the feature to make changes to views in order to leave it more enjoyable, also providing a laterally administrative menu.
5
+ ---
6
+ === Getting Started
7
+ Open +Gemfile+ file and add gem to project:
8
+ gem "loldesign_publisher", github: 'loldesign/loldesign_publisher'
9
+
10
+ Run command:
11
+ $ bundle install
12
+ ---
13
+ === Installing
14
+ +Loldesign Publisher+ gem depends of configuration files that are not automatically
15
+ installed by default when you run the bundle install.
16
+
17
+ You must run the following command to
18
+ enable gem:
19
+ rails generate loldesign_publisher:install
20
+
21
+ Run the command above to make available the function that allows
22
+ to controllers inherit of LoldesignPublisher::PublisherController to
23
+ views use.
24
+ ---
25
+ === Customize the Left Menu
26
+ Will be available in the config folder the file: +loldesign_publisher.yml+
27
+
28
+ This file contains the following code:
29
+ paths:
30
+ logo: 'loldesign_publisher/logo.svg'
31
+ logout: 'javascript://'
32
+
33
+ menu_links:
34
+ banners:
35
+ name: 'Banner Home'
36
+ path: users_path
37
+ recipes:
38
+ name: 'Recipes'
39
+ path: recipes_path
40
+ schedules:
41
+ name: 'Schedule / Cources'
42
+ path: schedules_path
43
+
44
+ page_title: 'Loldesign Publisher'
45
+
46
+
47
+ * logo: 'loldesign_publisher/logo.svg', It is the path to image above the side menu
48
+ * logout: 'javascript://', Is used to end the session by default is disabled, to enable it is necessary to use the devise gem for user authentication.
49
+ * menu_links:, From menu_links are available blocks of code in which banners is the controller's name, but without the rest of the name, example: banners_controller.rb, the name is fictitious banners in your project, you must enter the corresponding names to their controllers.
50
+ * name: 'Banner Home', It's receive one of any name your choice for the menu link.
51
+ * path: users_path, Receives the route by which you want the link to answer.
52
+ * page_title: 'Loldesign Publisher', The string specified here will be the name that is displayed in the browser tab.
53
+
54
+ ---
55
+ === Enable Loldesign Publisher
56
+
57
+ Add to controller:
58
+ class NameOfController < LoldesignPublisher::PublisherController
59
+ ---
60
+ == Helpers
61
+ === Building Index Page
62
+ * Title
63
+ <%= title_page "Title of Page" %>
64
+ It is a function that takes a string as a parameter, a string is automatically formatted and aligned as the title of the page in question.
65
+ * Subtitle
66
+ subtitle: 'Subtitle of Page'
67
+ It's a minor title. It should be added in the same line as the title page, and separated only by commas.
68
+ * Add Resource
69
+ add_resource 'New Button', path_to_url
70
+ This helper create a button that lead the User to the desired path
71
+ * Implementing Table #1
72
+ <table class='table-page'> content of table </table>
73
+ This HTML tag when added to any table, causes it to be automatically formatted, both the HTML and CSS.
74
+ * Implementing Table #2
75
+ <%= display_list_for(@examples, fields: 5) %>
76
+ This ruby code list every registration, separate by lines, the part of the code @examples renders the partial +_example.html.erb+ from the controller and need to have the same name as the controller.
77
+ The parameter +fields+ with the number 5, is the number of fields in the table, even when there is not any, it merges the 5 existing columns or not, and displays the message "No records found".
78
+ * Implement Table #3 (partial)
79
+ Using the example given above.
80
+ Creates a button to edit the record
81
+ <%= edit_resource edit_example_path(example) %>
82
+ Creates a button to remove the record
83
+ <%= remove_resource(example_path(example), {})%>
84
+ ---
85
+ === Examples
86
+ These examples below uses the model establishment, and address the helper listed above previously.
87
+ ---Index.html.erb---
88
+ <%= title_page 'Estabelecimentos' %>
89
+ <%= add_resource 'Novo Estabelecimento', new_admin_establishment_path %>
90
+
91
+ <%= render partial: 'filters' %>
92
+
93
+ <table class='table-page'>
94
+ <thead>
95
+ <tr>
96
+ <th>Nome Fantasia</th>
97
+ <th>Situação</th>
98
+ <th>Tipo de Estabelecimento</th>
99
+ <th>Condição</th>
100
+ <th>&nbsp;</th>
101
+ </tr>
102
+ </thead>
103
+
104
+ <tbody>
105
+ <%= display_list_for(@establishments, fields: 5) %>
106
+ </tbody>
107
+ </table>
108
+
109
+ <%= will_paginate @establishments %>
110
+
111
+ ---
112
+ ---_establishment.html.erb---
113
+ <tr class="<%= !establishment.status ? 'selected' : ''%>">
114
+ <td><%= link_to establishment.fantasy_name, edit_admin_establishment_path(establishment), :class => "list-edit" %></td>
115
+ <td><%= establishment.status_text %></td>
116
+ <td><%= establishment.establishment_type_text %></td>
117
+ <td><%= establishment.aasm.human_state %></td>
118
+ <td>
119
+ <%= edit_resource edit_admin_establishment_path(establishment) %>
120
+ <%= remove_resource(admin_establishment_path(establishment), {})%>
121
+ </td>
122
+ </tr>
123
+ ---
124
+ == Building _form.html.erb
125
+ In the _form.html.erb we create a formulary with two or three columns, as we put the fields to be filled.
126
+ * simple_form_for
127
+ Within this ruby code goes all the contents of the form
128
+ <%= simple_form_for @establishment do |f| %>
129
+ content of form
130
+ <% end %>
131
+
132
+ * Section with two or three columns
133
+ Within this html tag goes article and fields necessary for the construction of _form.
134
+ <section class='three-columns'>
135
+ content of section
136
+ </section>
137
+
138
+ * Articles
139
+ Each article is one of the columns created by section
140
+ <article class='column'>
141
+ fields of the form
142
+ </article>
143
+
144
+ * Footer
145
+ The footer creates two buttons one to save and one to cancel the session.
146
+ <footer>
147
+ <%= submit_button f %>
148
+ <%= cancel_action :back %>
149
+ </footer>
150
+ ---
151
+ === Examples
152
+ Here is an code with the examples above:
153
+
154
+ <%= simple_form_for @user do |f| %>
155
+ <section class='three-columns'>
156
+ <article class='column'>
157
+ <%= f.input :name, label: false, placeholder: 'Nome' %>
158
+ <%= f.input :email, label: false, placeholder: 'E-mail' %>
159
+ <%= f.input :password, label: false, placeholder: 'Senha', input_html: {class: 'small'} %>
160
+ <%= f.input :active, label: 'Ativo' %>
161
+ </article>
162
+ <article class='column'>
163
+ <%= f.input :description, label: false, placeholder: 'Descrição' %>
164
+ </article>
165
+ <article class='column'>
166
+ <%= f.input :name, label: false, placeholder: 'Data', input_html: {class: 'date'}%>
167
+ <%= f.input :name, label: false, placeholder: 'CPF', input_html: {class: 'cpf'} %>
168
+ </article>
169
+ </section>
170
+
171
+ <footer>
172
+ <%= submit_button f %>
173
+ <%= cancel_action :back %>
174
+ </footer>
175
+ <% end -%>
176
+ ---
177
+ contiuar:
178
+ loldesign_publisher:install /
179
+ loldesign_publisher:mailer_config /
180
+ loldesign_publisher:views
181
+ ---
182
+ endereços uteis:
183
+ https://bitbucket.org/loldesign/loldesign_publisher/src/8aa1fd8d9650/app/?at=master
184
+ ---
185
+ https://bitbucket.org/loldesign/lol_crud_generator/src
186
+ ---
187
+
188
+
189
+
1
190
  = LoldesignPublisher
2
191
 
3
- This project rocks and uses MIT-LICENSE.
192
+ This project rocks and uses MIT-LICENSE.
@@ -1,8 +1,8 @@
1
1
  //= require ./libs/modernizr-2.6.2.min.js
2
2
  //= require jquery
3
3
  //= require jquery_ujs
4
- //= require jquery-ui/datepicker
5
- //= require ./libs/datepicker-pt-BR.js
4
+ //= require jquery-ui/widgets/datepicker
5
+ //= require jquery-ui/i18n/datepicker-pt-BR
6
6
  //= require ./libs/jquery.mask.min.js
7
7
  //= require ./libs/gumby
8
8
  //= require ./libs/ui/gumby.retina
@@ -52,7 +52,7 @@ var formatForm = function(){
52
52
  this.startup = function(){
53
53
  if(!this.$form[0]){ return false; }
54
54
 
55
- this.$form.find('input.tel').mask("(099) 9?9999-9999");
55
+ this.$form.find('input.tel').mask("(99) 9?9999-9999");
56
56
  this.$form.find('input.cep').mask("99999-999");
57
57
  this.$form.find('input.cpf').mask("999.999.999-99");
58
58
  this.$form.find('input.cnpj').mask("99.999.999/9999-99");
@@ -26,7 +26,7 @@ module LoldesignPublisher
26
26
  link_to(path){ gumby_icon 'info-circled' }
27
27
  end
28
28
 
29
- def remove_resource(path, options)
29
+ def remove_resource(path, options={})
30
30
  message = options[:message] || 'Você tem certeza que deseja remover?'
31
31
  type = options[:type] || :link
32
32
  text = options[:text] || 'Remover'
@@ -40,7 +40,8 @@ module LoldesignPublisher
40
40
  end
41
41
  end
42
42
 
43
- def cancel_action(path='javascript://')
43
+ def cancel_action(options={})
44
+ path = options[:path] || 'javascript://'
44
45
  default_button('Cancelar', path)
45
46
  end
46
47
 
@@ -93,9 +94,8 @@ module LoldesignPublisher
93
94
  check_box_tag resource, :active, resource.active, data: {resource: klass, id: resource.id}, class: 'activable'
94
95
  end
95
96
 
96
- private
97
97
  def gumby_icon(icon_name)
98
98
  content_tag :i, '', class: "icon-#{icon_name}"
99
99
  end
100
100
  end
101
- end
101
+ end
@@ -3,12 +3,11 @@ paths:
3
3
  logout: 'javascript://'
4
4
 
5
5
  menu_links:
6
- banners:
7
- name: 'Banner Home'
8
- path: users_path
9
- recipes:
10
- name: 'Receitas'
11
- schedules:
12
- name: 'Agenda / Cursos'
6
+ controller_01:
7
+ name: 'link_01'
8
+ path: path_01_path
9
+ controller_02:
10
+ name: 'link 02'
11
+ path: path_02_path
13
12
 
14
- page_title: 'Loldesign Publisher'
13
+ page_title: 'Loldesign Publisher'
@@ -1,3 +1,3 @@
1
1
  module LoldesignPublisher
2
- VERSION = "1.3.4"
2
+ VERSION = "1.3.6"
3
3
  end
data/public/grid.js CHANGED
@@ -53,16 +53,16 @@ Grid.toggle = function(event){
53
53
  $('#grid_back').toggle();
54
54
  }
55
55
 
56
- $(document).ready(function(){
57
- Grid();
58
- });
56
+ // $(document).ready(function(){
57
+ // Grid();
58
+ // });
59
59
 
60
- $(document).ready(function(){
61
- $('#contact a').last().click(function(){
62
- $(this).parent().hide();
63
- })
60
+ // $(document).ready(function(){
61
+ // $('#contact a').last().click(function(){
62
+ // $(this).parent().hide();
63
+ // })
64
64
 
65
- $(document).keydown(function(e) {
66
- if (e.keyCode == 27) { Grid.toggle(e) }
67
- })
68
- });
65
+ // $(document).keydown(function(e) {
66
+ // if (e.keyCode == 27) { Grid.toggle(e) }
67
+ // })
68
+ // });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loldesign_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Zaghi
@@ -11,160 +11,160 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-07-19 00:00:00.000000000 Z
14
+ date: 2017-07-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - '>='
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 4.1.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 4.1.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: modernizr-rails
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ~>
34
+ - - "~>"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.7.1
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ~>
41
+ - - "~>"
42
42
  - !ruby/object:Gem::Version
43
43
  version: 2.7.1
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: sass-rails
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - '>='
48
+ - - ">="
49
49
  - !ruby/object:Gem::Version
50
50
  version: 4.0.3
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - '>='
55
+ - - ">="
56
56
  - !ruby/object:Gem::Version
57
57
  version: 4.0.3
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simple_form
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ~>
62
+ - - "~>"
63
63
  - !ruby/object:Gem::Version
64
64
  version: '3.0'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ~>
69
+ - - "~>"
70
70
  - !ruby/object:Gem::Version
71
71
  version: '3.0'
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: jquery-rails
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - '>='
76
+ - - ">="
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: jquery-ui-rails
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - '>='
90
+ - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - '>='
97
+ - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: pry-rails
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - '>='
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  type: :development
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - '>='
111
+ - - ">="
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: rspec-rails
116
116
  requirement: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - '>='
118
+ - - ">="
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - '>='
125
+ - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: capybara
130
130
  requirement: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - '>='
132
+ - - ">="
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  type: :development
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - '>='
139
+ - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  - !ruby/object:Gem::Dependency
143
143
  name: factory_girl_rails
144
144
  requirement: !ruby/object:Gem::Requirement
145
145
  requirements:
146
- - - '>='
146
+ - - ">="
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  type: :development
150
150
  prerelease: false
151
151
  version_requirements: !ruby/object:Gem::Requirement
152
152
  requirements:
153
- - - '>='
153
+ - - ">="
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  - !ruby/object:Gem::Dependency
157
157
  name: sqlite3
158
158
  requirement: !ruby/object:Gem::Requirement
159
159
  requirements:
160
- - - '>='
160
+ - - ">="
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  type: :development
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - '>='
167
+ - - ">="
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  description: It's help us to develop publisher area on our projects.
@@ -1186,17 +1186,17 @@ require_paths:
1186
1186
  - lib
1187
1187
  required_ruby_version: !ruby/object:Gem::Requirement
1188
1188
  requirements:
1189
- - - '>='
1189
+ - - ">="
1190
1190
  - !ruby/object:Gem::Version
1191
1191
  version: '0'
1192
1192
  required_rubygems_version: !ruby/object:Gem::Requirement
1193
1193
  requirements:
1194
- - - '>='
1194
+ - - ">="
1195
1195
  - !ruby/object:Gem::Version
1196
1196
  version: '0'
1197
1197
  requirements: []
1198
1198
  rubyforge_project:
1199
- rubygems_version: 2.4.1
1199
+ rubygems_version: 2.4.5.1
1200
1200
  signing_key:
1201
1201
  specification_version: 4
1202
1202
  summary: Loldesign Publisher Gem