lazy_boy 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +32 -0
  5. data/lib/generators/lazy_boy/config_generator.rb +27 -0
  6. data/lib/generators/lazy_boy/templates/application/_breadcrumbs.html.haml +2 -0
  7. data/lib/generators/lazy_boy/templates/application/_footer.html.haml +0 -0
  8. data/lib/generators/lazy_boy/templates/application/_head.html.erb +18 -0
  9. data/lib/generators/lazy_boy/templates/application/_top_bar.html.haml +38 -0
  10. data/lib/generators/lazy_boy/templates/common.css.sass +240 -0
  11. data/lib/generators/lazy_boy/templates/kaminari/_first_page.html.erb +3 -0
  12. data/lib/generators/lazy_boy/templates/kaminari/_gap.html.erb +3 -0
  13. data/lib/generators/lazy_boy/templates/kaminari/_last_page.html.erb +3 -0
  14. data/lib/generators/lazy_boy/templates/kaminari/_next_page.html.erb +3 -0
  15. data/lib/generators/lazy_boy/templates/kaminari/_page.html.erb +3 -0
  16. data/lib/generators/lazy_boy/templates/kaminari/_paginator.html.erb +17 -0
  17. data/lib/generators/lazy_boy/templates/kaminari/_prev_page.html.erb +3 -0
  18. data/lib/generators/lazy_boy/templates/layouts/application.html.haml +34 -0
  19. data/lib/generators/lazy_boy/templates/layouts/modal.html.haml +40 -0
  20. data/lib/lazy_boy.rb +2 -0
  21. data/lib/lazy_boy/version.rb +3 -0
  22. data/lib/tasks/lazy_boy_tasks.rake +4 -0
  23. data/test/dummy/README.rdoc +28 -0
  24. data/test/dummy/Rakefile +6 -0
  25. data/test/dummy/app/assets/javascripts/application.js +13 -0
  26. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  27. data/test/dummy/app/controllers/application_controller.rb +5 -0
  28. data/test/dummy/app/helpers/application_helper.rb +2 -0
  29. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  30. data/test/dummy/bin/bundle +3 -0
  31. data/test/dummy/bin/rails +4 -0
  32. data/test/dummy/bin/rake +4 -0
  33. data/test/dummy/config.ru +4 -0
  34. data/test/dummy/config/application.rb +23 -0
  35. data/test/dummy/config/boot.rb +5 -0
  36. data/test/dummy/config/database.yml +25 -0
  37. data/test/dummy/config/environment.rb +5 -0
  38. data/test/dummy/config/environments/development.rb +37 -0
  39. data/test/dummy/config/environments/production.rb +78 -0
  40. data/test/dummy/config/environments/test.rb +39 -0
  41. data/test/dummy/config/initializers/assets.rb +8 -0
  42. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  43. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  44. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  45. data/test/dummy/config/initializers/inflections.rb +16 -0
  46. data/test/dummy/config/initializers/mime_types.rb +4 -0
  47. data/test/dummy/config/initializers/session_store.rb +3 -0
  48. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  49. data/test/dummy/config/locales/en.yml +23 -0
  50. data/test/dummy/config/routes.rb +56 -0
  51. data/test/dummy/config/secrets.yml +22 -0
  52. data/test/dummy/public/404.html +67 -0
  53. data/test/dummy/public/422.html +67 -0
  54. data/test/dummy/public/500.html +66 -0
  55. data/test/dummy/public/favicon.ico +0 -0
  56. data/test/lazy_boy_test.rb +7 -0
  57. data/test/test_helper.rb +15 -0
  58. metadata +291 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3ea72abf4bd994a4c19d1cf1ad76812f1ae677d7
