activoate 0.5.0 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/app/assets/images/{activo-2 → activo}/arrow.png +0 -0
  2. data/app/assets/images/{activo-2 → activo}/avatar.png +0 -0
  3. data/app/assets/images/{activo-2 → activo}/bgd.jpg +0 -0
  4. data/app/assets/images/{activo-2 → activo}/boxbar-background.png +0 -0
  5. data/app/assets/images/{activo-2 → activo}/breadcrumb.png +0 -0
  6. data/app/assets/images/{activo-2 → activo}/button-background-active.png +0 -0
  7. data/app/assets/images/{activo-2 → activo}/button-background.png +0 -0
  8. data/app/assets/images/{activo-2 → activo}/icons/24/about-this-folder.txt +0 -0
  9. data/app/assets/images/{activo-2 → activo}/icons/24/anchor-hover.png +0 -0
  10. data/app/assets/images/{activo-2 → activo}/icons/24/anchor.png +0 -0
  11. data/app/assets/images/{activo-2 → activo}/icons/24/cross-hover.png +0 -0
  12. data/app/assets/images/{activo-2 → activo}/icons/24/cross.png +0 -0
  13. data/app/assets/images/{activo-2 → activo}/icons/24/download-hover.png +0 -0
  14. data/app/assets/images/{activo-2 → activo}/icons/24/download.png +0 -0
  15. data/app/assets/images/{activo-2 → activo}/icons/24/edit-hover.png +0 -0
  16. data/app/assets/images/{activo-2 → activo}/icons/24/edit.png +0 -0
  17. data/app/assets/images/{activo-2 → activo}/icons/24/export-hover.png +0 -0
  18. data/app/assets/images/{activo-2 → activo}/icons/24/export.png +0 -0
  19. data/app/assets/images/{activo-2 → activo}/icons/24/show-hover.png +0 -0
  20. data/app/assets/images/{activo-2 → activo}/icons/24/show.png +0 -0
  21. data/app/assets/images/{activo-2 → activo}/icons/about-this-folder.txt +0 -0
  22. data/app/assets/images/{activo-2 → activo}/icons/add.png +0 -0
  23. data/app/assets/images/{activo-2 → activo}/icons/application_edit.png +0 -0
  24. data/app/assets/images/{activo-2 → activo}/icons/calendar-hover.png +0 -0
  25. data/app/assets/images/{activo-2 → activo}/icons/calendar.png +0 -0
  26. data/app/assets/images/{activo-2 → activo}/icons/cross.png +0 -0
  27. data/app/assets/images/{activo-2 → activo}/icons/delete.png +0 -0
  28. data/app/assets/images/{activo-2 → activo}/icons/download.png +0 -0
  29. data/app/assets/images/{activo-2 → activo}/icons/edit.png +0 -0
  30. data/app/assets/images/{activo-2 → activo}/icons/key.png +0 -0
  31. data/app/assets/images/{activo-2 → activo}/icons/pdf.png +0 -0
  32. data/app/assets/images/{activo-2 → activo}/icons/search.png +0 -0
  33. data/app/assets/images/{activo-2 → activo}/icons/see-less.png +0 -0
  34. data/app/assets/images/{activo-2 → activo}/icons/see-more.png +0 -0
  35. data/app/assets/images/{activo-2 → activo}/icons/send-mail.png +0 -0
  36. data/app/assets/images/{activo-2 → activo}/icons/show.png +0 -0
  37. data/app/assets/images/{activo-2 → activo}/icons/tick.png +0 -0
  38. data/app/assets/images/{activo-2 → activo}/icons/upload.png +0 -0
  39. data/app/assets/images/{activo-2 → activo}/logo.png +0 -0
  40. data/app/assets/images/{activo-2 → activo}/messages/error.png +0 -0
  41. data/app/assets/images/{activo-2 → activo}/messages/notice.png +0 -0
  42. data/app/assets/images/{activo-2 → activo}/messages/warning.png +0 -0
  43. data/app/assets/images/{activo-2 → activo}/search-button.png +0 -0
  44. data/app/assets/images/{activo-2 → activo}/session/about-this-folder.txt +0 -0
  45. data/app/assets/images/{activo-2 → activo}/session/account.png +0 -0
  46. data/app/assets/images/{activo-2 → activo}/session/config.png +0 -0
  47. data/app/assets/images/{activo-2 → activo}/session/home.png +0 -0
  48. data/app/assets/images/{activo-2 → activo}/session/logout.png +0 -0
  49. data/app/assets/images/{activo-2 → activo}/tipsy/tipsy.gif +0 -0
  50. data/app/assets/images/{activo-2 → activo}/uniform/bg-input-focus.png +0 -0
  51. data/app/assets/images/{activo-2 → activo}/uniform/bg-input.png +0 -0
  52. data/app/assets/images/{activo-2 → activo}/uniform/sprite.png +0 -0
  53. data/app/assets/javascripts/{activo-2/activo-2.js → activo/activo.js} +0 -0
  54. data/app/assets/javascripts/{activo-2 → activo}/jquery.localscroll.js +0 -0
  55. data/app/assets/javascripts/{activo-2 → activo}/jquery.scrollTo.js +0 -0
  56. data/app/assets/javascripts/{activo-2 → activo}/jquery.tipsy.js +0 -0
  57. data/app/assets/javascripts/{activo-2 → activo}/jquery.uniform.min.js +0 -0
  58. data/app/assets/javascripts/activo.js.coffee +16 -0
  59. data/app/assets/stylesheets/{activo-2 → activo}/attrtastic_changes.sass +0 -0
  60. data/app/assets/stylesheets/{activo-2 → activo}/base.css +34 -14
  61. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museo700-regular-webfont.eot +0 -0
  62. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museo700-regular-webfont.svg +0 -0
  63. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museo700-regular-webfont.ttf +0 -0
  64. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museo700-regular-webfont.woff +0 -0
  65. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museosans_500-webfont.eot +0 -0
  66. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museosans_500-webfont.svg +0 -0
  67. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museosans_500-webfont.ttf +0 -0
  68. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museosans_500-webfont.woff +0 -0
  69. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museosans_500_italic-webfont.eot +0 -0
  70. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museosans_500_italic-webfont.svg +0 -0
  71. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museosans_500_italic-webfont.ttf +0 -0
  72. data/app/assets/stylesheets/{activo-2 → activo}/fonts/museosans_500_italic-webfont.woff +0 -0
  73. data/app/assets/stylesheets/{activo-2 → activo}/fonts.sass +0 -0
  74. data/app/assets/stylesheets/{activo-2 → activo}/formtastic_changes.sass +0 -0
  75. data/app/assets/stylesheets/{activo-2 → activo}/libs/jquery.tipsy.css +1 -1
  76. data/app/assets/stylesheets/{activo-2 → activo}/libs/uniform.default.css +4 -4
  77. data/app/assets/stylesheets/{activo-2 → activo}/mixins.sass +0 -0
  78. data/app/assets/stylesheets/{activo-2 → activo}/style.sass +15 -19
  79. data/app/assets/stylesheets/{activo-2.css → activo.css} +3 -3
  80. data/app/helpers/activo_helper.rb +38 -6
  81. data/lib/activoate/engine.rb +38 -0
  82. data/lib/activoate/version.rb +1 -1
  83. data/lib/generators/activoate/{activated/activated_generator.rb → activoated/activoated_generator.rb} +7 -5
  84. data/lib/generators/activoate/activoated/templates/view_edit.html.erb +15 -0
  85. data/lib/generators/activoate/activoated/templates/view_form.html.erb +13 -0
  86. data/lib/generators/activoate/activoated/templates/view_form_formtastic.html.erb +12 -0
  87. data/lib/generators/activoate/activoated/templates/view_new.html.erb +16 -0
  88. data/lib/generators/activoate/activoated/templates/view_show.html.erb +26 -0
  89. data/lib/generators/activoate/activoated/templates/view_show_attrtastic.html.erb +27 -0
  90. data/lib/generators/activoate/{activated → activoated}/templates/view_sidebar.html.erb +0 -0
  91. data/lib/generators/activoate/{activated → activoated}/templates/view_signin.html.erb +0 -0
  92. data/lib/generators/activoate/{activated → activoated}/templates/view_signup.html.erb +0 -0
  93. data/lib/generators/activoate/activoated/templates/view_tables.html.erb +61 -0
  94. data/lib/generators/activoate/{activated → activoated}/templates/view_text.html.erb +0 -0
  95. data/lib/generators/activoate/install/install_generator.rb +4 -3
  96. data/lib/generators/activoate/install/templates/layout_admin.html.erb +9 -6
  97. metadata +94 -97
  98. data/app/assets/images/activo-2/.DS_Store +0 -0
  99. data/app/assets/javascripts/activo-2.js +0 -10
  100. data/app/assets/stylesheets/activo-2/.DS_Store +0 -0
  101. data/app/assets/stylesheets/activo-2/fonts/.DS_Store +0 -0
  102. data/lib/generators/activoate/activated/templates/view_edit.html.erb +0 -17
  103. data/lib/generators/activoate/activated/templates/view_form.html.erb +0 -16
  104. data/lib/generators/activoate/activated/templates/view_form_formtastic.html.erb +0 -18
  105. data/lib/generators/activoate/activated/templates/view_new.html.erb +0 -16
  106. data/lib/generators/activoate/activated/templates/view_show.html.erb +0 -26
  107. data/lib/generators/activoate/activated/templates/view_show_attrtastic.html.erb +0 -27
  108. data/lib/generators/activoate/activated/templates/view_tables.html.erb +0 -56
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,16 @@
1
+ # This is a manifest file that'll be compiled into including all the files listed below.
2
+ # Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ # be included in the compiled file accessible from http:#example.com/assets/activo-2.js
4
+ # It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ # the compiled file.
6
+ #
7
+ #= require jquery
8
+ #= require jquery-ui
9
+ #= require jquery_ujs
10
+ #= require_tree ./activo
11
+ #= require_self
12
+
13
+ $(document).ready =>
14
+ $('#destroy-toggle').click ->
15
+ state = $(this).is(':checked')
16
+ $('[name="destroy[]"]').attr('checked', state)
@@ -1,5 +1,3 @@
1
- /** This is the original web-app-theme main stylesheet */
2
-
3
1
  * {margin:0;padding:0}
