masterview_generator 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/templates/controller.rb +13 -13
- data/templates/masterview.rhtml +143 -143
- metadata +4 -3
data/templates/controller.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class <%= controller_class_name %>Controller < ApplicationController
|
2
|
-
|
2
|
+
|
3
3
|
<% unless suffix -%>
|
4
4
|
def index
|
5
5
|
list
|
@@ -17,34 +17,34 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def show<%= suffix %>
|
20
|
-
@<%= singular_name %> = <%= model_name %>.find(
|
20
|
+
@<%= singular_name %> = <%= model_name %>.find(params['id'])
|
21
21
|
end
|
22
22
|
|
23
23
|
def new<%= suffix %>
|
24
|
-
@<%= singular_name %> = <%= model_name %>.new(
|
25
|
-
|
26
|
-
if
|
24
|
+
@<%= singular_name %> = <%= model_name %>.new(params["<%= singular_name %>"])
|
25
|
+
|
26
|
+
if request.post? and @<%= singular_name %>.save
|
27
27
|
flash[:notice] = '<%= model_name %> was successfully created.'
|
28
28
|
redirect_to :action => 'list<%= suffix %>'
|
29
|
-
end
|
29
|
+
end
|
30
30
|
end
|
31
31
|
|
32
32
|
def edit<%= suffix %>
|
33
|
-
@<%= singular_name %> = <%= model_name %>.find(
|
34
|
-
@<%= singular_name %>.attributes =
|
35
|
-
if
|
33
|
+
@<%= singular_name %> = <%= model_name %>.find(params['id'])
|
34
|
+
@<%= singular_name %>.attributes = params["<%= singular_name %>"]
|
35
|
+
if request.post? and @<%= singular_name %>.save
|
36
36
|
flash[:notice] = '<%= model_name %> was successfully updated.'
|
37
37
|
redirect_to :action => 'list<%= suffix %>'
|
38
|
-
end
|
38
|
+
end
|
39
39
|
end
|
40
40
|
|
41
41
|
def destroy<%= suffix %>
|
42
|
-
@<%= singular_name %> = <%= model_name %>.find(
|
43
|
-
if
|
42
|
+
@<%= singular_name %> = <%= model_name %>.find(params['id'])
|
43
|
+
if request.post?
|
44
44
|
@<%= singular_name %>.destroy
|
45
45
|
flash[:notice] = '<%= model_name %> was successfully deleted.'
|
46
46
|
redirect_to :action => 'list<%= suffix %>'
|
47
47
|
end
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
end
|
data/templates/masterview.rhtml
CHANGED
@@ -14,13 +14,13 @@
|
|
14
14
|
</head>
|
15
15
|
<body>
|
16
16
|
|
17
|
-
<!-- ###### Header ###### -->
|
17
|
+
<!-- ###### Header ###### -->
|
18
18
|
|
19
|
-
<div id="header">
|
20
|
-
<span class="headerTitle"><%= controller_class_name %></span>
|
19
|
+
<div id="header">
|
20
|
+
<span class="headerTitle"><%= controller_class_name %></span>
|
21
21
|
<div class="menuBar">
|
22
22
|
<a href="list.html" mv:link_to=":action => :index">Home</a>
|
23
|
-
|
23
|
+
<!-- | <a href="">Another link</a> -->
|
24
24
|
</div>
|
25
25
|
</div>
|
26
26
|
|
@@ -28,180 +28,180 @@
|
|
28
28
|
<div class="main">
|
29
29
|
<div id="<%= controller_file_name %>_content" mv:replace="@content_for_layout">
|
30
30
|
|
31
|
-
<!-- ###### Main Content Starts ###### -->
|
31
|
+
<!-- ###### Main Content Starts ###### -->
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
<div id="<%= controller_file_name %>_list" mv:generate="<%= controller_view_dir_name %>/list.rhtml" mv:preview="showOne" class="list_div"> <!-- ###### List ###### -->
|
34
|
+
<div class="<%= controller_file_name %>_list sidebar LHS">
|
35
|
+
<h2>Tasks:</h2>
|
36
|
+
<ul>
|
37
|
+
<li><a class="new_link" href="new.html" mv:link_to=":action => 'new<%= suffix %>'">Create new <%= singular_name %></a></li>
|
38
|
+
</ul>
|
39
|
+
</div>
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
<div class="<%= controller_file_name %>_list content">
|
42
|
+
<h1><%= plural_name.capitalize %></h1>
|
43
43
|
|
44
|
-
<div id="<%= controller_file_name %>_messages" class="messages" mv:gen_partial=":partial => '<%= controller_view_dir_name %>/messages'" mv:if="
|
44
|
+
<div id="<%= controller_file_name %>_messages" class="messages" mv:gen_partial=":partial => '<%= controller_view_dir_name %>/messages'" mv:if="flash[:notice]" mv:content="flash[:notice]">
|
45
45
|
<%= messages %>
|
46
46
|
</div>
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
48
|
+
<div class="list">
|
49
|
+
<table border="1" class="<%= controller_file_name %>_list_table" cellpadding="5">
|
50
|
+
<tr>
|
51
|
+
<%= list_head_inclusion %>
|
52
|
+
</tr>
|
53
|
+
<tr mv:gen_partial=":partial => '<%= controller_view_dir_name %>/<%= singular_name %>', :collection => @<%= plural_name %>">
|
54
|
+
<%= list_line_inclusion %>
|
55
|
+
</tr>
|
56
|
+
</table>
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
<a class="previous_link" href="list.html" mv:if="@<%= singular_name %>_pages.current.previous" mv:link_to=":page => @<%= singular_name %>_pages.current.previous">Previous page</a>
|
59
|
+
<a class="next_link" href="list.html" mv:if="@<%= singular_name %>_pages.current.next" mv:link_to=":page => @<%= singular_name %>_pages.current.next">Next page</a>
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
64
|
|
65
65
|
|
66
|
-
|
66
|
+
<div id="<%= controller_file_name %>_new" mv:generate="<%= controller_view_dir_name %>/new.rhtml" mv:preview="showOne" class="new_div"> <!-- ###### New ###### -->
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
68
|
+
<div class="<%= controller_file_name %>_new sidebar LHS">
|
69
|
+
<h2>Tasks:</h2>
|
70
|
+
<ul>
|
71
|
+
<li><a class="list_link" href="list.html" mv:link_to=":action => 'list<%= suffix %>'">Back to overview</a></li>
|
72
|
+
</ul>
|
73
|
+
</div>
|
74
74
|
|
75
|
-
|
76
|
-
|
75
|
+
<div class="<%= controller_file_name %>_new content">
|
76
|
+
<h1><%= plural_name.capitalize %></h1>
|
77
77
|
|
78
|
-
|
78
|
+
<form mv:form=":action => 'new'">
|
79
79
|
|
80
|
-
|
81
|
-
|
80
|
+
<div class="form">
|
81
|
+
<h2>Creating <%= singular_name %></h2>
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
83
|
+
<div class="messages" mv:import_render=":partial => '<%= controller_view_dir_name %>/messages'" mv:preview="copyOf:<%= controller_file_name %>_messages">
|
84
|
+
copyOf:<%= controller_file_name %>_messages
|
85
|
+
</div>
|
86
86
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
87
|
+
<div id="<%= controller_file_name %>_form" mv:gen_partial=":partial => '<%= controller_view_dir_name %>/form'">
|
88
|
+
<div class="error_messages" mv:replace="error_messages_for :<%= singular_name %>">
|
89
|
+
error messages
|
90
|
+
</div>
|
91
|
+
<br/>
|
92
|
+
<%= form_inclusion %>
|
93
|
+
</div>
|
94
94
|
|
95
|
-
|
95
|
+
</div>
|
96
96
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
97
|
+
<br/>
|
98
|
+
<div class="<%= controller_file_name %>_new operations">
|
99
|
+
<input type="submit" value="OK" class="primary save_button" mv:submit=""/>
|
100
|
+
<input type="button" value="Cancel" class="cancel_button" style="width: auto;" onclick="window.location.href = '{{{= url_for :action => %q{list} }}}';" />
|
101
|
+
</div>
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
103
|
+
</form>
|
104
|
+
</div>
|
105
|
+
</div>
|
106
106
|
|
107
107
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
108
|
+
<div id="<%= controller_file_name %>_edit" mv:generate="<%= controller_view_dir_name %>/edit.rhtml" mv:preview="showOne" class="edit_div"> <!-- ###### Edit ###### -->
|
109
|
+
<div class="<%= controller_file_name %>_edit sidebar LHS">
|
110
|
+
<h2>Tasks:</h2>
|
111
|
+
<ul>
|
112
|
+
<li><a class="list_link" href="list.html" mv:link_to=":action => 'list<%= suffix %>'">Back to overview</a></li>
|
113
|
+
</ul>
|
114
|
+
</div>
|
115
115
|
|
116
|
-
|
117
|
-
|
116
|
+
<div class="<%= controller_file_name %>_edit content">
|
117
|
+
<h1><%= plural_name.capitalize %></h1>
|
118
118
|
|
119
119
|
|
120
|
-
|
120
|
+
<form mv:form=":action => 'edit', :id => @<%=singular_name%>.id">
|
121
121
|
|
122
|
-
|
123
|
-
|
122
|
+
<div class="form">
|
123
|
+
<h2>Editing <%= singular_name %></h2>
|
124
124
|
|
125
|
-
|
126
|
-
|
127
|
-
|
125
|
+
<div class="messages" mv:import_render=":partial => '<%= controller_view_dir_name %>/messages'" mv:preview="copyOf:<%= controller_file_name %>_messages">
|
126
|
+
copyOf:<%= controller_file_name %>_messages
|
127
|
+
</div>
|
128
128
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
129
|
+
<div mv:import_render=":partial => '<%= controller_view_dir_name %>/form'" mv:preview="copyOf:<%= controller_file_name %>_form">
|
130
|
+
copyOf:<%= controller_file_name %>_form
|
131
|
+
</div>
|
132
|
+
</div>
|
133
133
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
134
|
+
<br/>
|
135
|
+
<div class="<%= controller_file_name %>_edit operations">
|
136
|
+
<input type="submit" value="OK" class="primary save_button" mv:submit=""/>
|
137
|
+
<input type="button" value="Cancel" class="cancel_button" style="width: auto;" onclick="window.location.href = '{{{= url_for :action => %q{list} }}}';" /> </div>
|
138
138
|
|
139
|
-
|
140
|
-
|
141
|
-
|
139
|
+
</form>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
142
|
|
143
143
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
144
|
+
<div id="<%= controller_file_name %>_show" mv:generate="<%= controller_view_dir_name %>/show.rhtml" mv:preview="showOne" class="show_div"> <!-- ###### Show ###### -->
|
145
|
+
<div class="<%= controller_file_name %>_show sidebar LHS">
|
146
|
+
<h2>Tasks:</h2>
|
147
|
+
<ul>
|
148
|
+
<li><a class="list_link" href="list.html" mv:link_to=":action => 'list<%= suffix %>'">Back to overview</a></li>
|
149
|
+
<li><a class="edit_link" href="edit.html" mv:link_to=":action => 'edit<%= suffix %>', :id => @<%= singular_name %>.id">Edit this <%= singular_name %></a></li>
|
150
|
+
</ul>
|
151
|
+
</div>
|
152
152
|
|
153
|
-
|
154
|
-
|
153
|
+
<div class="<%= controller_file_name %>_show content">
|
154
|
+
<h1><%= plural_name.capitalize %></h1>
|
155
155
|
|
156
|
-
|
157
|
-
|
158
|
-
|
156
|
+
<div class="messages" mv:import_render=":partial => '<%= controller_view_dir_name %>/messages'" mv:preview="copyOf:<%= controller_file_name %>_messages">
|
157
|
+
copyOf:<%= controller_file_name %>_messages
|
158
|
+
</div>
|
159
159
|
|
160
|
-
|
161
|
-
|
162
|
-
|
160
|
+
<div id="<%= controller_file_name %>_show_partial" class="form" mv:gen_partial=":partial => '<%= controller_view_dir_name %>/show'">
|
161
|
+
<%= show_inclusion %>
|
162
|
+
</div>
|
163
163
|
|
164
|
-
|
165
|
-
|
164
|
+
</div>
|
165
|
+
</div>
|
166
166
|
|
167
167
|
|
168
168
|
<div id="<%= controller_file_name %>_destroy" mv:generate="<%= controller_view_dir_name %>/destroy.rhtml" mv:preview="showOne" class="destroy_div"> <!-- ###### Destroy ###### -->
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
<!-- ###### Main Content Ends ###### -->
|
169
|
+
<div class="<%= controller_file_name %>_destroy sidebar LHS">
|
170
|
+
<h2>Tasks:</h2>
|
171
|
+
<ul>
|
172
|
+
<li><a class="list_link" href="list.html" mv:link_to=":action => 'list<%= suffix %>'">Back to overview</a></li>
|
173
|
+
<li><a class="show_link" href="show.html" mv:link_to=":action => 'show<%= suffix %>', :id => @<%= singular_name %>.id">Show this <%= singular_name %></a></li>
|
174
|
+
</ul>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="<%= controller_file_name %>_destroy content">
|
178
|
+
<h1><%= plural_name.capitalize %></h1>
|
179
|
+
|
180
|
+
<div class="messages" mv:import_render=":partial => '<%= controller_view_dir_name %>/messages'" mv:preview="copyOf:<%= controller_file_name %>_messages">
|
181
|
+
copyOf:<%= controller_file_name %>_messages
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div class="error_messages" mv:replace="error_messages_for :<%= singular_name %>">
|
185
|
+
error messages
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div class="messages">Are you sure you want to delete this item?</div>
|
189
|
+
<br/>
|
190
|
+
<form mv:form=":action => 'destroy', :id => @<%= singular_name %>.id">
|
191
|
+
<div mv:import_render=":partial => '<%= controller_view_dir_name %>/show'" mv:preview="copyOf:<%= controller_file_name %>_show_partial">
|
192
|
+
copyOf:<%= controller_file_name %>_show_partial
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<br/>
|
196
|
+
<div class="<%= controller_file_name %>_edit operations">
|
197
|
+
<input type="submit" value="Delete" mv:submit="" class="save_button"/>
|
198
|
+
<input type="button" value="Cancel" class="cancel_button" style="width: auto;" onclick="window.location.href = '{{{= url_for :action => %q{list} }}}';" />
|
199
|
+
</div>
|
200
|
+
</form>
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
<!-- ###### Main Content Ends ###### -->
|
205
205
|
|
206
206
|
</div>
|
207
207
|
</div>
|
@@ -213,17 +213,17 @@
|
|
213
213
|
<div class="footerLHS">
|
214
214
|
<a href="http://validator.w3.org/check/referer">Valid XHTML 1.0 Strict</a>
|
215
215
|
</div>
|
216
|
-
|
216
|
+
|
217
217
|
<div class="footerLHS">
|
218
218
|
<a href="http://jigsaw.w3.org/css-validator/check/referer">Valid CSS 2</a>
|
219
219
|
</div>
|
220
|
-
|
220
|
+
|
221
221
|
<div>
|
222
222
|
Copyright
|
223
223
|
</div>
|
224
224
|
|
225
225
|
<div>
|
226
|
-
Website by
|
226
|
+
Website by
|
227
227
|
</div>
|
228
228
|
</div>
|
229
229
|
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0
|
3
3
|
specification_version: 1
|
4
4
|
name: masterview_generator
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date:
|
6
|
+
version: 0.3.2
|
7
|
+
date: 2007-02-21 00:00:00 -06:00
|
8
8
|
summary: A (x)html friendly template engine for rails with the power of layouts, and partials. MasterView Generator for creating templates and scaffolding.
|
9
9
|
require_paths:
|
10
10
|
- .
|
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
30
|
- Jeff Barczewski
|
30
31
|
files:
|