4
+ data.tar.gz: 2bd3f055b2e30dadd7a9a7a27d02fe0b864d3a27
5
+ SHA512:
6
+ metadata.gz: ea4173983aaf27e345e8dd4a48dc5d866eab11eb8c91dcb33b19d13a14e47e95b0fe0230ca735b741c86faaa472bae2288d1758b307d80b43c35654eeed9d0b2
7
+ data.tar.gz: f04f80ec4177c7cb6805b6188752c5e4a6a5bb7866e8ae6519fb155aa1f163eba1dafda39f4ff8aa34840f34115e0d5f1112703e1dad6d8b87c930a08c9c54ca
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2014 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = LazyBoy
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'LazyBoy'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
22
+ require 'rake/testtask'
23
+
24
+ Rake::TestTask.new(:test) do |t|
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
29
+ end
30
+
31
+
32
+ task default: :test
@@ -0,0 +1,27 @@
1
+ module LazyBoy
2
+ module Generators
3
+ class ConfigGenerator < Rails::Generators::Base
4
+ source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
5
+
6
+ desc <<DESC
7
+ Description:
8
+ Copies a standard lazy template file to your application.
9
+ DESC
10
+
11
+ def copy_config_file
12
+ generate "kaminari:config", ""
13
+ generate "simple_form:install", ""
14
+ generate "simple_form:install", "--foundation"
15
+ generate "foundation:install", '--haml'
16
+ append_to_file "app/assets/javascripts/application#{detect_js_format[0]}", "\nrequire jquery-ui\n"
17
+ insert_into_file "app/assets/stylesheets/application#{detect_css_format[0]}", "\n#{detect_css_format[1]} require font-awesome\n", :after => "require_self"
18
+
19
+ directory 'layouts', 'app/views/layouts'
20
+ directory 'application', 'app/views/application'
21
+ directory 'kaminary', 'app/views/kaminary'
22
+ copy_file "common.css.sass", "app/assets/stylesheets/common.css.sass"
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,2 @@
1
+ %ul.breadcrumbs
2
+ = link_to fa_icon('th', text: t('title')), root_path
@@ -0,0 +1,18 @@
1
+ <head>
2
+ <meta charset="utf-8" />
3
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
4
+ <%= favicon_link_tag %>
5
+ <title>ISPRA | <%= t('title', scope: '') %> <%= ":: " + @title unless @title.blank? %></title>
6
+
7
+ <!--[if lt IE 9]>
8
+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
9
+ <script src="//s3.amazonaws.com/nwapi/nwmatcher/nwmatcher-1.2.5-min.js"></script>
10
+ <script src="//html5base.googlecode.com/svn-history/r38/trunk/js/selectivizr-1.0.3b.js"></script>
11
+ <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script>
12
+ <![endif]-->
13
+
14
+ <%= stylesheet_link_tag "application" %>
15
+ <%= javascript_include_tag "modernizr" %>
16
+ <%= javascript_include_tag "application" %>
17
+ <%= csrf_meta_tags %>
18
+ </head>
@@ -0,0 +1,38 @@
1
+ .row.collapse
2
+ .large-12.columns
3
+ %nav#nav-first.top-bar{data: {topbar: true}}
4
+ %ul.title-area
5
+ %li.name
6
+ %h1.primary= link_to( "ISPRA | "+t('title', scope: ''), root_path)
7
+ %li.toggle-topbar.menu-icon <a href=""><span>Menu</span></a>
8
+ %section.top-bar-section
9
+ %ul.right
10
+ = content_tag :li, link_to( current_user.label, home_user_path)
11
+ = content_tag :li, link_to( fa_icon('sign-out', text: 'Logout'), destroy_user_session_path, method: :delete)
12
+ %ul.left
13
+ %li= link_to( fa_icon('home', text: 'Home'), home_user_path)
14
+ - if current_user.secretary?
15
+ %li.has-dropdown
16
+ = link_to( fa_icon('calendar', text: t('manage', scope: 'event')), '#')
17
+ %ul.dropdown
18
+ %li= link_to( fa_icon('list-alt', text: t('summary', scope: 'event')), home_index_path)
19
+ %li= link_to( fa_icon('calendar', text: t('calendar', scope: 'event')), events_path)
20
+ %li= link_to( fa_icon('users', text: t('title', scope: 'user.index')), users_path)
21
+ %li.has-dropdown
22
+ = link_to( fa_icon('wrench', text: t('risk_and_category', scope: 'menu')), '#')
23
+ %ul.dropdown
24
+ %li= link_to( fa_icon('warning', text: t('title', scope: 'category')), categories_path)
25
+ %li= link_to( fa_icon('medkit', text: t('title', scope: 'risk')), risks_path)
26
+ - if current_user.doctor?
27
+ %li= link_to( fa_icon('download', text: t('new', scope: 'home.report')), home_report_path)
28
+ %li.has-dropdown
29
+ = link_to( fa_icon('question-circle', text: 'Help'), '#')
30
+ %ul.dropdown
31
+ %li.has-dropdown
32
+ = link_to( fa_icon('book', text: t('title', scope: 'home.books')), '#')
33
+ %ul.dropdown
34
+ %li= link_to( fa_icon('book', text: t('title', scope: 'home.books.user')), page_path('user_manual'))
35
+ %li= link_to( fa_icon('book', text: t('title', scope: 'home.books.editor')), page_path('secretary_manual')) if current_user.secretary?
36
+ %li= link_to( fa_icon('book', text: t('title', scope: 'home.books.admin')), page_path('doctor_manual')) if current_user.doctor?
37
+ %li= link_to( fa_icon('github', text: t('title', scope: 'home.versions')), page_path('changelog'))
38
+ %li= link_to( fa_icon("bug", text: t('home.help.title')) , 'https://intranet.isprambiente.it/giri/new/problem/sito-intranet-segreteria-medica', :target => "_blank")
@@ -0,0 +1,240 @@
1
+ nav.breadcrumbs
2
+ margin-bottom: 20px
3
+
4
+ h1.primary, h2.primary, h3.primary, h4.primary, h5.primary, h6.primary
5
+ background: $primary-color
6
+
7
+ a.button
8
+ line-height: 2rem
9
+ padding-top: 0px
10
+ padding-bottom: 0px
11
+
12
+ button.button
13
+ line-height: 1.9rem
14
+ padding-top: 0px
15
+ padding-bottom: 0px
16
+
17
+ .little
18
+ font-size: 80%
19
+
20
+ .list
21
+ .row
22
+ margin: 0px 0px 1px 0px
23
+ //line-height: 2.5rem
24
+ .first
25
+ padding-left: 0.5rem
26
+ .last
27
+ padding-right: 0.5rem
28
+ .categories
29
+ font-size: 80%
30
+ .switch-container
31
+ padding-top: 0.29rem
32
+ .switch
33
+ margin-bottom: 0px
34
+ input
35
+ margin-bottom: 0px
36
+ a.button
37
+ margin: 0px
38
+ line-height: 2.5rem
39
+ h5
40
+ color: $primary-color
41
+ margin: 16px 8px 4px 8px
42
+
43
+ .small-list
44
+ .row
45
+ margin: 0px 0px 1px 0px
46
+ line-height: 1.2rem
47
+ font-size: 80%
48
+
49
+ #users.list .first
50
+ padding-left: 1rem
51
+
52
+ body
53
+ min-width: 400px
54
+
55
+ ul.breadcrumbs
56
+ border-radius: 0px
57
+
58
+ p
59
+ margin-bottom: 0.5em
60
+
61
+ #content
62
+ padding-top: 0px
63
+
64
+ .dark
65
+ background: $dark-color
66
+
67
+ .light
68
+ background: transparent
69
+
70
+ .search_box
71
+ margin-bottom: $panel-margin-bottom
72
+ button.button.postfix.fa
73
+ margin: 0px
74
+ padding: 0px
75
+ border: 0px
76
+ input
77
+ margin: 0px
78
+ padding: 0px 5px 0px 5px
79
+ select
80
+ margin-bottom: 0px
81
+
82
+ .blacked
83
+ background: #444
84
+ color: #fff
85
+
86
+ .text-little
87
+ font-size: 80%
88
+
89
+ .text-big
90
+ font-size: 120%
91
+
92
+ .text-enfatize
93
+ font-weight: bold
94
+
95
+ span.primary
96
+ background: $primary-color
97
+ padding: 0em 0.5em
98
+ span.alert
99
+ background: $alert-color
100
+ padding: 0em 0.5em
101
+ span.alert-2
102
+ background: $alert-2-color
103
+ padding: 0em 0.5em
104
+ span.success
105
+ background: $success-color
106
+ padding: 0em 0.5em
107
+ span.blacked
108
+ background: #444
109
+ padding: 0em 0.5em
110
+
111
+ a.button.small
112
+ padding: 10px 0px
113
+
114
+
115
+ // panel
116
+
117
+ ul.like-side-nav
118
+ margin: $side-nav-list-margin
119
+ padding: $side-nav-padding
120
+ list-style: $side-nav-list-type
121
+ list-style-position: $side-nav-list-position
122
+ font-size: $side-nav-font-size
123
+ list-style-position: outside
124
+ li
125
+ margin: 0px
126
+ padding: 0.2em 0.5em
127
+ li.title
128
+ text-align: center
129
+ font-size: 80%
130
+ font-weight: bold
131
+ color: #fff
132
+ padding: 5px
133
+ background: #444
134
+ li:first-child.title
135
+ margin: -15px -1px 2px -1px
136
+ border-radius: $global-radius $global-radius 0px 0px
137
+ li.last
138
+ padding: 0em
139
+ margin-bottom: -1em
140
+ a.button
141
+ padding: 0.3em 0em
142
+ margin: 0px
143
+ width: 100%
144
+ border-radius: 0px 0px $global-radius $global-radius
145
+
146
+ // side nav
147
+
148
+ ul.side-nav
149
+ li.active
150
+ background: $secondary-color
151
+
152
+ ul.side-nav.panel
153
+ li
154
+ margin: 0px
155
+ padding: 0px
156
+ a
157
+ padding: 0.2em 0.5em
158
+ span.right
159
+ color: #000
160
+ a:hover
161
+ background: $panel-bg-hover
162
+
163
+ ul.side-nav li.title
164
+ text-align: center
165
+ font-size: 80%
166
+ font-weight: bold
167
+ color: #fff
168
+ padding: 5px
169
+ background: #444
170
+
171
+ ul.side-nav li:first-child.title
172
+ margin: -15px -1px 2px -1px
173
+ border-radius: $global-radius $global-radius 0px 0px
174
+
175
+ #modal_nav.top-bar
176
+ margin: -30px -30px 15px -30px
177
+ a.close-reveal-modal
178
+ position: static
179
+ font-size: 13px
180
+ line-height: 45px
181
+
182
+ // form
183
+ input#attachment_file.file.optional
184
+ border: 1px solid #ccc
185
+ margin-bottom: 0px
186
+
187
+ .data-field
188
+ .field-content:-moz-only-whitespace:after
189
+ content: '-'
190
+ .field-content
191
+ margin-bottom: 15px
192
+ line-height: 19px
193
+ border-bottom: 1px solid #ccc
194
+ background: #eee
195
+ padding-left: 5px
196
+
197
+ // table
198
+ table
199
+ table-layout: auto
200
+ width: 100%
201
+ border-collapse: collapse
202
+ thead
203
+ th
204
+ text-align: center
205
+ th.price, th.date, th.code
206
+ width: 1px
207
+ th.price
208
+ width: 110px
209
+ th.nop
210
+ padding: 0px
211
+ width: 45px
212
+ tbody
213
+ td.code
214
+ border-right: 1px solid #ddd
215
+ text-align: center
216
+ width: 105px
217
+ td.status
218
+ text-align: center
219
+ td.date
220
+ text-align: center
221
+ width: center
222
+ td.price
223
+ text-align: right
224
+ width: auto
225
+ td.nop
226
+ padding: 0px
227
+ a.button
228
+ margin: 0px
229
+ width: 45px
230
+ height: 45px
231
+ padding: 0px
232
+ line-height: 49px
233
+ a.button
234
+ margin-bottom: 0px
235
+ padding: 0px 3px
236
+
237
+ .fa-false:before
238
+ content: ""
239
+ .fa-true:before
240
+ content: ""
@@ -0,0 +1,3 @@
1
+ <li class='arrow'>
2
+ <%= link_to_unless current_page.first?, fa_icon('fast-backward'), url, :remote => remote %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li class="unavailable">
2
+ <%= link_to '...', '#' %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li>
2
+ <%= link_to_unless current_page.last?, fa_icon('fast-forward'), url, {:remote => remote} %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li>
2
+ <%= link_to_unless current_page.last?, fa_icon('forward'), url, :rel => 'next', :remote => remote %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li class="<%= 'current' if page.current? %>">
2
+ <%= link_to page, page.current? ? '#' : url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
3
+ </li>
@@ -0,0 +1,17 @@
1
+ <%= paginator.render do -%>
2
+ <div class="pagination-centered">
3
+ <ul class="pagination">
4
+ <%= first_page_tag unless current_page.first? %>
5
+ <%= prev_page_tag unless current_page.first? %>
6
+ <% each_page do |page| -%>
7
+ <% if page.left_outer? || page.right_outer? || page.inside_window? -%>
8
+ <%= page_tag page %>
9
+ <% elsif !page.was_truncated? -%>
10
+ <%= gap_tag %>
11
+ <% end -%>
12
+ <% end -%>
13
+ <%= next_page_tag unless current_page.last? %>
14
+ <%= last_page_tag unless current_page.last? %>
15
+ </ul>
16
+ </div>
17
+ <% end -%>