masterview 0.1.5 → 0.2.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/CHANGELOG +17 -0
- data/README +36 -504
- data/RELEASE_NOTES +126 -45
- data/Rakefile +215 -86
- data/TODO +8 -3
- data/doc/configuration.html +485 -0
- data/doc/directives.html +1085 -0
- data/doc/guide.html +243 -0
- data/doc/index.html +287 -0
- data/doc/installation.html +376 -0
- data/doc/stylesheets/masterview.css +206 -0
- data/doc/stylesheets/mv-config.css +23 -0
- data/doc/stylesheets/mv-directives.css +18 -0
- data/doc/stylesheets/mv-installation.css +10 -0
- data/doc/troubleshooting.html +18 -0
- data/examples/product.html +256 -0
- data/examples/product.html.old +107 -0
- data/examples/rails_app_config/masterview/environment/development.rb +22 -0
- data/examples/rails_app_config/masterview/environment/production.rb +9 -0
- data/examples/rails_app_config/masterview/settings.rb +59 -0
- data/examples/test.import +80 -0
- data/init.rb +26 -12
- data/lib/masterview/analyzer.rb +25 -15
- data/lib/masterview/directive_base.rb +4 -0
- data/lib/masterview/directive_helpers.rb +7 -5
- data/lib/masterview/directives/import_render.rb +6 -0
- data/lib/masterview/directives/insert_generated_comment.rb +8 -8
- data/lib/masterview/extras/app/controllers/masterview_controller.rb +154 -2
- data/lib/masterview/extras/app/views/masterview/admin/create.rhtml +4 -4
- data/lib/masterview/extras/app/views/masterview/admin/empty.rhtml +1 -1
- data/lib/masterview/extras/app/views/masterview/admin/list.rhtml +14 -9
- data/lib/masterview/extras/app/views/masterview/admin/view_rhtml.rhtml +70 -0
- data/lib/masterview/extras/init_logger.rb +102 -0
- data/lib/masterview/extras/init_rails_erb_mv_direct.rb +117 -0
- data/lib/masterview/extras/init_rails_reparse_checking.rb +59 -0
- data/lib/masterview/extras/watcher.rb +17 -23
- data/lib/masterview/filter_helpers.rb +26 -0
- data/lib/masterview/initializer.rb +912 -0
- data/lib/masterview/io.rb +352 -0
- data/lib/masterview/keyword_expander.rb +116 -0
- data/lib/masterview/masterview_version.rb +2 -2
- data/lib/masterview/mtime_tracking_hash.rb +44 -0
- data/lib/masterview/parser.rb +64 -92
- data/lib/masterview/pathname_extensions.rb +33 -0
- data/lib/masterview/template_spec.rb +49 -56
- data/lib/masterview.rb +40 -85
- data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/environments/development.rb +12 -0
- data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/environments/production.rb +11 -0
- data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/settings.rb +23 -0
- data/test/fixtures/templates/product.html +256 -0
- data/test/fixtures/templates/test.import +80 -0
- data/test/test_helper.rb +5 -3
- data/test/tmp/template/foo.txt +1 -0
- data/test/tmp/templates_src/product.html +256 -0
- data/test/tmp/views/layouts/product.rhtml +35 -0
- data/test/tmp/views/product/_form.rhtml +30 -0
- data/test/tmp/views/product/_product.rhtml +14 -0
- data/test/tmp/views/product/_show.rhtml +27 -0
- data/test/tmp/views/product/destroy.rhtml +27 -0
- data/test/tmp/views/product/edit.rhtml +26 -0
- data/test/tmp/views/product/list.rhtml +31 -0
- data/test/tmp/views/product/new.rhtml +29 -0
- data/test/tmp/views/product/show.rhtml +16 -0
- data/test/unit/config_settings_test.rb +172 -0
- data/test/{attr_test.rb → unit/directive_attr_test.rb} +2 -2
- data/test/{block_test.rb → unit/directive_block_test.rb} +2 -2
- data/test/{content_test.rb → unit/directive_content_test.rb} +2 -2
- data/test/{else_test.rb → unit/directive_else_test.rb} +2 -2
- data/test/{elsif_test.rb → unit/directive_elsif_test.rb} +2 -2
- data/test/{form_test.rb → unit/directive_form_test.rb} +2 -2
- data/test/{global_inline_erb_test.rb → unit/directive_global_inline_erb_test.rb} +2 -2
- data/test/{hidden_field_test.rb → unit/directive_hidden_field_test.rb} +2 -2
- data/test/{if_test.rb → unit/directive_if_test.rb} +2 -2
- data/test/unit/directive_import_render_test.rb +62 -0
- data/test/{import_test.rb → unit/directive_import_test.rb} +2 -2
- data/test/{javascript_include_test.rb → unit/directive_javascript_include_test.rb} +2 -2
- data/test/{link_to_if_test.rb → unit/directive_link_to_if_test.rb} +2 -2
- data/test/{link_to_test.rb → unit/directive_link_to_test.rb} +2 -2
- data/test/{omit_tag_test.rb → unit/directive_omit_tag_test.rb} +2 -2
- data/test/{password_field_test.rb → unit/directive_password_field_test.rb} +2 -2
- data/test/{replace_test.rb → unit/directive_replace_test.rb} +2 -2
- data/test/{stylesheet_link_test.rb → unit/directive_stylesheet_link_test.rb} +2 -2
- data/test/{submit_test.rb → unit/directive_submit_test.rb} +2 -2
- data/test/{text_area_test.rb → unit/directive_text_area_test.rb} +2 -2
- data/test/{text_field_test.rb → unit/directive_text_field_test.rb} +2 -2
- data/test/{example_test.rb → unit/example_test.rb} +1 -1
- data/test/unit/file_mio_test.rb +368 -0
- data/test/{filter_helpers_test.rb → unit/filter_helpers_test.rb} +1 -1
- data/test/unit/keyword_expander_test.rb +95 -0
- data/test/unit/mio_test.rb +110 -0
- data/test/unit/mtime_string_hash_mio_tree_test.rb +289 -0
- data/test/unit/mtime_tracking_hash_test.rb +38 -0
- data/test/{parser_test.rb → unit/parser_test.rb} +19 -1
- data/test/unit/pathname_extensions_test.rb +46 -0
- data/test/{run_parser_test.rb → unit/run_parser_test.rb} +7 -3
- data/test/unit/string_hash_mio_test.rb +320 -0
- data/test/unit/template_file_watcher_test.rb +107 -0
- data/test/{template_spec_test.rb → unit/template_spec_test.rb} +57 -21
- data/test/{template_test.rb → unit/template_test.rb} +123 -22
- data/test/xtras/config-mv-logger_config.rb +109 -0
- data/test/xtras/config_initialize_standalone.rb +53 -0
- metadata +111 -38
- data/lib/masterview/extras/rails_init.rb +0 -72
- data/test/import_render_test.rb +0 -30
- data/test/template_file_watcher_test.rb +0 -50
@@ -0,0 +1,256 @@
|
|
1
|
+
<html mv:generate="layouts/product.rhtml">
|
2
|
+
<head>
|
3
|
+
<title>Product: {{{= controller.action_name }}}</title>
|
4
|
+
<link rel="stylesheet" type="text/css" href="../../../public/stylesheets/scaffold.css" mv:stylesheet_link="scaffold"/>
|
5
|
+
|
6
|
+
<!--
|
7
|
+
These stylesheets below are for design time use to allow working with only one visible section at a time, especially
|
8
|
+
when trying to use absolute positioning. You may comment/uncomment which ever section you wish to work with.
|
9
|
+
You may comment all of them out to work with all at design time. These stylesheets will not be used at runtime
|
10
|
+
-->
|
11
|
+
<link rel="stylesheet" type="text/css" href="./extra/show_only_new.css" mv:replace=""/>
|
12
|
+
<!-- <link rel="stylesheet" type="text/css" href="./extra/show_only_edit.css" mv:replace=""/> -->
|
13
|
+
<!-- <link rel="stylesheet" type="text/css" href="./extra/show_only_show.css" mv:replace=""/> -->
|
14
|
+
<!-- <link rel="stylesheet" type="text/css" href="./extra/show_only_list.css" mv:replace=""/> -->
|
15
|
+
<!-- <link rel="stylesheet" type="text/css" href="./extra/show_only_destroy.css" mv:replace=""/> -->
|
16
|
+
|
17
|
+
<script type="text/javascript" src="../../../public/javascripts/prototype.js" mv:javascript_include=":defaults"></script>
|
18
|
+
<script type="text/javascript" src="../../../public/javascripts/effects.js" mv:replace=""></script>
|
19
|
+
<script type="text/javascript" src="../../../public/javascripts/dragdrop.js" mv:replace=""></script>
|
20
|
+
<script type="text/javascript" src="../../../public/javascripts/controls.js" mv:replace=""></script>
|
21
|
+
<script type="text/javascript" src="../../../public/javascripts/application.js" mv:replace=""></script>
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
|
25
|
+
<div class="messages" mv:if="@flash[:notice]" mv:content="@flash[:notice]">
|
26
|
+
messages here - Note: Other divs are hidden at design time, disable extra/show_only_new.css or import different extra/*.css to work with other sections (extra stylesheets are show_only_edit.css, show_only_show.css, show_only_list.css, show_only_destroy.css)
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="main">
|
30
|
+
<div id="product_content" mv:replace="@content_for_layout">
|
31
|
+
<div id="product_new" mv:generate="product/new.rhtml" mv:preview="showOne" class="new_div">
|
32
|
+
<div class="product_new sidebar">
|
33
|
+
<h1>Tasks:</h1>
|
34
|
+
<ul>
|
35
|
+
<li><a class="list_link" href="#" mv:link_to=":action => 'list'">Back to overview</a></li>
|
36
|
+
</ul>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="product_new content">
|
40
|
+
<h1>Products</h1>
|
41
|
+
|
42
|
+
<form mv:form=":action => 'new'">
|
43
|
+
|
44
|
+
<div class="form">
|
45
|
+
<h2>Creating product</h2>
|
46
|
+
|
47
|
+
<div id="product_form" mv:gen_partial=":partial => 'product/form'">
|
48
|
+
<div class="error_messages" mv:replace="error_messages_for :product">
|
49
|
+
error messages
|
50
|
+
</div>
|
51
|
+
<br/>
|
52
|
+
<!--[form:product]-->
|
53
|
+
<div class="form_div product_form_div">
|
54
|
+
|
55
|
+
<div class="record">
|
56
|
+
<div class="label"><label for="product_name">Name:</label></div>
|
57
|
+
<div class="field"><input type="text" name="product_name" mv:text_field="'product', 'name'"/></div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="record">
|
61
|
+
<div class="label"><label for="product_description">Description:</label></div>
|
62
|
+
<div class="field"><textarea name="product_description" rows="5" mv:text_area="'product', 'description'"></textarea></div>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div class="record">
|
66
|
+
<div class="label"><label for="product_cost">Cost:</label></div>
|
67
|
+
<div class="field"><input type="text" name="product_cost" mv:text_field="'product', 'cost'"/></div>
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<div class="record">
|
71
|
+
<div class="label"><label for="product_price">Price:</label></div>
|
72
|
+
<div class="field"><input type="text" name="product_price" mv:text_field="'product', 'price'"/></div>
|
73
|
+
</div>
|
74
|
+
|
75
|
+
</div>
|
76
|
+
<!--[eoform:product]-->
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<br/>
|
83
|
+
<div class="product_new operations">
|
84
|
+
<input type="submit" value="OK" class="primary save_button" mv:submit=""/>
|
85
|
+
<input type="button" value="Cancel" class="cancel_button" style="width: auto;" onclick="window.location.href = '{{{= url_for :action => %q{list} }}}';" />
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</form>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
<div id="product_edit" mv:generate="product/edit.rhtml" mv:preview="showOne" class="edit_div">
|
94
|
+
<div class="product_edit sidebar">
|
95
|
+
<h1>Tasks:</h1>
|
96
|
+
<ul>
|
97
|
+
<li><a class="list_link" href="#" mv:link_to=":action => 'list'">Back to overview</a></li>
|
98
|
+
</ul>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<div class="product_edit content">
|
102
|
+
<h1>Products</h1>
|
103
|
+
|
104
|
+
<form mv:form=":action => 'edit', :id => @product.id">
|
105
|
+
|
106
|
+
<div class="form">
|
107
|
+
<h2>Editing product</h2>
|
108
|
+
<div mv:replace="render :partial => 'form'" mv:preview="copyOf:product_form">
|
109
|
+
copyOf:product_form
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<br/>
|
114
|
+
<div class="product_edit operations">
|
115
|
+
<input type="submit" value="OK" class="primary save_button" mv:submit=""/>
|
116
|
+
<input type="button" value="Cancel" class="cancel_button" style="width: auto;" onclick="window.location.href = '{{{= url_for :action => %q{list} }}}';" /> </div>
|
117
|
+
|
118
|
+
</form>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
<div id="product_list" mv:generate="product/list.rhtml" mv:preview="showOne" class="list_div">
|
124
|
+
<div class="product_list sidebar">
|
125
|
+
<h1>Tasks:</h1>
|
126
|
+
<ul>
|
127
|
+
<li><a class="new_link" href="#" mv:link_to=":action => 'new'">Create new product</a></li>
|
128
|
+
</ul>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div class="product_list content">
|
132
|
+
<h1>Products</h1>
|
133
|
+
|
134
|
+
<div class="list">
|
135
|
+
<table border="1" class="product_list_table" cellpadding="5">
|
136
|
+
<tr>
|
137
|
+
<!--[listhead:product]-->
|
138
|
+
<th class="th_name">Name</th>
|
139
|
+
<th class="th_description">Description</th>
|
140
|
+
<th class="th_cost">Cost</th>
|
141
|
+
<th class="th_price">Price</th>
|
142
|
+
<!--[eolisthead:product]-->
|
143
|
+
|
144
|
+
</tr>
|
145
|
+
<tr mv:gen_partial=":partial => 'product/product', :collection => @products">
|
146
|
+
<!--[listline:product]-->
|
147
|
+
|
148
|
+
<td class="td_name" mv:content="h product.send(:name)">product Name</td>
|
149
|
+
<td class="td_description" mv:content="h product.send(:description)">product Description</td>
|
150
|
+
<td class="td_cost" mv:content="h product.send(:cost)">product Cost</td>
|
151
|
+
<td class="td_price" mv:content="h product.send(:price)">product Price</td>
|
152
|
+
<td><a class="show_link" href="#" mv:link_to=":action => 'show', :id => product">Show</a></td>
|
153
|
+
<td><a class="edit_link" href="#" mv:link_to=":action => 'edit', :id => product">Edit</a></td>
|
154
|
+
<td><a class="destroy_link" href="#" mv:link_to=":action => 'destroy', :id => product">Destroy</a></td>
|
155
|
+
|
156
|
+
<!--[eolistline:product]-->
|
157
|
+
|
158
|
+
</tr>
|
159
|
+
</table>
|
160
|
+
|
161
|
+
<a class="previous_link" href="#" mv:if="@product_pages.current.previous" mv:link_to=":page => @product_pages.current.previous">Previous page</a>
|
162
|
+
<a class="next_link" href="#" mv:if="@product_pages.current.next" mv:link_to=":page => @product_pages.current.next">Next page</a>
|
163
|
+
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
|
169
|
+
<div id="product_show" mv:generate="product/show.rhtml" mv:preview="showOne" class="show_div">
|
170
|
+
<div class="product_show sidebar">
|
171
|
+
<h1>Tasks:</h1>
|
172
|
+
<ul>
|
173
|
+
<li><a class="list_link" href="#" mv:link_to=":action => 'list'">Back to overview</a></li>
|
174
|
+
<li><a class="edit_link" href="#" mv:link_to=":action => 'edit', :id => @product.id">Edit this product</a></li>
|
175
|
+
</ul>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div class="product_show content">
|
179
|
+
<h1>Products</h1>
|
180
|
+
|
181
|
+
<div id="product_show_partial" class="form" mv:gen_partial=":partial => 'product/show'">
|
182
|
+
<!--[show:product]-->
|
183
|
+
<div class="show_div product_show_div">
|
184
|
+
|
185
|
+
<div class="record">
|
186
|
+
<div class="label"><label>Name:</label></div>
|
187
|
+
<div class="field" mv:content="h @product.send(:name)">product Name</div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
<div class="record">
|
191
|
+
<div class="label"><label>Description:</label></div>
|
192
|
+
<div class="field" mv:content="h @product.send(:description)">product Description</div>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div class="record">
|
196
|
+
<div class="label"><label>Cost:</label></div>
|
197
|
+
<div class="field" mv:content="h @product.send(:cost)">product Cost</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div class="record">
|
201
|
+
<div class="label"><label>Price:</label></div>
|
202
|
+
<div class="field" mv:content="h @product.send(:price)">product Price</div>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
</div><!--[eoshow:product]-->
|
206
|
+
|
207
|
+
</div>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div id="product_destroy" mv:generate="product/destroy.rhtml" mv:preview="showOne" class="destroy_div">
|
213
|
+
<div class="product_destroy sidebar">
|
214
|
+
<h1>Tasks:</h1>
|
215
|
+
<ul>
|
216
|
+
<li><a class="list_link" href="#" mv:link_to=":action => 'list'">Back to overview</a></li>
|
217
|
+
<li><a class="show_link" href="#" mv:link_to=":action => 'show', :id => @product.id">Show this product</a></li>
|
218
|
+
</ul>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="product_destroy content">
|
222
|
+
<h1>Products</h1>
|
223
|
+
|
224
|
+
<div class="error_messages" mv:replace="error_messages_for :product">
|
225
|
+
error messages
|
226
|
+
</div>
|
227
|
+
|
228
|
+
<div class="messages">Are you sure you want to delete this item?</div>
|
229
|
+
<br/>
|
230
|
+
<form mv:form=":action => 'destroy', :id => @product.id">
|
231
|
+
<div mv:replace="render :partial => 'show'" mv:preview="copyOf:product_show_partial">
|
232
|
+
copyOf:product_show_partial
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<br/>
|
236
|
+
<div class="product_edit operations">
|
237
|
+
<input type="submit" value="Delete" mv:submit="" class="save_button"/>
|
238
|
+
<input type="button" value="Cancel" class="cancel_button" style="width: auto;" onclick="window.location.href = '{{{= url_for :action => %q{list} }}}';" />
|
239
|
+
</div>
|
240
|
+
</form>
|
241
|
+
</div>
|
242
|
+
</div>
|
243
|
+
</div>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
<script type="text/javascript" mv:replace="" src="./extra/mvpreview.js"></script>
|
247
|
+
<script type="text/javascript" mv:replace="">
|
248
|
+
mvpreview.preparePage( 'product', {showOneSection: 'product_list' } );
|
249
|
+
</script>
|
250
|
+
|
251
|
+
</body>
|
252
|
+
</html>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Product: <%= controller.action_name %></title>
|
4
|
+
<%= stylesheet_link_tag 'scaffold' %>
|
5
|
+
|
6
|
+
<!--
|
7
|
+
These stylesheets below are for design time use to allow working with only one visible section at a time, especially
|
8
|
+
when trying to use absolute positioning. You may comment/uncomment which ever section you wish to work with.
|
9
|
+
You may comment all of them out to work with all at design time. These stylesheets will not be used at runtime
|
10
|
+
-->
|
11
|
+
|
12
|
+
<!-- <link rel="stylesheet" type="text/css" href="./extra/show_only_edit.css" mv:replace=""/> -->
|
13
|
+
<!-- <link rel="stylesheet" type="text/css" href="./extra/show_only_show.css" mv:replace=""/> -->
|
14
|
+
<!-- <link rel="stylesheet" type="text/css" href="./extra/show_only_list.css" mv:replace=""/> -->
|
15
|
+
<!-- <link rel="stylesheet" type="text/css" href="./extra/show_only_destroy.css" mv:replace=""/> -->
|
16
|
+
|
17
|
+
<%= javascript_include_tag :defaults %>
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
|
25
|
+
<% if @flash[:notice] %><div class="messages"><%= @flash[:notice] %></div><% end %>
|
26
|
+
|
27
|
+
<div class="main">
|
28
|
+
<%= @content_for_layout %>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
</body>
|
35
|
+
</html>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<div id="product_form">
|
2
|
+
<%= error_messages_for :product %>
|
3
|
+
<br />
|
4
|
+
<!-- [form:product] -->
|
5
|
+
<div class="form_div product_form_div">
|
6
|
+
|
7
|
+
<div class="record">
|
8
|
+
<div class="label"><label for="product_name">Name:</label></div>
|
9
|
+
<div class="field"><%= text_field 'product', 'name' %></div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="record">
|
13
|
+
<div class="label"><label for="product_description">Description:</label></div>
|
14
|
+
<div class="field"><%= text_area 'product', 'description', :rows => 5 %></div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="record">
|
18
|
+
<div class="label"><label for="product_cost">Cost:</label></div>
|
19
|
+
<div class="field"><%= text_field 'product', 'cost' %></div>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="record">
|
23
|
+
<div class="label"><label for="product_price">Price:</label></div>
|
24
|
+
<div class="field"><%= text_field 'product', 'price' %></div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
<!-- [eoform:product] -->
|
29
|
+
|
30
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<tr>
|
2
|
+
<!-- [listline:product] -->
|
3
|
+
|
4
|
+
<td class="td_name"><%= h product.send(:name) %></td>
|
5
|
+
<td class="td_description"><%= h product.send(:description) %></td>
|
6
|
+
<td class="td_cost"><%= h product.send(:cost) %></td>
|
7
|
+
<td class="td_price"><%= h product.send(:price) %></td>
|
8
|
+
<td><%= link_to 'Show', :action => 'show', :id => product %></td>
|
9
|
+
<td><%= link_to 'Edit', :action => 'edit', :id => product %></td>
|
10
|
+
<td><%= link_to 'Destroy', :action => 'destroy', :id => product %></td>
|
11
|
+
|
12
|
+
<!-- [eolistline:product] -->
|
13
|
+
|
14
|
+
</tr>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<div class="form" id="product_show_partial">
|
2
|
+
<!-- [show:product] -->
|
3
|
+
<div class="show_div product_show_div">
|
4
|
+
|
5
|
+
<div class="record">
|
6
|
+
<div class="label"><label>Name:</label></div>
|
7
|
+
<div class="field"><%= h @product.send(:name) %></div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="record">
|
11
|
+
<div class="label"><label>Description:</label></div>
|
12
|
+
<div class="field"><%= h @product.send(:description) %></div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="record">
|
16
|
+
<div class="label"><label>Cost:</label></div>
|
17
|
+
<div class="field"><%= h @product.send(:cost) %></div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="record">
|
21
|
+
<div class="label"><label>Price:</label></div>
|
22
|
+
<div class="field"><%= h @product.send(:price) %></div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
</div><!-- [eoshow:product] -->
|
26
|
+
|
27
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<div class="destroy_div" id="product_destroy" mv:preview="showOne">
|
2
|
+
<div class="product_destroy sidebar">
|
3
|
+
<h1>Tasks:</h1>
|
4
|
+
<ul>
|
5
|
+
<li><%= link_to 'Back to overview', :action => 'list' %></li>
|
6
|
+
<li><%= link_to 'Show this product', :action => 'show', :id => @product.id %></li>
|
7
|
+
</ul>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="product_destroy content">
|
11
|
+
<h1>Products</h1>
|
12
|
+
|
13
|
+
<%= error_messages_for :product %>
|
14
|
+
|
15
|
+
<div class="messages">Are you sure you want to delete this item?</div>
|
16
|
+
<br />
|
17
|
+
<%= form_tag :action => 'destroy', :id => @product.id %>
|
18
|
+
<%= render :partial => 'show' %>
|
19
|
+
|
20
|
+
<br />
|
21
|
+
<div class="product_edit operations">
|
22
|
+
<%= submit_tag 'Delete' %>
|
23
|
+
<input class="cancel_button" onclick="window.location.href = '<%= url_for :action => %q{list} %>';" style="width: auto;" type="button" value="Cancel" />
|
24
|
+
</div>
|
25
|
+
<%= end_form_tag %>
|
26
|
+
</div>
|
27
|
+
</div>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div class="edit_div" id="product_edit" mv:preview="showOne">
|
2
|
+
<div class="product_edit sidebar">
|
3
|
+
<h1>Tasks:</h1>
|
4
|
+
<ul>
|
5
|
+
<li><%= link_to 'Back to overview', :action => 'list' %></li>
|
6
|
+
</ul>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="product_edit content">
|
10
|
+
<h1>Products</h1>
|
11
|
+
|
12
|
+
<%= form_tag :action => 'edit', :id => @product.id %>
|
13
|
+
|
14
|
+
<div class="form">
|
15
|
+
<h2>Editing product</h2>
|
16
|
+
<%= render :partial => 'form' %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<br />
|
20
|
+
<div class="product_edit operations">
|
21
|
+
<%= submit_tag 'OK' %>
|
22
|
+
<input class="cancel_button" onclick="window.location.href = '<%= url_for :action => %q{list} %>';" style="width: auto;" type="button" value="Cancel" /> </div>
|
23
|
+
|
24
|
+
<%= end_form_tag %>
|
25
|
+
</div>
|
26
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div class="list_div" id="product_list" mv:preview="showOne">
|
2
|
+
<div class="product_list sidebar">
|
3
|
+
<h1>Tasks:</h1>
|
4
|
+
<ul>
|
5
|
+
<li><%= link_to 'Create new product', :action => 'new' %></li>
|
6
|
+
</ul>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="product_list content">
|
10
|
+
<h1>Products</h1>
|
11
|
+
|
12
|
+
<div class="list">
|
13
|
+
<table border="1" cellpadding="5" class="product_list_table">
|
14
|
+
<tr>
|
15
|
+
<!-- [listhead:product] -->
|
16
|
+
<th class="th_name">Name</th>
|
17
|
+
<th class="th_description">Description</th>
|
18
|
+
<th class="th_cost">Cost</th>
|
19
|
+
<th class="th_price">Price</th>
|
20
|
+
<!-- [eolisthead:product] -->
|
21
|
+
|
22
|
+
</tr>
|
23
|
+
<%= render( :partial => 'product/product', :collection => @products ) %>
|
24
|
+
</table>
|
25
|
+
|
26
|
+
<% if @product_pages.current.previous %><%= link_to 'Previous page', :page => @product_pages.current.previous %><% end %>
|
27
|
+
<% if @product_pages.current.next %><%= link_to 'Next page', :page => @product_pages.current.next %><% end %>
|
28
|
+
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div class="new_div" id="product_new" mv:preview="showOne">
|
2
|
+
<div class="product_new sidebar">
|
3
|
+
<h1>Tasks:</h1>
|
4
|
+
<ul>
|
5
|
+
<li><%= link_to 'Back to overview', :action => 'list' %></li>
|
6
|
+
</ul>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="product_new content">
|
10
|
+
<h1>Products</h1>
|
11
|
+
|
12
|
+
<%= form_tag :action => 'new' %>
|
13
|
+
|
14
|
+
<div class="form">
|
15
|
+
<h2>Creating product</h2>
|
16
|
+
|
17
|
+
<%= render( :partial => 'product/form' ) %>
|
18
|
+
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<br />
|
22
|
+
<div class="product_new operations">
|
23
|
+
<%= submit_tag 'OK' %>
|
24
|
+
<input class="cancel_button" onclick="window.location.href = '<%= url_for :action => %q{list} %>';" style="width: auto;" type="button" value="Cancel" />
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<%= end_form_tag %>
|
28
|
+
</div>
|
29
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div class="show_div" id="product_show" mv:preview="showOne">
|
2
|
+
<div class="product_show sidebar">
|
3
|
+
<h1>Tasks:</h1>
|
4
|
+
<ul>
|
5
|
+
<li><%= link_to 'Back to overview', :action => 'list' %></li>
|
6
|
+
<li><%= link_to 'Edit this product', :action => 'edit', :id => @product.id %></li>
|
7
|
+
</ul>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="product_show content">
|
11
|
+
<h1>Products</h1>
|
12
|
+
|
13
|
+
<%= render( :partial => 'product/show' ) %>
|
14
|
+
|
15
|
+
</div>
|
16
|
+
</div>
|