This repository has been archived by the owner on Mar 29, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding more polished admin interface for products
git-svn-id: https://svn.trike.com.au/code/radiant/extensions/shopping_trike@77 dec4ba91-d232-0410-a499-b0f1e7490611
- Loading branch information
gerrit
committed
Mar 12, 2008
1 parent
ad5250e
commit 870be22
Showing
6 changed files
with
108 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class Admin::ProductController < Admin::AbstractModelController | ||
model_class Product | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<% if @product.new_record? -%> | ||
<h1>New Product</h1> | ||
<% else -%> | ||
<h1>Edit Product</h1> | ||
<% end -%> | ||
|
||
<form method="post" action=""> | ||
<table class="fieldset"> | ||
<tbody> | ||
<tr> | ||
<td class="label"><label for="product_code">Code</label></td> | ||
<td class="field"><%= text_field :product, :code, :size => 100, :class => 'textbox' %></td> | ||
<td class="help">Required. Only numbers an letters allowed</td> | ||
</tr> | ||
<tr> | ||
<td class="label"><label class="optional" for="product_description">Description</label></td> | ||
<td class="field"><%= text_area :product, :description, :size => '40x4' %></td> | ||
<td class="help">Optional</td> | ||
</tr> | ||
<tr> | ||
<td class="label"><label for="product_price">Price</label></td> | ||
<td class="field"><%= text_field :product, :price %></td> | ||
<td class="help">Required, has to be > 0.01</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<p class="buttons"> | ||
<%= save_model_button(@product) %> | ||
<%= save_model_and_continue_editing_button(@product) %> | ||
or <%= link_to "Cancel", product_index_url %> | ||
</p> | ||
|
||
</form> | ||
|
||
<%= focus 'product_code' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<h1>Products</h1> | ||
<table id="products" class="index"> | ||
<thead> | ||
<tr> | ||
<th>Code</th> | ||
<th>Description</th> | ||
<th>Price</th> | ||
<th>Modify</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% unless @products.empty? -%> | ||
<% for product in @products %> | ||
<tr class="node"> | ||
<td class="code"><%= link_to h(product.code), product_edit_path(:id => product) %></td> | ||
<td class="description"><%= link_to product.description, product_edit_path(:id => product) %></td> | ||
<td><%=h product.price %></td> | ||
<td class="remove"> | ||
<%= link_to image_tag("admin/remove.png", :alt => 'Remove Product'), | ||
product_remove_path(:id => product) %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
<% else %> | ||
<tr> | ||
<td colspan="4" class="note">No Products</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<script type="text/javascript"> | ||
// <![CDATA[ | ||
new RuledTable('products'); | ||
// ]]> | ||
</script> | ||
|
||
<p> | ||
<%= link_to 'New product', product_new_url %> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<h1>Remove Product</h1> | ||
<p>Are you sure you want to <strong class="warning">permanently remove</strong> | ||
the following product?</p> | ||
|
||
<table id="products" class="index"> | ||
<tbody> | ||
<tr class="node level-1" | ||
onmouseover="Element.addClassName(this, 'highlight');" | ||
onmouseout="Element.removeClassName(this, 'highlight');"> | ||
<td class="code"><%= link_to h(@product.code), product_edit_path(:id => @product) %></td> | ||
<td class="description"><%= link_to @product.description, product_edit_path(:id => @product) %></td> | ||
<td><%=h @product.price %></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<form method="post" action=""> | ||
<p class="buttons"><%= submit_tag "Delete Product", :class => 'button' %> | ||
or <%= link_to 'Cancel', product_index_path %></p> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters