mdd 1.0.3 → 1.1.0
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.
- data/lib/generators/.DS_Store +0 -0
- data/lib/generators/mdd/sandbox/USAGE +9 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/icons/lupa.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_flat_10_000000_40x100.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_228ef1_256x240.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_ef8c08_256x240.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_ffd27a_256x240.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/javascripts/mdwa/template/ajaxloader.js +1 -1
- data/lib/generators/mdd/sandbox/templates/app/assets/javascripts/mdwa/template/all_pages.js +8 -2
- data/lib/generators/mdd/sandbox/templates/app/assets/stylesheets/jquery/jquery-ui-theme1.css +17 -17
- data/lib/generators/mdd/sandbox/templates/app/assets/stylesheets/jquery/jquery.fancybox.css +2 -2
- data/lib/generators/mdd/sandbox/templates/app/assets/stylesheets/mdwa/template/backend.css.erb +39 -3
- data/lib/generators/mdd/sandbox/templates/app/assets/stylesheets/mdwa/template/backend_base.css.erb +2 -0
- data/lib/generators/mdd/sandbox/templates/app/assets/stylesheets/mdwa/template/template.css.erb +5 -0
- data/lib/generators/mdd/sandbox/templates/app/views/a/administrators/_administrators.html.erb +2 -2
- data/lib/generators/mdd/sandbox/templates/app/views/a/administrators/edit.html.erb +8 -6
- data/lib/generators/mdd/sandbox/templates/app/views/a/administrators/index.html.erb +9 -7
- data/lib/generators/mdd/sandbox/templates/app/views/a/administrators/new.html.erb +8 -6
- data/lib/generators/mdd/sandbox/templates/config/initializers/devise.rb +2 -2
- data/lib/generators/mdd/sandbox/templates/config/locales/mdwa.en.yml +6 -0
- data/lib/generators/mdd/sandbox/templates/db/seeds/site.rb +1 -1
- data/lib/generators/mdd/scaffold/USAGE +9 -0
- data/lib/generators/mdd/scaffold/scaffold_generator.rb +115 -0
- data/lib/generators/mdd/scaffold/templates/.DS_Store +0 -0
- data/lib/generators/mdd/scaffold/templates/controllers/ajax_controller.rb +68 -0
- data/lib/generators/mdd/scaffold/templates/controllers/controller.rb +67 -0
- data/lib/generators/mdd/scaffold/templates/db_migrate/migrate.rb +18 -0
- data/lib/generators/mdd/scaffold/templates/models/model.rb +9 -0
- data/lib/generators/mdd/scaffold/templates/models/module.rb +2 -0
- data/lib/generators/mdd/scaffold/templates/views/_form.html.erb +36 -0
- data/lib/generators/mdd/scaffold/templates/views/_list.html.erb +20 -0
- data/lib/generators/mdd/scaffold/templates/views/create.js.erb +2 -0
- data/lib/generators/mdd/scaffold/templates/views/destroy.js.erb +1 -0
- data/lib/generators/mdd/scaffold/templates/views/edit.html.erb +9 -0
- data/lib/generators/mdd/scaffold/templates/views/index.html.erb +16 -0
- data/lib/generators/mdd/scaffold/templates/views/index.js.erb +1 -0
- data/lib/generators/mdd/scaffold/templates/views/new.html.erb +9 -0
- data/lib/generators/mdd/scaffold/templates/views/update.js.erb +2 -0
- data/lib/mdd.rb +4 -0
- data/lib/mdd/generators/model_attribute.rb +67 -0
- data/lib/mdd/version.rb +1 -1
- metadata +36 -2
Binary file
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Description:
|
2
|
+
This generator is similar to Rails scaffold.
|
3
|
+
It adds some tools to minimize the customization process.
|
4
|
+
For example, HTML code is within id elements to ease the CSS part.
|
5
|
+
All list have pagination with will_paginate gem.
|
6
|
+
Referenced models also have their relations configured in models and views.
|
7
|
+
|
8
|
+
Example:
|
9
|
+
rails generate mdd:scaffold Model name:string initial_date:date category_id:category:name:belongs
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/generators/mdd/sandbox/templates/app/assets/javascripts/mdwa/template/ajaxloader.js
CHANGED
@@ -2,7 +2,7 @@ $(function() {
|
|
2
2
|
|
3
3
|
$('body').append("<div id='ajax-loader'></div>");
|
4
4
|
$('#ajax-loader').css( {
|
5
|
-
'background': 'url(mdwa/ajax-loader.gif) no-repeat scroll 0 0 transparent',
|
5
|
+
'background': 'url(/assets/mdwa/ajax-loader.gif) no-repeat scroll 0 0 transparent',
|
6
6
|
'display': 'none',
|
7
7
|
'height': '42px',
|
8
8
|
'left': '50%',
|
@@ -1,19 +1,25 @@
|
|
1
1
|
$(function() {
|
2
2
|
|
3
|
-
//
|
3
|
+
// all .toggle links must have a rel attribute to identify what element will toggle
|
4
4
|
$('a.toggle').live('click', function() {
|
5
5
|
$($(this).attr('rel')).toggle();
|
6
6
|
});
|
7
7
|
|
8
|
-
//
|
8
|
+
// open modalbox
|
9
9
|
$('.lightbox').fancybox({
|
10
10
|
closeClick: false,
|
11
11
|
autoSize: true
|
12
12
|
});
|
13
13
|
|
14
|
+
// notices fadeout
|
14
15
|
$('a#system_notice_close, #system_notice').live('click', function() {
|
15
16
|
$('#system_notice').fadeOut();
|
16
17
|
});
|
18
|
+
|
19
|
+
// ajax forms cancel button closes modal window
|
20
|
+
$('.mdwa_ajax a.cancel').live('click', function() {
|
21
|
+
$.fancybox.close(true);
|
22
|
+
});
|
17
23
|
|
18
24
|
});
|
19
25
|
|
data/lib/generators/mdd/sandbox/templates/app/assets/stylesheets/jquery/jquery-ui-theme1.css
CHANGED
@@ -59,26 +59,26 @@
|
|
59
59
|
.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
|
60
60
|
.ui-widget .ui-widget { font-size: 1em; }
|
61
61
|
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
|
62
|
-
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(
|
62
|
+
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(/assets/mdwa/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
|
63
63
|
.ui-widget-content a { color: #333333; }
|
64
|
-
.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(
|
64
|
+
.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(/assets/mdwa/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
|
65
65
|
.ui-widget-header a { color: #ffffff; }
|
66
66
|
|
67
67
|
/* Interaction states
|
68
68
|
----------------------------------*/
|
69
|
-
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(
|
69
|
+
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(/assets/mdwa/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
|
70
70
|
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
|
71
|
-
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(
|
71
|
+
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(/assets/mdwa/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; }
|
72
72
|
.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
|
73
|
-
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(
|
73
|
+
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(/assets/mdwa/jquery-ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
|
74
74
|
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
|
75
75
|
.ui-widget :active { outline: none; }
|
76
76
|
|
77
77
|
/* Interaction Cues
|
78
78
|
----------------------------------*/
|
79
|
-
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(
|
79
|
+
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(/assets/mdwa/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }
|
80
80
|
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
81
|
-
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(
|
81
|
+
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(/assets/mdwa/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
|
82
82
|
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
|
83
83
|
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
|
84
84
|
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
@@ -89,14 +89,14 @@
|
|
89
89
|
----------------------------------*/
|
90
90
|
|
91
91
|
/* states and images */
|
92
|
-
.ui-icon { width: 16px; height: 16px; background-image: url(
|
93
|
-
.ui-widget-content .ui-icon {background-image: url(
|
94
|
-
.ui-widget-header .ui-icon {background-image: url(
|
95
|
-
.ui-state-default .ui-icon { background-image: url(
|
96
|
-
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(
|
97
|
-
.ui-state-active .ui-icon {background-image: url(
|
98
|
-
.ui-state-highlight .ui-icon {background-image: url(
|
99
|
-
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(
|
92
|
+
.ui-icon { width: 16px; height: 16px; background-image: url(/assets/mdwa/jquery-ui/ui-icons_222222_256x240.png); }
|
93
|
+
.ui-widget-content .ui-icon {background-image: url(/assets/mdwa/jquery-ui/ui-icons_222222_256x240.png); }
|
94
|
+
.ui-widget-header .ui-icon {background-image: url(/assets/mdwa/jquery-ui/ui-icons_ffffff_256x240.png); }
|
95
|
+
.ui-state-default .ui-icon { background-image: url(/assets/mdwa/jquery-ui/ui-icons_ef8c08_256x240.png); }
|
96
|
+
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(/assets/mdwa/jquery-ui/ui-icons_ef8c08_256x240.png); }
|
97
|
+
.ui-state-active .ui-icon {background-image: url(/assets/mdwa/jquery-ui/ui-icons_ef8c08_256x240.png); }
|
98
|
+
.ui-state-highlight .ui-icon {background-image: url(/assets/mdwa/jquery-ui/ui-icons_228ef1_256x240.png); }
|
99
|
+
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(/assets/mdwa/jquery-ui/ui-icons_ffd27a_256x240.png); }
|
100
100
|
|
101
101
|
/* positioning */
|
102
102
|
.ui-icon-carat-1-n { background-position: 0 0; }
|
@@ -291,8 +291,8 @@
|
|
291
291
|
.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
|
292
292
|
|
293
293
|
/* Overlays */
|
294
|
-
.ui-widget-overlay { background: #666666 url(
|
295
|
-
.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(
|
294
|
+
.ui-widget-overlay { background: #666666 url(/assets/mdwa/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
|
295
|
+
.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(/assets/mdwa/jquery-ui/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
|
296
296
|
* jQuery UI Resizable 1.8.11
|
297
297
|
*
|
298
298
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
@@ -84,14 +84,14 @@
|
|
84
84
|
margin-left: -21px;
|
85
85
|
width: 42px;
|
86
86
|
height: 42px;
|
87
|
-
background: url('
|
87
|
+
background: url('/assets/mdwa/fancybox_loading.gif');
|
88
88
|
opacity: 0.9;
|
89
89
|
cursor: pointer;
|
90
90
|
z-index: 1010;
|
91
91
|
}
|
92
92
|
|
93
93
|
.fancybox-close, .fancybox-prev span, .fancybox-next span {
|
94
|
-
background-image: url('
|
94
|
+
background-image: url('/assets/mdwa/fancybox_sprite.png');
|
95
95
|
}
|
96
96
|
|
97
97
|
.fancybox-close {
|
data/lib/generators/mdd/sandbox/templates/app/assets/stylesheets/mdwa/template/backend.css.erb
CHANGED
@@ -68,11 +68,20 @@ div.page_header_right_tab {
|
|
68
68
|
float: right;
|
69
69
|
position: relative;
|
70
70
|
right: 0;
|
71
|
-
top: -
|
71
|
+
top: -20px;
|
72
72
|
width: auto;
|
73
73
|
}
|
74
74
|
div.page_header_right_tab a {
|
75
|
-
|
75
|
+
|
76
|
+
background: #EEEEEE; /* Old browsers */
|
77
|
+
background: -moz-linear-gradient(top, #FFFFFF 0%, #EEEEEE 100%); /* FF3.6+ */
|
78
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#EEEEEE)); /* Chrome,Safari4+ */
|
79
|
+
background: -webkit-linear-gradient(top, #FFFFFF 0%,#EEEEEE 100%); /* Chrome10+,Safari5.1+ */
|
80
|
+
background: -o-linear-gradient(top, #FFFFFF 0%,#EEEEEE 100%); /* Opera 11.10+ */
|
81
|
+
background: -ms-linear-gradient(top, #FFFFFF 0%,#EEEEEE 100%); /* IE10+ */
|
82
|
+
background: linear-gradient(top, #FFFFFF 0%,#EEEEEE 100%); /* W3C */
|
83
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#EEEEEE',GradientType=0 ); /* IE6-9 */
|
84
|
+
|
76
85
|
padding: 13px;
|
77
86
|
border-radius: 5px 5px 0 0;
|
78
87
|
border-top: 1px solid #ccc;
|
@@ -80,7 +89,34 @@ div.page_header_right_tab a {
|
|
80
89
|
border-right: 1px solid #ccc;
|
81
90
|
}
|
82
91
|
div.page_header_right_tab a:hover {
|
83
|
-
background:
|
92
|
+
background: #eeeeee; /* Old browsers */
|
93
|
+
background: -moz-linear-gradient(top, #eeeeee 0%, #ffffff 100%); /* FF3.6+ */
|
94
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
|
95
|
+
background: -webkit-linear-gradient(top, #eeeeee 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
|
96
|
+
background: -o-linear-gradient(top, #eeeeee 0%,#ffffff 100%); /* Opera 11.10+ */
|
97
|
+
background: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 100%); /* IE10+ */
|
98
|
+
background: linear-gradient(top, #eeeeee 0%,#ffffff 100%); /* W3C */
|
99
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
|
100
|
+
}
|
101
|
+
|
102
|
+
div.tab_header {
|
103
|
+
display: inline-block;
|
104
|
+
float: right;
|
105
|
+
position: relative;
|
106
|
+
right: 0;
|
107
|
+
top: -14px;
|
108
|
+
width: auto;
|
109
|
+
}
|
110
|
+
div.tab_header a {
|
111
|
+
background: url(../images/bt_g.png);
|
112
|
+
padding: 13px;
|
113
|
+
border-radius: 5px 5px 0 0;
|
114
|
+
border-top: 1px solid #ccc;
|
115
|
+
border-left: 1px solid #ccc;
|
116
|
+
border-right: 1px solid #ccc;
|
117
|
+
}
|
118
|
+
div.tab_header a:hover {
|
119
|
+
background: url(../images/bt_g_inv.png);
|
84
120
|
}
|
85
121
|
|
86
122
|
/* Content */
|
data/lib/generators/mdd/sandbox/templates/app/assets/stylesheets/mdwa/template/backend_base.css.erb
CHANGED
@@ -24,6 +24,7 @@ div.field label {
|
|
24
24
|
|
25
25
|
div.field input[type="text"],
|
26
26
|
div.field input[type="email"],
|
27
|
+
div.field input[type="number"],
|
27
28
|
div.field input[type="password"] {
|
28
29
|
border: 1px solid #888;
|
29
30
|
padding: 4px;
|
@@ -33,6 +34,7 @@ div.field input[type="password"] {
|
|
33
34
|
|
34
35
|
div.field input[type="text"]:hover,
|
35
36
|
div.field input[type="email"]:hover,
|
37
|
+
div.field input[type="number"]:hover,
|
36
38
|
div.field input[type="password"]:hover {
|
37
39
|
border: 1px solid #666;
|
38
40
|
box-shadow: 0 0 2px #999;
|
data/lib/generators/mdd/sandbox/templates/app/views/a/administrators/_administrators.html.erb
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
<th><%= t 'administrators.index_id' %></th>
|
4
4
|
<th><%= t 'administrators.index_name' %></th>
|
5
5
|
<th><%= t 'administrators.index_email' %></th>
|
6
|
-
<th><%= t '
|
6
|
+
<th><%= t 'system.index_remove' %></th>
|
7
7
|
</thead>
|
8
8
|
<% @administrators.each do |administrator| %>
|
9
9
|
<tr class="<%= cycle 'odd_line', 'even_line' %>" >
|
10
10
|
<td align="center"><%= link_to administrator.id, edit_a_administrator_path(administrator) %></td>
|
11
11
|
<td><%= link_to administrator.name, edit_a_administrator_path(administrator) %></td>
|
12
12
|
<td><%= administrator.email %></td>
|
13
|
-
<td><%= link_to t('
|
13
|
+
<td><%= link_to t('system.index_remove_label'), [:a, administrator], :method => :delete, :confirm => t('system.index_confirm_deletion') %></td>
|
14
14
|
</tr>
|
15
15
|
<% end %>
|
16
16
|
</table>
|
@@ -1,7 +1,9 @@
|
|
1
|
-
<div class="
|
2
|
-
<
|
3
|
-
|
1
|
+
<div id="administrators_edit" class="mdwa_edit">
|
2
|
+
<div class="page_header">
|
3
|
+
<h1><%= t('administrators.edit_title', :name => @administrator.email) %></h1>
|
4
|
+
</div>
|
4
5
|
|
5
|
-
<div class="inside">
|
6
|
-
|
7
|
-
</div>
|
6
|
+
<div class="inside">
|
7
|
+
<%= render 'form' %>
|
8
|
+
</div>
|
9
|
+
</div>
|
@@ -1,9 +1,11 @@
|
|
1
|
-
<div class="
|
2
|
-
<
|
3
|
-
|
1
|
+
<div id="administrators_index" class="mdwa_index">
|
2
|
+
<div class="page_header">
|
3
|
+
<h1><%= t 'administrators.index_title' %></h1>
|
4
|
+
</div>
|
4
5
|
|
5
|
-
<div class="inside">
|
6
|
-
|
7
|
-
|
6
|
+
<div class="inside">
|
7
|
+
<div id="administrators_list">
|
8
|
+
<%= render 'administrators' %>
|
9
|
+
</div>
|
8
10
|
</div>
|
9
|
-
</div>
|
11
|
+
</div>
|
@@ -1,7 +1,9 @@
|
|
1
|
-
<div class="
|
2
|
-
<
|
3
|
-
|
1
|
+
<div id="administrators_new" class="mdwa_new">
|
2
|
+
<div class="page_header">
|
3
|
+
<h1><%= t 'administrators.new_title' %></h1>
|
4
|
+
</div>
|
4
5
|
|
5
|
-
<div class="inside">
|
6
|
-
|
7
|
-
</div>
|
6
|
+
<div class="inside">
|
7
|
+
<%= render 'form' %>
|
8
|
+
</div>
|
9
|
+
</div>
|
@@ -10,7 +10,7 @@ Devise.setup do |config|
|
|
10
10
|
# config.mailer = "Devise::Mailer"
|
11
11
|
|
12
12
|
# Automatically apply schema changes in tableless databases
|
13
|
-
config.apply_schema = false
|
13
|
+
# config.apply_schema = false
|
14
14
|
|
15
15
|
# ==> ORM configuration
|
16
16
|
# Load and configure the ORM. Supports :active_record (default) and
|
@@ -113,7 +113,7 @@ Devise.setup do |config|
|
|
113
113
|
|
114
114
|
# If true, uses the password salt as remember token. This should be turned
|
115
115
|
# to false if you are not using database authenticatable.
|
116
|
-
config.use_salt_as_remember_token = true
|
116
|
+
# config.use_salt_as_remember_token = true
|
117
117
|
|
118
118
|
# Options to be passed to the created cookie. For instance, you can set
|
119
119
|
# :secure => true in order to force SSL only cookies.
|
@@ -11,6 +11,12 @@ en:
|
|
11
11
|
logged_info_logout: "(Logout)"
|
12
12
|
logged_info_edit_account: "My Account"
|
13
13
|
cancel_button: "Cancel"
|
14
|
+
index_id: "ID"
|
15
|
+
index_remove: "Remove"
|
16
|
+
index_remove_label: "Remove"
|
17
|
+
index_confirm_deletion: "Are you sure?"
|
18
|
+
add_by_ajax: "Add new %{name}"
|
19
|
+
edit_by_ajax: "Edit %{name}"
|
14
20
|
|
15
21
|
administrators:
|
16
22
|
edit_title: "Editing account: %{name}"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
if Administrator.count
|
2
|
+
if Administrator.count.zero?
|
3
3
|
Permission.create( :name => "SuperAdmin" ) if Permission.find_by_name("SuperAdmin").nil?
|
4
4
|
Administrator.create :name => "Administrator", :email => 'admin@admin.com', :password => 'admin123', :password_confirmation => 'admin123'
|
5
5
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Description:
|
2
|
+
This generator is similar to Rails scaffold.
|
3
|
+
It adds some tools to minimize the customization process.
|
4
|
+
For example, HTML code is within id elements to ease the CSS part.
|
5
|
+
All list have pagination with will_paginate gem.
|
6
|
+
Referenced models also have their relations configured in models and views.
|
7
|
+
|
8
|
+
Example:
|
9
|
+
rails generate mdd:scaffold Model name:string initial_date:date category_id:category:name:belongs
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require 'rails/generators/migration'
|
2
|
+
|
3
|
+
module Mdd
|
4
|
+
|
5
|
+
class ScaffoldGenerator < Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
|
8
|
+
source_root File.expand_path('../templates', __FILE__)
|
9
|
+
|
10
|
+
attr_accessor :namespace, :model_name, :model_attributes
|
11
|
+
|
12
|
+
argument :scaffold_name, :type => :string, :banner => "[namespace]/Model"
|
13
|
+
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
|
14
|
+
|
15
|
+
class_option :skip_migration, :desc => 'Skips the generation of a new migration', :type => :boolean
|
16
|
+
class_option :ajax, :desc => 'Generates modal forms and AJAX submits', :type => :boolean
|
17
|
+
|
18
|
+
def initialize(*args, &block)
|
19
|
+
|
20
|
+
super
|
21
|
+
|
22
|
+
# separates model and namespace
|
23
|
+
@namespace = ''
|
24
|
+
@namespace = scaffold_name.split('/').first.camelize if scaffold_name.split('/').count > 1
|
25
|
+
@model_name = scaffold_name.split('/').last.singularize.camelize
|
26
|
+
|
27
|
+
# model_name is not valid
|
28
|
+
print_usage unless @model_name.underscore =~ /^[a-z][a-z0-9_\/]+$/
|
29
|
+
|
30
|
+
# sets the model attributes
|
31
|
+
@model_attributes = []
|
32
|
+
attributes.each do |attribute|
|
33
|
+
@model_attributes << Generators::ModelAttribute.new( attribute )
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def controller
|
38
|
+
@inherit_controller = 'A::BackendController' if @namespace.underscore == 'a'
|
39
|
+
template "controllers/#{'ajax_' if options.ajax}controller.rb", "app/controllers/#{@namespace}/#{plural_name}_controller.rb"
|
40
|
+
end
|
41
|
+
|
42
|
+
def model
|
43
|
+
template 'models/module.rb', "app/models/#{@namespace.underscore}.rb" unless @namespace.blank?
|
44
|
+
template 'models/model.rb', "app/models/#{@namespace.underscore}/#{singular_name}.rb"
|
45
|
+
end
|
46
|
+
|
47
|
+
def migration
|
48
|
+
unless options.skip_migration
|
49
|
+
migration_template 'db_migrate/migrate.rb', "db/migrate/create_#{plural_name}.rb"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def views
|
54
|
+
template 'views/edit.html.erb', "app/views/#{@namespace.underscore}/#{plural_name}/edit.html.erb"
|
55
|
+
template 'views/index.html.erb', "app/views/#{@namespace.underscore}/#{plural_name}/index.html.erb"
|
56
|
+
template 'views/index.js.erb', "app/views/#{@namespace.underscore}/#{plural_name}/index.js.erb"
|
57
|
+
template 'views/new.html.erb', "app/views/#{@namespace.underscore}/#{plural_name}/new.html.erb"
|
58
|
+
template 'views/_form.html.erb', "app/views/#{@namespace.underscore}/#{plural_name}/_form.html.erb"
|
59
|
+
template 'views/_list.html.erb', "app/views/#{@namespace.underscore}/#{plural_name}/_#{plural_name}.html.erb"
|
60
|
+
|
61
|
+
if options.ajax
|
62
|
+
template 'views/create.js.erb', "app/views/#{@namespace.underscore}/#{plural_name}/create.js.erb"
|
63
|
+
template 'views/destroy.js.erb', "app/views/#{@namespace.underscore}/#{plural_name}/destroy.js.erb"
|
64
|
+
template 'views/update.js.erb', "app/views/#{@namespace.underscore}/#{plural_name}/update.js.erb"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def routes
|
69
|
+
route "resources :#{plural_name}" unless namespace?
|
70
|
+
route "namespace :#{namespace.underscore} do resources :#{plural_name} end" if namespace?
|
71
|
+
end
|
72
|
+
|
73
|
+
def run_rake_db_migrate
|
74
|
+
rake('db:migrate') if yes? 'Run rake db:migrate?'
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def singular_name
|
80
|
+
@model_name.underscore
|
81
|
+
end
|
82
|
+
|
83
|
+
def plural_name
|
84
|
+
@model_name.underscore.pluralize
|
85
|
+
end
|
86
|
+
|
87
|
+
def namespace_model_class
|
88
|
+
"#{namespace_scope}#{@model_name}"
|
89
|
+
end
|
90
|
+
|
91
|
+
def namespace_scope
|
92
|
+
return "#{@namespace}::" unless @namespace.blank?
|
93
|
+
return ''
|
94
|
+
end
|
95
|
+
|
96
|
+
def namespace_object
|
97
|
+
namespace_model_class.gsub('::', '_').underscore
|
98
|
+
end
|
99
|
+
|
100
|
+
def namespace?
|
101
|
+
!namespace.blank?
|
102
|
+
end
|
103
|
+
|
104
|
+
# Sets Rails migration timestamp
|
105
|
+
def self.next_migration_number(dirname) #:nodoc:
|
106
|
+
if ActiveRecord::Base.timestamped_migrations
|
107
|
+
Time.now.utc.strftime("%Y%m%d%H%M%S")
|
108
|
+
else
|
109
|
+
"%.3d" % (current_migration_number(dirname) + 1)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
Binary file
|
@@ -0,0 +1,68 @@
|
|
1
|
+
class <%= namespace_scope %><%= plural_name.camelize %>Controller < <%= @inherit_controller || 'ApplicationController' %>
|
2
|
+
|
3
|
+
def index
|
4
|
+
@<%= plural_name %> = <%= namespace_model_class %>.paginate :page => params[:page]
|
5
|
+
|
6
|
+
respond_to do |format|
|
7
|
+
format.html
|
8
|
+
format.js
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
def show
|
14
|
+
@<%= singular_name %> = <%= namespace_model_class %>.find(params[:id])
|
15
|
+
render :layout => false
|
16
|
+
end
|
17
|
+
|
18
|
+
def new
|
19
|
+
@<%= singular_name %> = <%= namespace_model_class %>.new
|
20
|
+
render :layout => false
|
21
|
+
end
|
22
|
+
|
23
|
+
def edit
|
24
|
+
@<%= singular_name %> = <%= namespace_model_class %>.find(params[:id])
|
25
|
+
render :layout => false
|
26
|
+
end
|
27
|
+
|
28
|
+
def create
|
29
|
+
@<%= singular_name %> = <%= namespace_model_class %>.new(params[:<%= namespace_object %>])
|
30
|
+
@<%= singular_name %>.save
|
31
|
+
# loads all <%= plural_name %> to display in the list
|
32
|
+
load_list
|
33
|
+
|
34
|
+
respond_to do |format|
|
35
|
+
format.js
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def update
|
40
|
+
@<%= singular_name %> = <%= namespace_model_class %>.find(params[:id])
|
41
|
+
@<%= singular_name %>.update_attributes(params[:<%= namespace_object %>])
|
42
|
+
|
43
|
+
# loads all <%= plural_name %> to display in the list
|
44
|
+
load_list
|
45
|
+
|
46
|
+
respond_to do |format|
|
47
|
+
format.js
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def destroy
|
52
|
+
@<%= singular_name %> = <%= namespace_model_class %>.find(params[:id])
|
53
|
+
@<%= singular_name %>.destroy
|
54
|
+
|
55
|
+
# loads all <%= plural_name %> to display in the list
|
56
|
+
load_list
|
57
|
+
|
58
|
+
respond_to do |format|
|
59
|
+
format.js
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
def load_list
|
65
|
+
@<%= plural_name %> = <%= namespace_model_class %>.paginate :page => 1
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
class <%= namespace_scope %><%= plural_name.camelize %>Controller < <%= @inherit_controller || 'ApplicationController' %>
|
2
|
+
|
3
|
+
def index
|
4
|
+
@<%= plural_name %> = <%= namespace_model_class %>.paginate :page => params[:page]
|
5
|
+
|
6
|
+
respond_to do |format|
|
7
|
+
format.html
|
8
|
+
format.js
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
def show
|
14
|
+
@<%= singular_name %> = <%= namespace_model_class %>.find(params[:id])
|
15
|
+
|
16
|
+
respond_to do |format|
|
17
|
+
format.html
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def new
|
22
|
+
@<%= singular_name %> = <%= namespace_model_class %>.new
|
23
|
+
|
24
|
+
respond_to do |format|
|
25
|
+
format.html
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit
|
30
|
+
@<%= singular_name %> = <%= namespace_model_class %>.find(params[:id])
|
31
|
+
end
|
32
|
+
|
33
|
+
def create
|
34
|
+
@<%= singular_name %> = <%= namespace_model_class %>.new(params[:<%= namespace_object %>])
|
35
|
+
|
36
|
+
respond_to do |format|
|
37
|
+
if @<%= singular_name %>.save
|
38
|
+
format.html { redirect_to <%= namespace_object.pluralize %>_path, notice: t('<%= plural_name %>.create_success') }
|
39
|
+
else
|
40
|
+
format.html { render action: "new" }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def update
|
46
|
+
@<%= singular_name %> = <%= namespace_model_class %>.find(params[:id])
|
47
|
+
|
48
|
+
respond_to do |format|
|
49
|
+
if @<%= singular_name %>.update_attributes(params[:<%= namespace_object %>])
|
50
|
+
format.html { redirect_to <%= namespace_object.pluralize %>_path, notice: t('<%= plural_name %>.update_success') }
|
51
|
+
else
|
52
|
+
format.html { render action: "edit" }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def destroy
|
58
|
+
@<%= singular_name %> = <%= namespace_model_class %>.find(params[:id])
|
59
|
+
|
60
|
+
@<%= singular_name %>.destroy
|
61
|
+
|
62
|
+
respond_to do |format|
|
63
|
+
format.html { redirect_to <%= namespace_object.pluralize %>_path, notice: t('<%= plural_name %>.destroy_success') }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Create<%= plural_name.camelize %> < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
create_table :<%= plural_name %> do |t|
|
5
|
+
<%- @model_attributes.each do |attr| %>
|
6
|
+
t.<%= attr.migration_field %> :<%= attr.name %>
|
7
|
+
<%- end %>
|
8
|
+
<%- indexed_attributes = @model_attributes.select {|m| m.references?} %> <%- if indexed_attributes.count > 0 %>
|
9
|
+
add_index <%= indexed_attributes.collect {|m| ":" + m.name }.join(', ') %>
|
10
|
+
<%- end %>
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :<%= plural_name %>
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class <%= namespace_model_class %> < ActiveRecord::Base
|
2
|
+
|
3
|
+
attr_accessible <%= @model_attributes.reject {|m| m.references? }.collect {|m| ":" + m.name }.join(', ') %>
|
4
|
+
|
5
|
+
<%- @model_attributes.select {|m| m.references? }.each do |attr| %>
|
6
|
+
belongs_to :<%= attr.type %>
|
7
|
+
<%- end %>
|
8
|
+
|
9
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%%= form_for(@<%= singular_name %><%= ', :remote => true, :class => :mdwa_ajax' if options.ajax %>) do |f| %>
|
2
|
+
|
3
|
+
<%- unless options.ajax %>
|
4
|
+
<%% if @<%= singular_name %>.errors.any? %>
|
5
|
+
<div id="error_explanation">
|
6
|
+
<h2><%%= pluralize(@<%= singular_name %>.errors.count, t('system.error')) %> :</h2>
|
7
|
+
|
8
|
+
<ul>
|
9
|
+
<%% @<%= singular_name %>.errors.full_messages.each do |msg| %>
|
10
|
+
<li><%%= msg %></li>
|
11
|
+
<%% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
<%% end %>
|
15
|
+
<%- end %>
|
16
|
+
|
17
|
+
<div class="yui3-g">
|
18
|
+
<div class="yui3-u">
|
19
|
+
<%- @model_attributes.each do |attr| %>
|
20
|
+
<div class="field">
|
21
|
+
<%%= f.label :<%= attr.name %> %>
|
22
|
+
<%= attr.form_field %>
|
23
|
+
</div>
|
24
|
+
<%- end %>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="actions">
|
29
|
+
<%- if !options.ajax %>
|
30
|
+
<%%= link_to t('system.cancel_button'), <%= namespace_object.pluralize %>_path, :class => :cancel %> <%- else %>
|
31
|
+
<%%= link_to t('system.cancel_button'), '#', :class => :cancel %> <%- end %>
|
32
|
+
|
33
|
+
<%%= f.submit :class => :button %>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<%% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<table class="list">
|
2
|
+
<thead>
|
3
|
+
<th><%%= t 'system.index_id' %></th>
|
4
|
+
<%- @model_attributes.each do |attr| %>
|
5
|
+
<th><%%= t '<%= plural_name %>.index_<%= attr.name %>' %></th>
|
6
|
+
<%- end %>
|
7
|
+
<th><%%= t 'system.index_remove' %></th>
|
8
|
+
</thead>
|
9
|
+
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
|
10
|
+
<tr class="<%%= cycle 'odd_line', 'even_line' %>" >
|
11
|
+
<td><%%= link_to <%= singular_name %>.id, edit_<%= namespace_object %>_path(<%= singular_name %>) <%= ", :class => 'lightbox various fancybox.ajax'" if options.ajax %> %></td>
|
12
|
+
<%- @model_attributes.each do |attr| %>
|
13
|
+
<td><%%= <%= singular_name %>.<%= attr.name %> %></td>
|
14
|
+
<%- end %>
|
15
|
+
<td><%%= link_to t('system.index_remove_label'), <%= singular_name %>, :method => :delete, <%= ':remote => true,' if options.ajax %> :confirm => t('system.index_confirm_deletion') %></td>
|
16
|
+
</tr>
|
17
|
+
<%% end %>
|
18
|
+
</table>
|
19
|
+
|
20
|
+
<%%= pagination_footer @<%= plural_name %> %>
|
@@ -0,0 +1 @@
|
|
1
|
+
$("#<%= plural_name %>_list").html("<%%= escape_javascript( render :partial => '<%= plural_name %>' )%>");
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id="<%= plural_name %>_index" class="mdwa_index">
|
2
|
+
<div class="page_header">
|
3
|
+
<h1><%%= t '<%= plural_name %>.index_title' %></h1>
|
4
|
+
<%- if options.ajax %>
|
5
|
+
<div class="page_header_right_tab">
|
6
|
+
<%%= link_to t('system.add_by_ajax', :name => '<%= singular_name.humanize %>'), new_<%= namespace_object%>_path, :class => 'lightbox various fancybox.ajax' %>
|
7
|
+
</div>
|
8
|
+
<%- end %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="inside">
|
12
|
+
<div id="<%= plural_name %>_list">
|
13
|
+
<%%= render '<%= plural_name %>' %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
$("#<%= plural_name %>_list").html("<%%= escape_javascript( render :partial => "<%= plural_name %>" )%>");
|
data/lib/mdd.rb
CHANGED
@@ -5,6 +5,10 @@ module Mdd
|
|
5
5
|
config.autoload_paths << File.expand_path("../app", __FILE__)
|
6
6
|
end
|
7
7
|
|
8
|
+
module Generators
|
9
|
+
autoload :ModelAttribute, 'mdd/generators/model_attribute'
|
10
|
+
end
|
11
|
+
|
8
12
|
module Layout
|
9
13
|
autoload :Base, 'mdd/layout/base'
|
10
14
|
autoload :Helper, 'mdd/layout/helper'
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Mdd
|
2
|
+
module Generators
|
3
|
+
|
4
|
+
class ModelAttribute
|
5
|
+
attr_accessor :name, :type, :reference, :reference_type
|
6
|
+
|
7
|
+
STATIC_TYPES = [:boolean, :date, :datetime, :decimal, :float, :integer, :string, :text, :time, :timestamp, :file]
|
8
|
+
|
9
|
+
def initialize( arg )
|
10
|
+
|
11
|
+
# sets the variables by the string
|
12
|
+
split = arg.split(':')
|
13
|
+
self.type = split[1]
|
14
|
+
self.name = split[0]
|
15
|
+
self.reference = split[2]
|
16
|
+
self.reference_type = split[3]
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
def references?
|
21
|
+
!STATIC_TYPES.include?(self.type.to_sym)
|
22
|
+
end
|
23
|
+
|
24
|
+
def name=(value)
|
25
|
+
if references? and !value.end_with?('_id')
|
26
|
+
@name = "#{value}_id"
|
27
|
+
else
|
28
|
+
@name = value
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def migration_field
|
33
|
+
@migration_field ||= case self.type.to_sym
|
34
|
+
when :string, :file then 'string'
|
35
|
+
when :boolean then 'boolean'
|
36
|
+
when :date then 'date'
|
37
|
+
when :datetime then 'datetime'
|
38
|
+
when :decimal, :float then 'decimal'
|
39
|
+
when :text then 'text'
|
40
|
+
when :time then 'time'
|
41
|
+
when :timestamp then 'timestamp'
|
42
|
+
else
|
43
|
+
'integer'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def form_field
|
48
|
+
@form_field ||= case self.type.to_sym
|
49
|
+
when :integer then 'number_field'
|
50
|
+
when :float, :decimal then 'text_field'
|
51
|
+
when :file then 'file_field'
|
52
|
+
when :time then 'time_select'
|
53
|
+
when :datetime, :timestamp then 'datetime_select'
|
54
|
+
when :date then 'date_select'
|
55
|
+
when :text then 'text_area'
|
56
|
+
when :boolean then 'check_box'
|
57
|
+
else
|
58
|
+
'text_field'
|
59
|
+
end
|
60
|
+
|
61
|
+
"<%= f.#{@form_field} :#{self.name} %>"
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
data/lib/mdd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -124,6 +124,8 @@ files:
|
|
124
124
|
- app/views/template/mdwa/_autocomplete_tag.html.erb
|
125
125
|
- app/views/template/mdwa/_login_text.html.erb
|
126
126
|
- app/views/template/mdwa/_notice.html.erb
|
127
|
+
- lib/generators/.DS_Store
|
128
|
+
- lib/generators/mdd/sandbox/USAGE
|
127
129
|
- lib/generators/mdd/sandbox/sandbox_generator.rb
|
128
130
|
- lib/generators/mdd/sandbox/templates/app/assets/images/.DS_Store
|
129
131
|
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/ajax-loader.gif
|
@@ -143,6 +145,20 @@ files:
|
|
143
145
|
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/icons/edit.png
|
144
146
|
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/icons/lupa.png
|
145
147
|
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/icons/remove-icon.png
|
148
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png
|
149
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png
|
150
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_flat_10_000000_40x100.png
|
151
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png
|
152
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png
|
153
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_glass_65_ffffff_1x400.png
|
154
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png
|
155
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png
|
156
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png
|
157
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_222222_256x240.png
|
158
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_228ef1_256x240.png
|
159
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_ef8c08_256x240.png
|
160
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_ffd27a_256x240.png
|
161
|
+
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/jquery-ui/ui-icons_ffffff_256x240.png
|
146
162
|
- lib/generators/mdd/sandbox/templates/app/assets/images/mdwa/notice_close.png
|
147
163
|
- lib/generators/mdd/sandbox/templates/app/assets/javascripts/.DS_Store
|
148
164
|
- lib/generators/mdd/sandbox/templates/app/assets/javascripts/jquery/jquery-ui.js
|
@@ -223,8 +239,26 @@ files:
|
|
223
239
|
- lib/generators/mdd/sandbox/templates/db/seeds.rb
|
224
240
|
- lib/generators/mdd/sandbox/templates/db/seeds/.DS_Store
|
225
241
|
- lib/generators/mdd/sandbox/templates/db/seeds/site.rb
|
242
|
+
- lib/generators/mdd/scaffold/USAGE
|
243
|
+
- lib/generators/mdd/scaffold/scaffold_generator.rb
|
244
|
+
- lib/generators/mdd/scaffold/templates/.DS_Store
|
245
|
+
- lib/generators/mdd/scaffold/templates/controllers/ajax_controller.rb
|
246
|
+
- lib/generators/mdd/scaffold/templates/controllers/controller.rb
|
247
|
+
- lib/generators/mdd/scaffold/templates/db_migrate/migrate.rb
|
248
|
+
- lib/generators/mdd/scaffold/templates/models/model.rb
|
249
|
+
- lib/generators/mdd/scaffold/templates/models/module.rb
|
250
|
+
- lib/generators/mdd/scaffold/templates/views/_form.html.erb
|
251
|
+
- lib/generators/mdd/scaffold/templates/views/_list.html.erb
|
252
|
+
- lib/generators/mdd/scaffold/templates/views/create.js.erb
|
253
|
+
- lib/generators/mdd/scaffold/templates/views/destroy.js.erb
|
254
|
+
- lib/generators/mdd/scaffold/templates/views/edit.html.erb
|
255
|
+
- lib/generators/mdd/scaffold/templates/views/index.html.erb
|
256
|
+
- lib/generators/mdd/scaffold/templates/views/index.js.erb
|
257
|
+
- lib/generators/mdd/scaffold/templates/views/new.html.erb
|
258
|
+
- lib/generators/mdd/scaffold/templates/views/update.js.erb
|
226
259
|
- lib/mdd.rb
|
227
260
|
- lib/mdd/.DS_Store
|
261
|
+
- lib/mdd/generators/model_attribute.rb
|
228
262
|
- lib/mdd/layout/base.rb
|
229
263
|
- lib/mdd/layout/helper.rb
|
230
264
|
- lib/mdd/version.rb
|