4
2
  .clear { clear: both; height: 0; }
5
3
 
@@ -177,7 +175,7 @@ body {
177
175
 
178
176
  /* pagination */
179
177
 
180
- .pagination a, .pagination span {
178
+ .pagination a, .pagination span, .pagination em {
181
179
  padding: 2px 5px;
182
180
  margin-right: 5px;
183
181
  display: block;
@@ -186,7 +184,7 @@ body {
186
184
  border-width: 1px;
187
185
  }
188
186
 
189
- .pagination span.current {
187
+ .pagination em {
190
188
  font-weight: bold;
191
189
  }
192
190
 
@@ -361,24 +359,33 @@ a.button:link, a.button:visited, a.button:hover, a.button:active, button.button
361
359
  background-color: #eee;
362
360
  border:1px solid #bfbfbf;
363
361
  font-size: 1em;
364
- line-height: 26px;
362
+ line-height: 1.3em;
365
363
  font-weight:bold;
366
364
  cursor:pointer;
365
+ padding:5px 10px 6px 7px;
367
366
  text-decoration: none;
368
- padding: 0 10px;
369
- height: 26px;
370
367
  }
371
368
 
372
369
  button.button {
373
- height: 28px;
370
+ width:auto;
371
+ overflow:visible;
372
+ padding:4px 10px 3px 7px; /* IE6 */
373
+ }
374
+ button.button[type] {
375
+ padding:5px 10px 5px 7px; /* Firefox */
376
+ line-height:17px; /* Safari */
374
377
  }
375
378
 
376
- .button img {
377
- vertical-align: middle;
378
- margin: 0 0 2px -3px;
379
- border: none;
380
- width: 16px;
381
- height: 16px;
379
+ *:first-child+html button.button[type] {
380
+ padding:4px 10px 3px 7px; /* IE7 */
381
+ }
382
+
383
+ button.button img, a.button img {
384
+ margin:0 3px -3px 0 !important;
385
+ padding:0;
386
+ border:none;
387
+ width:16px;
388
+ height:16px;
382
389
  }
383
390
 
384
391
  button.button:hover, a.button:hover {
@@ -387,4 +394,17 @@ button.button:hover, a.button:hover {
387
394
 
388
395
  button.button:active, a.button:active {
389
396
  background-color:#e5e5e5;
397
+ }
398
+ .text_button_padding{
399
+ color: #222222;
400
+ display: block;
401
+ float: left;
402
+ font-size: 1em;
403
+ line-height: 2em;
404
+ margin: 0 7px 0 0;
405
+ padding: 5px 0 6px 7px;
406
+ text-decoration: none;
407
+ }
408
+ .link_button{
409
+ cursor: pointer;
390
410
  }
@@ -1,6 +1,6 @@
1
1
  /** Stylesheet for the tooltips (jquery.tipsy) */
2
2
 
3
- .tipsy { padding: 5px; font-size: 12px; opacity: 0.8; filter: alpha(opacity=80); background-repeat: no-repeat; background-image: url('/assets/activo-2/tipsy/tipsy.gif'); }
3
+ .tipsy { padding: 5px; font-size: 12px; opacity: 0.8; filter: alpha(opacity=80); background-repeat: no-repeat; background-image: url('/assets/activo/tipsy/tipsy.gif'); }
4
4
  .tipsy-inner { padding: 5px 8px 4px 8px; background-color: black; color: white; max-width: 200px; text-align: center; }
5
5
  .tipsy-inner { -moz-border-radius:3px; -webkit-border-radius:3px; -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); }
6
6
  .tipsy-north { background-position: top center; }
@@ -23,7 +23,7 @@ div.uploader,
23
23
  div.uploader span.action,
24
24
  div.button,
25
25
  div.button span {
26
- background-image: url('/assets/activo-2/uniform/sprite.png');
26
+ background-image: url('/assets/activo/uniform/sprite.png');
27
27
  background-repeat: no-repeat;
28
28
  -webkit-font-smoothing: antialiased;
29
29
  }
@@ -53,8 +53,8 @@ textarea.uniform {
53
53
  font-weight: normal;
54
54
  padding: 3px;
55
55
  color: #777;
56
- background: url('/assets/activo-2/bg-input-focus.png') repeat-x 0px 0px;
57
- background: url('/assets/activo-2/bg-input.png') repeat-x 0px 0px;
56
+ background: url('/assets/activo/bg-input-focus.png') repeat-x 0px 0px;
57
+ background: url('/assets/activo/bg-input.png') repeat-x 0px 0px;
58
58
  border-top: solid 1px #aaa;
59
59
  border-left: solid 1px #aaa;
60
60
  border-bottom: solid 1px #ccc;
@@ -73,7 +73,7 @@ textarea.uniform:focus {
73
73
  -moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.3);
74
74
  box-shadow: 0px 0px 4px rgba(0,0,0,0.3);
75
75
  border-color: #999;
76
- background: url('/assets/activo-2/bg-input-focus.png') repeat-x 0px 0px;
76
+ background: url('/assets/activo/bg-input-focus.png') repeat-x 0px 0px;
77
77
  }
78
78
 
79
79
  /* SPRITES */
@@ -22,10 +22,6 @@
22
22
 
23
23
  /////////////////////// NOTICE ////////////////////////
24
24
 
25
- // Components included in this stylesheet that
26
- // don't exist in other activo-2 themes
27
- // ---------------------------------------------------
28
- //
29
25
  // #full-main (ocupa os 100% de width para
30
26
  // páginas que não têm barra lateral)
31
27
  // .flash .error-list
@@ -61,7 +57,7 @@ $yellow: #ffee79
61
57
 
62
58
  body
63
59
  color: $black_text
64
- background: #C4C4C4 url('/assets/activo-2/bgd.jpg')
60
+ background: #C4C4C4 url('/assets/activo/bgd.jpg')
65
61
  +font-normal-weight
66
62
 
67
63
  h1, h2, h3
@@ -89,7 +85,7 @@ hr
89
85
  width: 160px
90
86
  margin-top: 20px
91
87
  float: left
92
- background-image: url('/assets/activo-2/logo.png')
88
+ background-image: url('/assets/activo/logo.png')
93
89
  background-repeat: no-repeat
94
90
 
95
91
  h1
@@ -190,7 +186,7 @@ hr
190
186
  // TOP NAVIGATION
191
187
 
192
188
  .secondary-navigation
193
- background: #e0e0e0 url('/assets/activo-2/boxbar-background.png') top
189
+ background: #e0e0e0 url('/assets/activo/boxbar-background.png') top
194
190
  border-bottom-width: 0px
195
191
  @include rounded-corner(top, left, 6px)
196
192
  @include rounded-corner(top, right, 6px)
@@ -236,7 +232,7 @@ hr
236
232
 
237
233
  .secondary-inner-nav
238
234
  background-color: #f0eff0
239
- background-image: url('/assets/activo-2/boxbar-background.png')
235
+ background-image: url('/assets/activo/boxbar-background.png')
240
236
  font-size: 13px
241
237
 
242
238
  border-bottom-color: #fff
@@ -334,7 +330,7 @@ hr
334
330
  // sidebar list
335
331
  background-position: 0 11px
336
332
  background-repeat: no-repeat
337
- background-image: url('/assets/activo-2/arrow.png')
333
+ background-image: url('/assets/activo/arrow.png')
338
334
  border-bottom: 1px dashed #777
339
335
  list-style-type: none
340
336
  a
@@ -364,7 +360,7 @@ hr
364
360
  padding-top: 10px
365
361
  padding-left: 17px // distance to the image
366
362
  margin-right: 15px // space between elements
367
- background: url('/assets/activo-2/breadcrumb.png') no-repeat 0px 12px
363
+ background: url('/assets/activo/breadcrumb.png') no-repeat 0px 12px
368
364
  float: left
369
365
 
370
366
  a
@@ -396,7 +392,7 @@ hr
396
392
  min-width: 15px
397
393
  text-align: center
398
394
  background: $light_grey
399
- background-image: url('/assets/activo-2/button-background.png')
395
+ background-image: url('/assets/activo/button-background.png')
400
396
  color: $black_text
401
397
 
402
398
  a:hover
@@ -409,7 +405,7 @@ hr
409
405
  border: 1px solid $black
410
406
 
411
407
  .pagination a:active
412
- background-image: url('/assets/activo-2/button-background-active.png')
408
+ background-image: url('/assets/activo/button-background-active.png')
413
409
  outline: none /* hide dotted outline in Firefox */
414
410
 
415
411
 
@@ -499,7 +495,7 @@ hr
499
495
 
500
496
  .search_submit
501
497
  border: 0px
502
- background: transparent url('/assets/activo-2/search-button.png') no-repeat center left
498
+ background: transparent url('/assets/activo/search-button.png') no-repeat center left
503
499
  position: absolute
504
500
  left: 273px
505
501
  height: 25px
@@ -524,17 +520,17 @@ hr
524
520
 
525
521
  .error, .error-list
526
522
  border: 1px solid #993624 // rgba(0,0,0,.25)
527
- background: #CC4831 url('/assets/activo-2/messages/error.png') no-repeat 10px center
523
+ background: #CC4831 url('/assets/activo/messages/error.png') no-repeat 10px center
528
524
 
529
525
  .warning
530
526
  border: 1px solid #BB9004 // rgba(0,0,0,.25)
531
- background: #F9C006 url('/assets/activo-2/messages/warning.png') no-repeat 10px center
527
+ background: #F9C006 url('/assets/activo/messages/warning.png') no-repeat 10px center
532
528
 
533
529
  .notice
534
530
  color: #28485E
535
531
  text-shadow: 0 1px 0 rgba(255,255,255,.7)
536
532
  border: 1px solid #8A9DAA // rgba(0,0,0,.25)
537
- background: #B8D1E2 url('/assets/activo-2/messages/notice.png') no-repeat 10px center
533
+ background: #B8D1E2 url('/assets/activo/messages/notice.png') no-repeat 10px center
538
534
 
539
535
  .error-list
540
536
  text-align: left
@@ -587,7 +583,7 @@ ul.list li
587
583
  // BUTTONS
588
584
 
589
585
  a.button, button.button
590
- background: #EDEEED url('/assets/activo-2/button-background.png') top
586
+ background: #EDEEED url('/assets/activo/button-background.png') top
591
587
  border: 1px solid #c3c4ba
592
588
  +font-normal-weight
593
589
  @include rounded-corners(3px)
@@ -595,10 +591,10 @@ a.button, button.button
595
591
 
596
592
  &:link, &:visited, &:hover, &:active
597
593
  font-weight: normal
598
- background: #EDEEED url('/assets/activo-2/button-background.png') top
594
+ background: #EDEEED url('/assets/activo/button-background.png') top
599
595
 
600
596
  a.button:active, button.button:active
601
- background: #EAEAEA url('/assets/activo-2/button-background-active.png') top
597
+ background: #EAEAEA url('/assets/activo/button-background-active.png') top
602
598
  outline: none /* hide dotted outline in Firefox */
603
599
  margin-top: 1px
604
600
  margin-bottom: -1px
@@ -1,9 +1,9 @@
1
1
  /*
2
2
  * This css will include all web-app-theme css you need
3
3
  *
4
- *= require activo-2/base
5
- *= require activo-2/style
6
- *= require_tree ./activo-2/libs
4
+ *= require ./activo/base
5
+ *= require ./activo/style
6
+ *= require_tree ./activo/libs
7
7
  *= require_self
8
8
  */
9
9
 
@@ -33,6 +33,7 @@ module ActivoHelper
33
33
  end
34
34
  end
35
35
 
36
+
36
37
  # Wraps the button helper, creating an add button
37
38
  #
38
39
  # path - The button`s action
@@ -42,7 +43,19 @@ module ActivoHelper
42
43
  #
43
44
  # Returns an anchor tag
44
45
  def add_button(path)
45
- button(path, t("web-app-theme.add", :default => 'Add'), 'add')
46
+ button(path, t("activoated.add", :default => 'Add'), 'add')
47
+ end
48
+
49
+ # Wraps the button helper, creating a cancel button
50
+ #
51
+ # path - The button`s action
52
+ #
53
+ # Example:
54
+ # <%= cancel_button users_path %>
55
+ #
56
+ # Returns an anchor tag
57
+ def cancel_button(path)
58
+ button(path, t("activoated.cancel", :default => 'Cancel'), 'cross')
46
59
  end
47
60
 
48
61
  # Wraps the button helper, creating an edit button
@@ -56,7 +69,7 @@ module ActivoHelper
56
69
  #
57
70
  # Returns an anchor tag
58
71
  def edit_button(path, alternative_icon = false)
59
- button(path, t("web-app-theme.edit", :default => 'Edit'), alternative_icon ? 'edit' : 'application_edit')
72
+ button(path, t("activoated.edit", :default => 'Edit'), alternative_icon ? 'edit' : 'application_edit')
60
73
  end
61
74
 
62
75
  # Wraps the button helper, creating a delete button
@@ -71,10 +84,10 @@ module ActivoHelper
71
84
  # Returns an anchor tag
72
85
  def delete_button(path, alternative_icon = false)
73
86
  options = {
74
- :confirm => t("web-app-theme.confirm", :default => "Are you sure?"),
87
+ :confirm => t("activoated.confirm", :default => "Are you sure?"),
75
88
  :method => :delete
76
89
  }
77
- button(path, t("web-app-theme.delete", :default => 'Delete'), alternative_icon ? 'delete' : 'cross', options)
90
+ button(path, t("activoated.delete", :default => 'Delete'), alternative_icon ? 'delete' : 'cross', options)
78
91
  end
79
92
 
80
93
  # Displays a button
@@ -93,7 +106,26 @@ module ActivoHelper
93
106
  options = default_options.merge(options)
94
107
 
95
108
  link_to path, options do
96
- image_tag("activo-2/icons/#{icon}.png", :alt => caption) + " " + caption
109
+ image_tag("activo/icons/#{icon}.png", :alt => caption) + " " + caption
110
+ end
111
+ end
112
+
113
+ # Displays a submit button
114
+ #
115
+ # caption - The button`s caption
116
+ # icon - The icon file name, without the extension
117
+ # options - A hash of attributes to apply to the wrapping button tag
118
+ #
119
+ # Example:
120
+ # <%= submit_button root_path, { :caption => 'home', :icon => 'home' } %>
121
+ #
122
+ # Returns a button tag
123
+ def submit_button(caption = 'submit', icon = 'show', options = {})
124
+ default_options = { :class => "button", :type => 'submit' }
125
+ options = default_options.merge(options)
126
+
127
+ content_tag("button", options) do
128
+ image_tag("activo/icons/#{icon}.png", :alt => caption) + " " + caption
97
129
  end
98
130
  end
99
131
 
@@ -140,7 +172,7 @@ module ActivoHelper
140
172
 
141
173
  options[:alt] ||= name.capitalize.gsub("_", " ")
142
174
 
143
- path = "activo-2/icons/#{name}.png"
175
+ path = "activo/icons/#{name}.png"
144
176
 
145
177
  image_tag path, { :alt => options[:alt] }
146
178
  end
@@ -2,5 +2,43 @@ require 'rails'
2
2
 
3
3
  module Activoate
4
4
  class Engine < Rails::Engine
5
+
6
+ # Sets default values for the generators
7
+ initializer "generator default values" do |app|
8
+
9
+ # Have attrtastic?
10
+ begin
11
+ require 'attrtastic'
12
+ config.attrtastic = true
13
+ rescue LoadError
14
+ config.attrtastic = false
15
+ end
16
+
17
+ # Using haml?
18
+ begin
19
+ require 'haml'
20
+ config.engine = 'haml'
21
+ rescue LoadError
22
+ config.engine = 'erb'
23
+ end
24
+
25
+ # Using formtastic?
26
+ begin
27
+ require 'formtastic'
28
+ config.formtastic = true
29
+ rescue LoadError
30
+ config.formtastic = false
31
+ end
32
+
33
+ # Using will_paginate?
34
+ begin
35
+ require 'will_paginate'
36
+ config.will_paginate = true
37
+ rescue LoadError
38
+ config.will_paginate = false
39
+ end
40
+
41
+ end
42
+
5
43
  end
6
44
  end
@@ -1,3 +1,3 @@
1
1
  module Activoate
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.8"
3
3
  end
@@ -1,19 +1,21 @@
1
1
  require 'rails/generators/generated_attribute'
2
2
 
3
3
  module Activoate
4
- class ActivatedGenerator < Rails::Generators::Base
4
+ class ActivoatedGenerator < Rails::Generators::Base
5
5
  source_root File.expand_path('../templates', __FILE__)
6
6
 
7
7
  argument :controller_path, :type => :string
8
8
  argument :model_name, :type => :string, :required => false
9
9
 
10
10
  class_option :layout, :type => :string, :desc => 'Specify the layout name'
11
- class_option :engine, :type => :string, :default => 'erb', :desc => 'Specify the template engine'
12
- class_option :will_paginate, :type => :boolean, :default => false, :desc => 'Specify if you use will_paginate'
13
11
  class_option :themed_type, :type => :string, :default => 'crud', :desc => 'Specify the themed type, crud or text. Default is crud'
14
12
 
15
- class_option :formtastic, :type => :boolean, :default => false, :desc => 'Specify if you use formtastic'
16
- class_option :attrtastic, :type => :boolean, :default => false, :desc => 'Specify if you use attrtastic'
13
+ class_option :attrtastic, :type => :boolean, :default => Activoate::Engine.config.attrtastic, :desc => 'Specify if you use attrtastic'
14
+ class_option :engine, :type => :string, :default => Activoate::Engine.config.engine, :desc => 'Specify the template engine'
15
+ class_option :formtastic, :type => :boolean, :default => Activoate::Engine.config.formtastic, :desc => 'Specify if you use formtastic'
16
+ class_option :will_paginate, :type => :boolean, :default => Activoate::Engine.config.will_paginate, :desc => 'Specify if you use will_paginate'
17
+
18
+ class_option :mass_destroy, :type => :boolean, :default => false, :desc => 'Specify if you want to add mass destroy checkboxes on tables'
17
19
 
18
20
  def initialize(args, *options)
19
21
  super(args, *options)