Commit 78c05ad67b0e55b065a27b070ca5218d1b03417a
1 parent
c4de9de0
Exists in
master
and in
22 other branches
ActionItem440: lista embelezada de produtos do empreendimento
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2078 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
9 changed files
with
168 additions
and
45 deletions
Show diff stats
app/helpers/application_helper.rb
| @@ -621,4 +621,15 @@ module ApplicationHelper | @@ -621,4 +621,15 @@ module ApplicationHelper | ||
| 621 | end | 621 | end |
| 622 | end | 622 | end |
| 623 | 623 | ||
| 624 | + def txt2html(txt) | ||
| 625 | + txt. | ||
| 626 | + gsub( /\n\s*\n/, ' <p/> ' ). | ||
| 627 | + gsub( /\n/, ' <br/> ' ). | ||
| 628 | + gsub( /(^|\s)(www\.[^\s])/, '\1http://\2' ). | ||
| 629 | + gsub( /(https?:\/\/([^\s]+))/, | ||
| 630 | + '<a href="\1" target="_blank" rel="nofolow" onclick="return confirm(\'' + | ||
| 631 | + escape_javascript( _('Are you sure you want to visit this web site?') ) + | ||
| 632 | + '\n\n\'+this.href)">\2</a>' ) | ||
| 633 | + end | ||
| 634 | + | ||
| 624 | end | 635 | end |
app/views/catalog/index.rhtml
| 1 | <h1> <%= _('%s:Products/Services') % @profile.name %> </h1> | 1 | <h1> <%= _('%s:Products/Services') % @profile.name %> </h1> |
| 2 | 2 | ||
| 3 | -<table align='center'> | ||
| 4 | - <tr> | ||
| 5 | - <th colspan="2"><%= _('Product/Service') %></th> | ||
| 6 | - <th><%= _('Price') %></th> | ||
| 7 | - </tr> | ||
| 8 | -<% @products.each do |p| %> | ||
| 9 | - <tr> | ||
| 10 | - <td> <%= image_tag p.image.public_filename if p.image %> </td> | ||
| 11 | - <td> <%= link_to p.name, :action => 'show', :id => p %> </td> | ||
| 12 | - <td> <%= p.price || content_tag('em', _('not informed')) %> </th> | ||
| 13 | - </tr> | 3 | +<ul id="product_list"> |
| 4 | +<% @products.each do |product| %> | ||
| 5 | + <li class="product"> | ||
| 6 | + <%= link_to_product product, :class => 'product-pic', :style => 'background-image:url(%s)' % | ||
| 7 | + ( product.image ? product.image.public_filename(:portrait) : '/images/icons-app/product-default-pic-portrait.png' ) %> | ||
| 8 | + <h3> | ||
| 9 | + <%= link_to_product product %> | ||
| 10 | + </h3> | ||
| 11 | + <ul> | ||
| 12 | + <li class="product_price"> <%= _('Price: %s') % ( product.price ? "%.2f" % product.price : content_tag('em', _('not informed')) ) %> </li> | ||
| 13 | + <li class="product_category"> <%= link_to_category(product.product_category) %> </li> | ||
| 14 | + </ul> | ||
| 15 | + <% if product.description %> | ||
| 16 | + <div class="description"> | ||
| 17 | + <%= txt2html product.description %> | ||
| 18 | + <div> | ||
| 19 | + <% else %> | ||
| 20 | + <br style="clear:both" /> | ||
| 21 | + <% end %> | ||
| 22 | + </li> | ||
| 14 | <% end %> | 23 | <% end %> |
| 15 | -</table> | 24 | +<ul> |
| 25 | + |
app/views/catalog/show.rhtml
| 1 | +<div id="show_product"> | ||
| 2 | + | ||
| 1 | <h1> <%= @product.name %> </h1> | 3 | <h1> <%= @product.name %> </h1> |
| 2 | 4 | ||
| 3 | -<table> | ||
| 4 | - <tr> | ||
| 5 | - <td> | ||
| 6 | - <%= image_tag @product.image.public_filename, :style => 'float: left;' if @product.image %> | ||
| 7 | - </td> | ||
| 8 | - <td> | ||
| 9 | - <%= @product.description %> | ||
| 10 | - </td> | ||
| 11 | - </tr> | ||
| 12 | - <tr> | ||
| 13 | - <td colspan="2"> | ||
| 14 | - <ul> | ||
| 15 | - <li> | ||
| 16 | - <strong><%= _('Price:') %></strong> | ||
| 17 | - <%= @product.price || _('not informed') %> | ||
| 18 | - </li> | ||
| 19 | - <li> | ||
| 20 | - <%= _('Category: %s ') % link_to_category(@product.product_category) %> <br/> | ||
| 21 | - </li> | ||
| 22 | - </ul> | ||
| 23 | - </td> | ||
| 24 | - </tr> | ||
| 25 | -</table> | 5 | +<%= image_tag @product.image.public_filename, :class => 'product-pic' if @product.image %> |
| 6 | + | ||
| 7 | +<div class="product_description"> | ||
| 8 | +<%= txt2html @product.description if @product.description %> | ||
| 9 | +</div> | ||
| 26 | 10 | ||
| 11 | +<p class="product_price"> | ||
| 12 | +<%= _('Price: %s') % ( @product.price ? "<strong>%.2f</strong>" % @product.price : content_tag('em', _('not informed')) ) %> | ||
| 13 | +</p> | ||
| 27 | 14 | ||
| 15 | +<p class="product_category"> | ||
| 16 | +<%= _('Category: %s ') % link_to_category(@product.product_category) %> | ||
| 17 | +</p> | ||
| 28 | 18 | ||
| 29 | <% button_bar do %> | 19 | <% button_bar do %> |
| 30 | <%= button :back, _("%s's products/services listing") % profile.name, :action => 'index', :id => nil %> | 20 | <%= button :back, _("%s's products/services listing") % profile.name, :action => 'index', :id => nil %> |
| 31 | <% end %> | 21 | <% end %> |
| 22 | + | ||
| 23 | +</div> |
app/views/content_viewer/_comment.rhtml
| @@ -28,15 +28,6 @@ | @@ -28,15 +28,6 @@ | ||
| 28 | </div> | 28 | </div> |
| 29 | <div class="comment-text"> | 29 | <div class="comment-text"> |
| 30 | <p/> | 30 | <p/> |
| 31 | - <%= | ||
| 32 | - comment.body. | ||
| 33 | - gsub( /\n\s*\n/, ' <p/> ' ). | ||
| 34 | - gsub( /\n/, ' <br/> ' ). | ||
| 35 | - gsub( /(^|\s)(www\.[^\s])/, '\1http://\2' ). | ||
| 36 | - gsub( /(https?:\/\/([^\s]+))/, | ||
| 37 | - '<a href="\1" target="_blank" rel="nofolow" onclick="return confirm(\'' + | ||
| 38 | - escape_javascript( _('Are you sure you want to visit this web site?') ) + | ||
| 39 | - '\n\n\'+this.href)">\2</a>' ) | ||
| 40 | - %> | 31 | + <%= txt2html comment.body %> |
| 41 | </div> | 32 | </div> |
| 42 | </div> | 33 | </div> |
public/designs/themes/ecosol/stylesheets/controller_catalog.css
0 → 100644
| @@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
| 1 | + | ||
| 2 | +/* * * List Products * * * * * * * * * * * * */ | ||
| 3 | + | ||
| 4 | +#content #product_list li { | ||
| 5 | + list-style-image: none; | ||
| 6 | +} | ||
| 7 | + | ||
| 8 | +#content #product_list li.product { | ||
| 9 | + border: none; | ||
| 10 | + background: #B8CFE7; | ||
| 11 | + -moz-border-radius: 15px; | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +/* * * Show Product * * * * * * * * * * * * */ | ||
| 15 | + | ||
| 16 | +#show_product .product-pic { | ||
| 17 | + border: 1px solid #027; | ||
| 18 | +} | ||
| 19 | + |
public/designs/themes/zen3/stylesheets/controller_catalog.css
0 → 100644
| @@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
| 1 | + | ||
| 2 | +/* * * List Products * * * * * * * * * * * * */ | ||
| 3 | + | ||
| 4 | +#content #product_list li { | ||
| 5 | + list-style-image: none; | ||
| 6 | +} | ||
| 7 | + | ||
| 8 | +#content #product_list li.product { | ||
| 9 | + border: none; | ||
| 10 | + background: #FFE890; | ||
| 11 | + -moz-border-radius: 15px; | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +/* * * Show Product * * * * * * * * * * * * */ | ||
| 15 | + | ||
| 16 | +#show_product .product-pic { | ||
| 17 | + border: 1px solid #930; | ||
| 18 | +} | ||
| 19 | + |
5.15 KB
9.38 KB
| @@ -0,0 +1,81 @@ | @@ -0,0 +1,81 @@ | ||
| 1 | + | ||
| 2 | +/* * * List Products * * * * * * * * * * * * */ | ||
| 3 | + | ||
| 4 | +#product_list { | ||
| 5 | + margin: 0px; | ||
| 6 | + padding: 0px; | ||
| 7 | +} | ||
| 8 | + | ||
| 9 | +#product_list ul { | ||
| 10 | + margin: 0px; | ||
| 11 | + padding: 0px; | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +#content #product_list li { | ||
| 15 | + margin: 0px; | ||
| 16 | + padding: 0px; | ||
| 17 | + list-style: none; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +#content #product_list li.product { | ||
| 21 | + border: 1px solid #888; | ||
| 22 | + margin-bottom: 10px; | ||
| 23 | + padding: 5px 10px; | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +#product_list .product-pic { | ||
| 27 | + display: block; | ||
| 28 | + width: 64px; | ||
| 29 | + height: 64px; | ||
| 30 | + background-repeat: no-repeat; | ||
| 31 | + background-position: 50% 50%; | ||
| 32 | + float: left; | ||
| 33 | + margin-right: 15px; | ||
| 34 | + position: relative; /* work arround msie bug */ | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +#product_list .product-pic span { | ||
| 38 | + display: none; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +#content #product_list h3 { | ||
| 42 | + margin: 0px; | ||
| 43 | + padding: 0px; | ||
| 44 | + font-size: 120%; | ||
| 45 | +} | ||
| 46 | +.msie #content #product_list h3 { | ||
| 47 | + margin-top: -15px; | ||
| 48 | +} | ||
| 49 | +#product_list h3 a { | ||
| 50 | + text-decoration: none; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +#product_list .product_category { | ||
| 54 | + font-size: 11px; | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +#product_list .description { | ||
| 58 | + clear: left; | ||
| 59 | + font-size: 11px; | ||
| 60 | + text-align: justify; | ||
| 61 | + padding: 5px 10px 0px 10px; | ||
| 62 | +} | ||
| 63 | +.msie #product_list .description { | ||
| 64 | + padding: 5px 10px 10px 10px; | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +/* * * Show Product * * * * * * * * * * * * */ | ||
| 68 | + | ||
| 69 | +#show_product .product-pic { | ||
| 70 | + float: left; | ||
| 71 | + margin-right: 15px; | ||
| 72 | + border: 1px solid #444; | ||
| 73 | + padding: 2px; | ||
| 74 | + background: #FFF; | ||
| 75 | +} | ||
| 76 | + | ||
| 77 | +#show_product .product_category { | ||
| 78 | + padding-top: 10px; | ||
| 79 | + clear: left; | ||
| 80 | +} | ||
| 81 | + |