Commit 057e255f7e9dab54a716a495dc3dcf511461b135

Authored by Victor Costa
1 parent de437f75

rails3: rename *.rhtml to *.html.erb

app/views/comment/_comment.html.erb 0 → 100644
@@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
  1 +<li id="<%= comment.anchor %>" class="article-comment">
  2 + <div class="article-comment-inner">
  3 +
  4 + <div class="comment-content comment-logged-<%= comment.author ? 'in' : 'out' %> <%= 'comment-from-owner' if ( comment.author && (profile == comment.author) ) %>">
  5 +
  6 + <% if comment.author %>
  7 + <%= link_to image_tag(profile_icon(comment.author, :minor)) +
  8 + content_tag('span', comment.author_name, :class => 'comment-info'),
  9 + comment.author.url,
  10 + :class => 'comment-picture',
  11 + :title => comment.author_name
  12 + %>
  13 + <% else %>
  14 + <% url_image, status_class = comment.author_id ?
  15 + [comment.removed_user_image, 'icon-user-removed'] :
  16 + [gravatar_profile_image_url( comment.email, :size => 50, :d=>404 ), 'icon-user-unknown'] %>
  17 +
  18 + <%= link_to(
  19 + image_tag(url_image, :onerror=>'gravatarCommentFailback(this)',
  20 + 'data-gravatar'=>gravatar_profile_image_url(comment.email, :size=>50)) +
  21 + content_tag('span', comment.author_name, :class => 'comment-info') +
  22 + content_tag('span', comment.message,
  23 + :class => 'comment-user-status ' + status_class),
  24 + gravatar_profile_url(comment.email),
  25 + :target => '_blank',
  26 + :class => 'comment-picture',
  27 + :title => '%s %s' % [comment.author_name, comment.message]
  28 + )%>
  29 + <% end %>
  30 +
  31 + <% comment_balloon do %>
  32 +
  33 + <div class="comment-details">
  34 + <div class="comment-header">
  35 + <ul>
  36 + <div class="comment-actions">
  37 + <%= comment_actions(comment) %>
  38 + </div>
  39 + </ul>
  40 + <% unless comment.spam? %>
  41 + <%= link_to_function '',
  42 + "var f = add_comment_reply_form(this, %s); f.find('comment_title, textarea').val(''); return false" % comment.id,
  43 + :class => 'comment-footer comment-footer-link comment-footer-hide comment-actions-reply button',
  44 + :id => 'comment-reply-to-' + comment.id.to_s,
  45 + :title => _('Reply')
  46 + %>
  47 + <% end %>
  48 + </div>
  49 +
  50 + <div class="comment-created-at">
  51 + <%= show_time(comment.created_at) %>
  52 + </div>
  53 + <h4><%= comment.title.blank? && '&nbsp;' || comment.title %></h4>
  54 + <div class="comment-text">
  55 + <p/>
  56 + <%= txt2html comment.body %>
  57 + </div>
  58 + </div>
  59 +
  60 + <div class="comment_reply post_comment_box closed" id="comment_reply_to_<%= comment.id %>">
  61 + <% if @comment && @comment.errors.any? && @comment.reply_of_id.to_i == comment.id %>
  62 + <%= error_messages_for :comment %>
  63 + <script type="text/javascript">
  64 + jQuery(function() {
  65 + document.location.href = '#<%= comment.anchor %>';
  66 + add_comment_reply_form('#comment-reply-to-<%= comment.id %>', <%= comment.id %>);
  67 + });
  68 + </script>
  69 + <% end %>
  70 + </div>
  71 +
  72 + <% end %>
  73 +
  74 + </div>
  75 +
  76 + <% unless comment.replies.blank? || comment.spam? %>
  77 + <ul class="comment-replies">
  78 + <% comment.replies.each do |reply| %>
  79 + <%= render :partial => 'comment/comment', :locals => { :comment => reply } %>
  80 + <% end %>
  81 + </ul>
  82 + <% end %>
  83 +
  84 + </div>
  85 +</li>
app/views/comment/_comment.rhtml
@@ -1,85 +0,0 @@ @@ -1,85 +0,0 @@
1 -<li id="<%= comment.anchor %>" class="article-comment">  
2 - <div class="article-comment-inner">  
3 -  
4 - <div class="comment-content comment-logged-<%= comment.author ? 'in' : 'out' %> <%= 'comment-from-owner' if ( comment.author && (profile == comment.author) ) %>">  
5 -  
6 - <% if comment.author %>  
7 - <%= link_to image_tag(profile_icon(comment.author, :minor)) +  
8 - content_tag('span', comment.author_name, :class => 'comment-info'),  
9 - comment.author.url,  
10 - :class => 'comment-picture',  
11 - :title => comment.author_name  
12 - %>  
13 - <% else %>  
14 - <% url_image, status_class = comment.author_id ?  
15 - [comment.removed_user_image, 'icon-user-removed'] :  
16 - [gravatar_profile_image_url( comment.email, :size => 50, :d=>404 ), 'icon-user-unknown'] %>  
17 -  
18 - <%= link_to(  
19 - image_tag(url_image, :onerror=>'gravatarCommentFailback(this)',  
20 - 'data-gravatar'=>gravatar_profile_image_url(comment.email, :size=>50)) +  
21 - content_tag('span', comment.author_name, :class => 'comment-info') +  
22 - content_tag('span', comment.message,  
23 - :class => 'comment-user-status ' + status_class),  
24 - gravatar_profile_url(comment.email),  
25 - :target => '_blank',  
26 - :class => 'comment-picture',  
27 - :title => '%s %s' % [comment.author_name, comment.message]  
28 - )%>  
29 - <% end %>  
30 -  
31 - <% comment_balloon do %>  
32 -  
33 - <div class="comment-details">  
34 - <div class="comment-header">  
35 - <ul>  
36 - <div class="comment-actions">  
37 - <%= comment_actions(comment) %>  
38 - </div>  
39 - </ul>  
40 - <% unless comment.spam? %>  
41 - <%= link_to_function '',  
42 - "var f = add_comment_reply_form(this, %s); f.find('comment_title, textarea').val(''); return false" % comment.id,  
43 - :class => 'comment-footer comment-footer-link comment-footer-hide comment-actions-reply button',  
44 - :id => 'comment-reply-to-' + comment.id.to_s,  
45 - :title => _('Reply')  
46 - %>  
47 - <% end %>  
48 - </div>  
49 -  
50 - <div class="comment-created-at">  
51 - <%= show_time(comment.created_at) %>  
52 - </div>  
53 - <h4><%= comment.title.blank? && '&nbsp;' || comment.title %></h4>  
54 - <div class="comment-text">  
55 - <p/>  
56 - <%= txt2html comment.body %>  
57 - </div>  
58 - </div>  
59 -  
60 - <div class="comment_reply post_comment_box closed" id="comment_reply_to_<%= comment.id %>">  
61 - <% if @comment && @comment.errors.any? && @comment.reply_of_id.to_i == comment.id %>  
62 - <%= error_messages_for :comment %>  
63 - <script type="text/javascript">  
64 - jQuery(function() {  
65 - document.location.href = '#<%= comment.anchor %>';  
66 - add_comment_reply_form('#comment-reply-to-<%= comment.id %>', <%= comment.id %>);  
67 - });  
68 - </script>  
69 - <% end %>  
70 - </div>  
71 -  
72 - <% end %>  
73 -  
74 - </div>  
75 -  
76 - <% unless comment.replies.blank? || comment.spam? %>  
77 - <ul class="comment-replies">  
78 - <% comment.replies.each do |reply| %>  
79 - <%= render :partial => 'comment/comment', :locals => { :comment => reply } %>  
80 - <% end %>  
81 - </ul>  
82 - <% end %>  
83 -  
84 - </div>  
85 -</li>  
app/views/comment/_comment_form.html.erb 0 → 100644
@@ -0,0 +1,98 @@ @@ -0,0 +1,98 @@
  1 +<% edition_mode = (defined? edition_mode) ? edition_mode : false %>
  2 +<div class="<%= edition_mode ? '' : 'page-comment-form' %>">
  3 +
  4 +<% focus_on = logged_in? ? 'title' : 'name' %>
  5 +
  6 +
  7 +<% if !edition_mode && !pass_without_comment_captcha? %>
  8 + <div id="recaptcha-container" style="display: none">
  9 + <h3><%= _('Please type the two words below') %></h3>
  10 + <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %>
  11 + <% button_bar do %>
  12 + <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %>
  13 + <%= button_to_function :cancel, _('Cancel'), "jQuery.colorbox.close()" %>
  14 + <% end %>
  15 + </div>
  16 +
  17 + <script type="text/javascript">
  18 + jQuery(document).bind('cbox_cleanup', function() {
  19 + jQuery('#recaptcha-container').hide();
  20 + });
  21 + </script>
  22 +<% end %>
  23 +
  24 +<script type="text/javascript">
  25 +function check_captcha(button, confirm_action) {
  26 + <% if edition_mode %>
  27 + return true;
  28 + <% elsif pass_without_comment_captcha? %>
  29 + button.form.confirm.value = 'true';
  30 + button.disabled = true;
  31 + return true;
  32 + <% else %>
  33 + jQuery('#recaptcha-container').show();
  34 + jQuery.colorbox({ inline : true, href : '#recaptcha-container', maxWidth : '600px', maxHeight : '300px' });
  35 + jQuery('#confirm-captcha').unbind('click');
  36 + jQuery('#confirm-captcha').bind('click', function() {
  37 + jQuery.colorbox.close();
  38 + button.form.recaptcha_response_field.value = jQuery('#recaptcha_response_field').val();
  39 + button.form.recaptcha_challenge_field.value = jQuery('#recaptcha_challenge_field').val();
  40 + button.form.confirm.value = 'true';
  41 + button.disabled = false;
  42 + confirm_action(button);
  43 + });
  44 + return false;
  45 + <% end %>
  46 +}
  47 +</script>
  48 +
  49 +<% if @comment && @comment.errors.any? %>
  50 + <%= error_messages_for :comment %>
  51 +<% end %>
  52 +
  53 +<div class="post_comment_box <%= ((defined? show_form) && show_form) ? 'opened' : 'closed' %>">
  54 +
  55 + <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %>
  56 +<% remote_form_for(:comment, comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ? comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %>
  57 +
  58 + <%= required_fields_message %>
  59 +
  60 + <% unless logged_in? %>
  61 +
  62 + <%= required labelled_form_field(_('Name'), f.text_field(:name)) %>
  63 + <%= required labelled_form_field(_('e-mail'), f.text_field(:email)) %>
  64 + <p>
  65 + <%= _('If you are a registered user, you can login and be automatically recognized.') %>
  66 + </p>
  67 +
  68 + <% end %>
  69 +
  70 + <% if !edition_mode && !pass_without_comment_captcha? %>
  71 + <%= hidden_field_tag(:recaptcha_response_field, nil, :id => nil) %>
  72 + <%= hidden_field_tag(:recaptcha_challenge_field, nil, :id => nil) %>
  73 + <% end %>
  74 +
  75 + <%= labelled_form_field(_('Title'), f.text_field(:title)) %>
  76 + <%= required labelled_form_field(_('Enter your comment'), f.text_area(:body, :rows => 5)) %>
  77 +
  78 + <%= hidden_field_tag(:confirm, 'false') %>
  79 + <%= hidden_field_tag(:view, params[:view])%>
  80 + <%= f.hidden_field(:reply_of_id) %>
  81 +
  82 + <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns).collect { |content| instance_eval(&content) }.join("") %>
  83 +
  84 + <% button_bar do %>
  85 + <%= submit_button('add', _('Post comment'), :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %>
  86 + <% if !edition_mode %>
  87 + <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %>
  88 + <% else %>
  89 + <%= button :cancel, _('Cancel'), '#', :onclick => "jQuery.colorbox.close();" %>
  90 + <% end %>
  91 + <% end %>
  92 +<% end %>
  93 +
  94 +
  95 +</div><!-- end class="post_comment_box" -->
  96 +</div><!-- end class="page-comment-form" -->
  97 +
  98 +<%= javascript_include_tag 'comment_form'%>
app/views/comment/_comment_form.rhtml
@@ -1,98 +0,0 @@ @@ -1,98 +0,0 @@
1 -<% edition_mode = (defined? edition_mode) ? edition_mode : false %>  
2 -<div class="<%= edition_mode ? '' : 'page-comment-form' %>">  
3 -  
4 -<% focus_on = logged_in? ? 'title' : 'name' %>  
5 -  
6 -  
7 -<% if !edition_mode && !pass_without_comment_captcha? %>  
8 - <div id="recaptcha-container" style="display: none">  
9 - <h3><%= _('Please type the two words below') %></h3>  
10 - <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %>  
11 - <% button_bar do %>  
12 - <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %>  
13 - <%= button_to_function :cancel, _('Cancel'), "jQuery.colorbox.close()" %>  
14 - <% end %>  
15 - </div>  
16 -  
17 - <script type="text/javascript">  
18 - jQuery(document).bind('cbox_cleanup', function() {  
19 - jQuery('#recaptcha-container').hide();  
20 - });  
21 - </script>  
22 -<% end %>  
23 -  
24 -<script type="text/javascript">  
25 -function check_captcha(button, confirm_action) {  
26 - <% if edition_mode %>  
27 - return true;  
28 - <% elsif pass_without_comment_captcha? %>  
29 - button.form.confirm.value = 'true';  
30 - button.disabled = true;  
31 - return true;  
32 - <% else %>  
33 - jQuery('#recaptcha-container').show();  
34 - jQuery.colorbox({ inline : true, href : '#recaptcha-container', maxWidth : '600px', maxHeight : '300px' });  
35 - jQuery('#confirm-captcha').unbind('click');  
36 - jQuery('#confirm-captcha').bind('click', function() {  
37 - jQuery.colorbox.close();  
38 - button.form.recaptcha_response_field.value = jQuery('#recaptcha_response_field').val();  
39 - button.form.recaptcha_challenge_field.value = jQuery('#recaptcha_challenge_field').val();  
40 - button.form.confirm.value = 'true';  
41 - button.disabled = false;  
42 - confirm_action(button);  
43 - });  
44 - return false;  
45 - <% end %>  
46 -}  
47 -</script>  
48 -  
49 -<% if @comment && @comment.errors.any? %>  
50 - <%= error_messages_for :comment %>  
51 -<% end %>  
52 -  
53 -<div class="post_comment_box <%= ((defined? show_form) && show_form) ? 'opened' : 'closed' %>">  
54 -  
55 - <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %>  
56 -<% remote_form_for(:comment, comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ? comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %>  
57 -  
58 - <%= required_fields_message %>  
59 -  
60 - <% unless logged_in? %>  
61 -  
62 - <%= required labelled_form_field(_('Name'), f.text_field(:name)) %>  
63 - <%= required labelled_form_field(_('e-mail'), f.text_field(:email)) %>  
64 - <p>  
65 - <%= _('If you are a registered user, you can login and be automatically recognized.') %>  
66 - </p>  
67 -  
68 - <% end %>  
69 -  
70 - <% if !edition_mode && !pass_without_comment_captcha? %>  
71 - <%= hidden_field_tag(:recaptcha_response_field, nil, :id => nil) %>  
72 - <%= hidden_field_tag(:recaptcha_challenge_field, nil, :id => nil) %>  
73 - <% end %>  
74 -  
75 - <%= labelled_form_field(_('Title'), f.text_field(:title)) %>  
76 - <%= required labelled_form_field(_('Enter your comment'), f.text_area(:body, :rows => 5)) %>  
77 -  
78 - <%= hidden_field_tag(:confirm, 'false') %>  
79 - <%= hidden_field_tag(:view, params[:view])%>  
80 - <%= f.hidden_field(:reply_of_id) %>  
81 -  
82 - <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns).collect { |content| instance_eval(&content) }.join("") %>  
83 -  
84 - <% button_bar do %>  
85 - <%= submit_button('add', _('Post comment'), :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %>  
86 - <% if !edition_mode %>  
87 - <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %>  
88 - <% else %>  
89 - <%= button :cancel, _('Cancel'), '#', :onclick => "jQuery.colorbox.close();" %>  
90 - <% end %>  
91 - <% end %>  
92 -<% end %>  
93 -  
94 -  
95 -</div><!-- end class="post_comment_box" -->  
96 -</div><!-- end class="page-comment-form" -->  
97 -  
98 -<%= javascript_include_tag 'comment_form'%>  
app/views/comment/edit.html.erb 0 → 100644
app/views/comment/edit.rhtml
app/views/events/_events.html.erb 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +<%= list_events(@date, @events) %>
0 \ No newline at end of file 2 \ No newline at end of file
app/views/events/_events.rhtml
@@ -1 +0,0 @@ @@ -1 +0,0 @@
1 -<%= list_events(@date, @events) %>  
2 \ No newline at end of file 0 \ No newline at end of file
app/views/profile/_more_comments.html.erb 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +<div class='view-more-comments'>
  2 + <%= link_to(_('More'), :profile => @profile.identifier, :controller => 'profile', :action => 'more_comments', :activity => activity, :comment_page => (comment_page + 1)) %>
  3 +</div>
app/views/profile/_more_comments.rhtml
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -<div class='view-more-comments'>  
2 - <%= link_to(_('More'), :profile => @profile.identifier, :controller => 'profile', :action => 'more_comments', :activity => activity, :comment_page => (comment_page + 1)) %>  
3 -</div>  
app/views/profile/_more_replies.html.erb 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +<div class='view-more-replies'>
  2 + <%= link_to(_('More'), :profile => @profile.identifier, :controller => 'profile', :action => 'more_replies', :activity => activity, :comment_page => (comment_page + 1)) %>
  3 +</div>
app/views/profile/_more_replies.rhtml
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -<div class='view-more-replies'>  
2 - <%= link_to(_('More'), :profile => @profile.identifier, :controller => 'profile', :action => 'more_replies', :activity => activity, :comment_page => (comment_page + 1)) %>  
3 -</div>  
app/views/search/_full_product.html.erb 0 → 100644
@@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
  1 +<% extra_content = @plugins.dispatch(:asset_product_extras, product).collect { |content| instance_eval(&content) } %>
  2 +<% extra_properties = @plugins.dispatch(:asset_product_properties, product)%>
  3 +
  4 +<li class="search-product-item <%= 'highlighted' if product.highlighted? %>">
  5 +
  6 + <div class="search-product-item-first-column">
  7 + <%= render :partial => 'search/image', :object => product %>
  8 +
  9 + <% if product.available %>
  10 + <% if product.price && product.price > 0 %>
  11 + <% has_discount = product.discount && product.discount > 0 %>
  12 + <% if product.price %>
  13 + <span class="search-product-price-textid"><%=_("from") if has_discount %></span><%= price_span(product.price, :class => "search-product-price " + (has_discount ? 'with-discount' : '')) %>
  14 + <% if has_discount %>
  15 + <span class="search-product-price-textid"><%=_("by")%></span><%= price_span(product.price_with_discount, :class => "search-product-price") %>
  16 + <% end %>
  17 + <% if product.unit %>
  18 + <span class="search-product-unit">&nbsp;<%= _('/') %>&nbsp;<%= product.unit.name %></span>
  19 + <% end %>
  20 + <% end %>
  21 + <div class="search-product-inputs-info">
  22 + <% if p = product.percentage_from_solidarity_economy %>
  23 + <div class="search-product-percentage-from-solidarity-economy search-product-ecosol-percentage-icon-<%= p[0].to_s %>"
  24 + title="<%=_('Percentage of inputs from solidarity economy')%>">
  25 + <%= p[1] %>
  26 + </div>
  27 + <% end %>
  28 +
  29 + <% if product.price_described? %>
  30 + <% title = (product.inputs.relevant_to_price + product.price_details).map{ |i|
  31 + '<div class="search-product-input-dots-to-price">' +
  32 + '<div class="search-product-input-name">' + i.name + '</div>' +
  33 + price_span(i.price, :class => 'search-product-input-price') +
  34 + '</div>' }.join('') %>
  35 + <%= link_to_function _("Open Price"), '', :title => title, :class => "search-product-price-details" %>
  36 + <% end %>
  37 + </div>
  38 + <% end %>
  39 + <% else %>
  40 + <span class="product-not-available"><%= _('Not available') %></div>
  41 + <% end %>
  42 +
  43 + </div>
  44 + <div class="search-product-item-second-column">
  45 + <%= link_to_product product, :class => 'search-result-title' %>
  46 + <div class="search-product-supplier">
  47 + <span class="search-field-label"><%= _('Supplier') %> </span><%= link_to_homepage(product.enterprise.name, product.enterprise.identifier) %>
  48 + </div>
  49 + <div class="search-product-description">
  50 + <% if product.description %>
  51 + <% desc_stripped = strip_tags(product.description) %>
  52 + <span class="search-field-label"><%= _('Description') %> </span><%= excerpt(desc_stripped, desc_stripped.first(3), 300) %>
  53 + <% end %>
  54 + </div>
  55 + </div>
  56 + <div class="search-product-item-third-column">
  57 + <div class="search-product-region">
  58 + <% if product.enterprise.region %>
  59 + <span class="search-field-label"><%= _('City') %></span>
  60 + <br /><%= city_with_state(product.enterprise.region) %>
  61 + <% end %>
  62 + </div>
  63 + <div class="search-product-qualifiers">
  64 + <% if product.product_qualifiers.count > 0 %>
  65 + <span class="search-field-label"><%= _('Qualifiers') %></span>
  66 + <% product.product_qualifiers.each do |pq| %>
  67 + <% if pq.qualifier %>
  68 + <span class="search-product-qualifier"><%= pq.qualifier.name + (pq.certifier.nil? ? _(";") : '') %></span>
  69 + <% end %>
  70 + <% if pq.certifier %>
  71 + <span class="search-product-certifier">&nbsp;<%= _('cert. ') + pq.certifier.name + _(";") %></span>
  72 + <% end %>
  73 + <% end %>
  74 + <% end %>
  75 + </div>
  76 + </div>
  77 +
  78 + <div style="clear: both"></div>
  79 +
  80 + <%= extra_content.join('\n') %>
  81 + <% extra_properties.each do |property| %>
  82 + <div><%= property[:name] + ': ' + instance_eval(&property[:content]) %></div>
  83 + <% end %>
  84 +
  85 +</li>
app/views/search/_full_product.rhtml
@@ -1,85 +0,0 @@ @@ -1,85 +0,0 @@
1 -<% extra_content = @plugins.dispatch(:asset_product_extras, product).collect { |content| instance_eval(&content) } %>  
2 -<% extra_properties = @plugins.dispatch(:asset_product_properties, product)%>  
3 -  
4 -<li class="search-product-item <%= 'highlighted' if product.highlighted? %>">  
5 -  
6 - <div class="search-product-item-first-column">  
7 - <%= render :partial => 'search/image', :object => product %>  
8 -  
9 - <% if product.available %>  
10 - <% if product.price && product.price > 0 %>  
11 - <% has_discount = product.discount && product.discount > 0 %>  
12 - <% if product.price %>  
13 - <span class="search-product-price-textid"><%=_("from") if has_discount %></span><%= price_span(product.price, :class => "search-product-price " + (has_discount ? 'with-discount' : '')) %>  
14 - <% if has_discount %>  
15 - <span class="search-product-price-textid"><%=_("by")%></span><%= price_span(product.price_with_discount, :class => "search-product-price") %>  
16 - <% end %>  
17 - <% if product.unit %>  
18 - <span class="search-product-unit">&nbsp;<%= _('/') %>&nbsp;<%= product.unit.name %></span>  
19 - <% end %>  
20 - <% end %>  
21 - <div class="search-product-inputs-info">  
22 - <% if p = product.percentage_from_solidarity_economy %>  
23 - <div class="search-product-percentage-from-solidarity-economy search-product-ecosol-percentage-icon-<%= p[0].to_s %>"  
24 - title="<%=_('Percentage of inputs from solidarity economy')%>">  
25 - <%= p[1] %>  
26 - </div>  
27 - <% end %>  
28 -  
29 - <% if product.price_described? %>  
30 - <% title = (product.inputs.relevant_to_price + product.price_details).map{ |i|  
31 - '<div class="search-product-input-dots-to-price">' +  
32 - '<div class="search-product-input-name">' + i.name + '</div>' +  
33 - price_span(i.price, :class => 'search-product-input-price') +  
34 - '</div>' }.join('') %>  
35 - <%= link_to_function _("Open Price"), '', :title => title, :class => "search-product-price-details" %>  
36 - <% end %>  
37 - </div>  
38 - <% end %>  
39 - <% else %>  
40 - <span class="product-not-available"><%= _('Not available') %></div>  
41 - <% end %>  
42 -  
43 - </div>  
44 - <div class="search-product-item-second-column">  
45 - <%= link_to_product product, :class => 'search-result-title' %>  
46 - <div class="search-product-supplier">  
47 - <span class="search-field-label"><%= _('Supplier') %> </span><%= link_to_homepage(product.enterprise.name, product.enterprise.identifier) %>  
48 - </div>  
49 - <div class="search-product-description">  
50 - <% if product.description %>  
51 - <% desc_stripped = strip_tags(product.description) %>  
52 - <span class="search-field-label"><%= _('Description') %> </span><%= excerpt(desc_stripped, desc_stripped.first(3), 300) %>  
53 - <% end %>  
54 - </div>  
55 - </div>  
56 - <div class="search-product-item-third-column">  
57 - <div class="search-product-region">  
58 - <% if product.enterprise.region %>  
59 - <span class="search-field-label"><%= _('City') %></span>  
60 - <br /><%= city_with_state(product.enterprise.region) %>  
61 - <% end %>  
62 - </div>  
63 - <div class="search-product-qualifiers">  
64 - <% if product.product_qualifiers.count > 0 %>  
65 - <span class="search-field-label"><%= _('Qualifiers') %></span>  
66 - <% product.product_qualifiers.each do |pq| %>  
67 - <% if pq.qualifier %>  
68 - <span class="search-product-qualifier"><%= pq.qualifier.name + (pq.certifier.nil? ? _(";") : '') %></span>  
69 - <% end %>  
70 - <% if pq.certifier %>  
71 - <span class="search-product-certifier">&nbsp;<%= _('cert. ') + pq.certifier.name + _(";") %></span>  
72 - <% end %>  
73 - <% end %>  
74 - <% end %>  
75 - </div>  
76 - </div>  
77 -  
78 - <div style="clear: both"></div>  
79 -  
80 - <%= extra_content.join('\n') %>  
81 - <% extra_properties.each do |property| %>  
82 - <div><%= property[:name] + ': ' + instance_eval(&property[:content]) %></div>  
83 - <% end %>  
84 -  
85 -</li>  
app/views/spam/_comment_spam.html.erb 0 → 100644
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
  1 +<%# FIXME should not need to replicate the article structure like this to be able to use the same formatting as the comments listing %>
  2 +<div id='article'>
  3 + <div class="comments" id="comments_list">
  4 + <ul class="article-comments-list">
  5 + <%= render :partial => 'comment/comment', :collection => @comment_spam %>
  6 + </ul>
  7 + </div>
  8 +</div>
  9 +
  10 +<%= pagination_links @comment_spam, :param_name => :comments_page %>
  11 +
app/views/spam/_comment_spam.rhtml
@@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
1 -<%# FIXME should not need to replicate the article structure like this to be able to use the same formatting as the comments listing %>  
2 -<div id='article'>  
3 - <div class="comments" id="comments_list">  
4 - <ul class="article-comments-list">  
5 - <%= render :partial => 'comment/comment', :collection => @comment_spam %>  
6 - </ul>  
7 - </div>  
8 -</div>  
9 -  
10 -<%= pagination_links @comment_spam, :param_name => :comments_page %>  
11 -  
app/views/spam/_task.html.erb 0 → 100644
@@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
  1 +<div class="task_box" id="task-<%= task.id %>">
  2 + <%= render :partial => 'tasks/task_icon', :locals => {:task => task} %>
  3 + <%= render :partial => 'tasks/task_title', :locals => {:task => task} %>
  4 + <div class="task-information">
  5 + <%= task_information(task) %>
  6 + </div>
  7 +
  8 + <%= yield %> <% # ??? %>
  9 +
  10 + <% button_bar do %>
  11 + <%= button_to_function('new', _('Mark as NOT SPAM'), 'removeTaskBox(this, %s, "%s", "")' % [url_for(:mark_task_as_ham => task.id).to_json, "task-#{task.id}"]) %>
  12 + <%= yield :extra_buttons %>
  13 + <%= button_to_function('delete', _('Remove'), 'removeTaskBox(this, %s, "%s", %s)' % [url_for(:profile => params[:profile], :remove_task => task.id).to_json, "task-#{task.id}", _('Are you sure you want to remove this article suggestion?').to_json]) %>
  14 +
  15 + <% end %>
  16 +
  17 + <%= yield :extra_content %>
  18 +</div>
app/views/spam/_task.rhtml
@@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
1 -<div class="task_box" id="task-<%= task.id %>">  
2 - <%= render :partial => 'tasks/task_icon', :locals => {:task => task} %>  
3 - <%= render :partial => 'tasks/task_title', :locals => {:task => task} %>  
4 - <div class="task-information">  
5 - <%= task_information(task) %>  
6 - </div>  
7 -  
8 - <%= yield %> <% # ??? %>  
9 -  
10 - <% button_bar do %>  
11 - <%= button_to_function('new', _('Mark as NOT SPAM'), 'removeTaskBox(this, %s, "%s", "")' % [url_for(:mark_task_as_ham => task.id).to_json, "task-#{task.id}"]) %>  
12 - <%= yield :extra_buttons %>  
13 - <%= button_to_function('delete', _('Remove'), 'removeTaskBox(this, %s, "%s", %s)' % [url_for(:profile => params[:profile], :remove_task => task.id).to_json, "task-#{task.id}", _('Are you sure you want to remove this article suggestion?').to_json]) %>  
14 -  
15 - <% end %>  
16 -  
17 - <%= yield :extra_content %>  
18 -</div>  
app/views/spam/_task_spam.html.erb 0 → 100644
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
  1 +<% @task_spam.each do |t| %>
  2 + <%= render :partial => partial_for_class(t.class), :locals => { :task => t } %>
  3 +<% end %>
  4 +<%= pagination_links @task_spam, :param_name => :tasks_page %>
app/views/spam/_task_spam.rhtml
@@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
1 -<% @task_spam.each do |t| %>  
2 - <%= render :partial => partial_for_class(t.class), :locals => { :task => t } %>  
3 -<% end %>  
4 -<%= pagination_links @task_spam, :param_name => :tasks_page %>  
app/views/tasks/_approve_comment_accept_details.html.erb 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +<p>
  2 + <b><%= _('Title: ') %></b>
  3 + <%= task.comment.title %>
  4 +</p>
  5 +<p>
  6 + <%= task.comment.body %>
  7 +</p>
app/views/tasks/_approve_comment_accept_details.rhtml
@@ -1,7 +0,0 @@ @@ -1,7 +0,0 @@
1 -<p>  
2 - <b><%= _('Title: ') %></b>  
3 - <%= task.comment.title %>  
4 -</p>  
5 -<p>  
6 - <%= task.comment.body %>  
7 -</p>  
app/views/tasks/_task_icon.html.erb 0 → 100644
@@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
  1 +<%
  2 + icon_info = task.icon
  3 + if icon_info[:type] == :profile_image
  4 + icon = profile_image(icon_info[:profile], :minor)
  5 + elsif icon_info[:type] == :defined_image
  6 + icon = "<img src='#{icon_info[:src]}' alt='#{icon_info[:name]}' />"
  7 + end
  8 +
  9 + if icon_info[:url]
  10 + icon = link_to(icon, icon_info[:url])
  11 + end
  12 +%>
  13 +
  14 +<div class="task_icon">
  15 + <%= icon %>
  16 +</div>
app/views/tasks/_task_icon.rhtml
@@ -1,16 +0,0 @@ @@ -1,16 +0,0 @@
1 -<%  
2 - icon_info = task.icon  
3 - if icon_info[:type] == :profile_image  
4 - icon = profile_image(icon_info[:profile], :minor)  
5 - elsif icon_info[:type] == :defined_image  
6 - icon = "<img src='#{icon_info[:src]}' alt='#{icon_info[:name]}' />"  
7 - end  
8 -  
9 - if icon_info[:url]  
10 - icon = link_to(icon, icon_info[:url])  
11 - end  
12 -%>  
13 -  
14 -<div class="task_icon">  
15 - <%= icon %>  
16 -</div>  
app/views/tasks/_task_title.html.erb 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +<strong class="task_title">
  2 + <%= task.title %>
  3 +</strong>
app/views/tasks/_task_title.rhtml
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -<strong class="task_title">  
2 - <%= task.title %>  
3 -</strong>  
app/views/trusted_sites/edit.html.erb 0 → 100644
@@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
  1 +<h2> <%= _("Editing trusted site") %> </h2>
  2 +
  3 +<% form_tag :action => :update do %>
  4 +
  5 + <%= text_field_tag :site, @site %>
  6 + <%= hidden_field_tag :orig_site, @site %>
  7 +
  8 + <% button_bar do %>
  9 + <%= submit_button('save', _('Save changes'), :cancel => {:action => 'index'} ) %>
  10 + <% end %>
  11 +<% end %>
  12 +
  13 +<script>
  14 + jQuery(function() { jQuery('input#site').focus(); } );
  15 +</script>
app/views/trusted_sites/edit.rhtml
@@ -1,15 +0,0 @@ @@ -1,15 +0,0 @@
1 -<h2> <%= _("Editing trusted site") %> </h2>  
2 -  
3 -<% form_tag :action => :update do %>  
4 -  
5 - <%= text_field_tag :site, @site %>  
6 - <%= hidden_field_tag :orig_site, @site %>  
7 -  
8 - <% button_bar do %>  
9 - <%= submit_button('save', _('Save changes'), :cancel => {:action => 'index'} ) %>  
10 - <% end %>  
11 -<% end %>  
12 -  
13 -<script>  
14 - jQuery(function() { jQuery('input#site').focus(); } );  
15 -</script>  
app/views/trusted_sites/index.html.erb 0 → 100644
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
  1 +<h1><%= _('Manage trusted sites') %></h1>
  2 +
  3 +<p>
  4 +<%= _('Here you can manage the list of trusted sites of your environment. A trusted site is a site that you consider safe enough to incorporate their content through <em>iframes</em>.') %>
  5 +</p>
  6 +
  7 +<table>
  8 + <tr>
  9 + <th><%= _('Site') %></th>
  10 + <th><%= _('Actions') %></th>
  11 + </tr>
  12 + <% @sites.each do |site| %>
  13 + <tr>
  14 + <td>
  15 + <%= link_to site, :action => 'show', :site => site %>
  16 + </td>
  17 + <td style='white-space: nowrap;'>
  18 + <%= button_without_text :edit, _('Edit'), :action => 'edit', :site => site %>
  19 + <%= button_without_text :remove, _('Remove'), {:action => :destroy, :site => site}, :method => :delete, :confirm => _('Are you sure you want to remove this site from the list of trusted sites?') %>
  20 + </td>
  21 + </tr>
  22 + <% end %>
  23 +</table>
  24 +
  25 +<% button_bar do %>
  26 + <%= button :add, _('Add a trusted site'), :action => 'new' %>
  27 + <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %>
  28 +<% end %>
app/views/trusted_sites/index.rhtml
@@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
1 -<h1><%= _('Manage trusted sites') %></h1>  
2 -  
3 -<p>  
4 -<%= _('Here you can manage the list of trusted sites of your environment. A trusted site is a site that you consider safe enough to incorporate their content through <em>iframes</em>.') %>  
5 -</p>  
6 -  
7 -<table>  
8 - <tr>  
9 - <th><%= _('Site') %></th>  
10 - <th><%= _('Actions') %></th>  
11 - </tr>  
12 - <% @sites.each do |site| %>  
13 - <tr>  
14 - <td>  
15 - <%= link_to site, :action => 'show', :site => site %>  
16 - </td>  
17 - <td style='white-space: nowrap;'>  
18 - <%= button_without_text :edit, _('Edit'), :action => 'edit', :site => site %>  
19 - <%= button_without_text :remove, _('Remove'), {:action => :destroy, :site => site}, :method => :delete, :confirm => _('Are you sure you want to remove this site from the list of trusted sites?') %>  
20 - </td>  
21 - </tr>  
22 - <% end %>  
23 -</table>  
24 -  
25 -<% button_bar do %>  
26 - <%= button :add, _('Add a trusted site'), :action => 'new' %>  
27 - <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %>  
28 -<% end %>  
app/views/trusted_sites/new.html.erb 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +<h2> <%= _("Add a new trusted site") %> </h2>
  2 +
  3 +<% form_tag :action => :create do %>
  4 +
  5 + <%= text_field_tag :site, @site %>
  6 +
  7 + <% button_bar do %>
  8 + <%= submit_button('save', _('Add trusted site'), :cancel => {:action => 'index'} ) %>
  9 + <% end %>
  10 +<% end %>
  11 +
  12 +<script>
  13 + jQuery(function() { jQuery('input#site').focus(); } );
  14 +</script>
app/views/trusted_sites/new.rhtml
@@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
1 -<h2> <%= _("Add a new trusted site") %> </h2>  
2 -  
3 -<% form_tag :action => :create do %>  
4 -  
5 - <%= text_field_tag :site, @site %>  
6 -  
7 - <% button_bar do %>  
8 - <%= submit_button('save', _('Add trusted site'), :cancel => {:action => 'index'} ) %>  
9 - <% end %>  
10 -<% end %>  
11 -  
12 -<script>  
13 - jQuery(function() { jQuery('input#site').focus(); } );  
14 -</script>  
app/views/users/_index_buttons.html.erb 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +<% button_bar do %>
  2 + <%= button :'text-plain', _('User list as [CSV]'), :action => :download, :format => 'csv' %>
  3 + <%= button :'text-html', _('User list as [XML]'), :action => :download, :format => 'xml' %>
  4 + <%= button :send, _('Send e-mail to all users'), :action => 'send_mail' %>
  5 + <%= button :back, _('Back'), :controller => 'admin_panel' %>
  6 +<% end %>
app/views/users/_index_buttons.rhtml
@@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
1 -<% button_bar do %>  
2 - <%= button :'text-plain', _('User list as [CSV]'), :action => :download, :format => 'csv' %>  
3 - <%= button :'text-html', _('User list as [XML]'), :action => :download, :format => 'xml' %>  
4 - <%= button :send, _('Send e-mail to all users'), :action => 'send_mail' %>  
5 - <%= button :back, _('Back'), :controller => 'admin_panel' %>  
6 -<% end %>  
app/views/users/_users_list.html.erb 0 → 100644
@@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
  1 +<div class="environment-users-results-header">
  2 + <div id='environment-users-filter-title'><%= filter_title(@filter) %></div>
  3 + <%= filter_selector(@filter) %>
  4 + <div style="clear: both"></div>
  5 +</div>
  6 +
  7 +<table>
  8 + <colgroup>
  9 + <col width="80%">
  10 + <col width="20%">
  11 + </colgroup>
  12 + <tr>
  13 + <th><%= _('Member') %></th>
  14 + <th><%= _('Actions') %></th>
  15 + </tr>
  16 + <% @collection.each do |p| %>
  17 + <tr title="<%= p.name %>">
  18 + <td><%= link_to_profile p.short_name, p.identifier, :title => p.name %> </td>
  19 + <td class='actions'>
  20 + <div class="members-buttons-cell">
  21 + <% if p.is_admin? %>
  22 + <%= button_without_text :'reset-admin-role', _('Reset admin role'), :action => 'reset_admin_role', :id => p, :q => @q, :filter => @filter %>
  23 + <% else %>
  24 + <%= button_without_text :'set-admin-role', _('Set admin role'), :action => 'set_admin_role', :id => p, :q => @q, :filter => @filter %>
  25 + <% end %>
  26 + <% if !p.user.activated? %>
  27 + <%= button_without_text :'activate-user', _('Activate user'), :action => 'activate', :id => p, :q => @q, :filter => @filter %>
  28 + <% else %>
  29 + <%= button_without_text :'deactivate-user', _('Deactivate user'), :action => 'deactivate', :id => p, :q => @q, :filter => @filter %>
  30 + <% end %>
  31 + </div>
  32 + </td>
  33 + </tr>
  34 + <% end %>
  35 +</table>
  36 +
  37 +<%= pagination_links @collection, {:param_name => 'npage', :page_links => true} %>
app/views/users/_users_list.rhtml
@@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
1 -<div class="environment-users-results-header">  
2 - <div id='environment-users-filter-title'><%= filter_title(@filter) %></div>  
3 - <%= filter_selector(@filter) %>  
4 - <div style="clear: both"></div>  
5 -</div>  
6 -  
7 -<table>  
8 - <colgroup>  
9 - <col width="80%">  
10 - <col width="20%">  
11 - </colgroup>  
12 - <tr>  
13 - <th><%= _('Member') %></th>  
14 - <th><%= _('Actions') %></th>  
15 - </tr>  
16 - <% @collection.each do |p| %>  
17 - <tr title="<%= p.name %>">  
18 - <td><%= link_to_profile p.short_name, p.identifier, :title => p.name %> </td>  
19 - <td class='actions'>  
20 - <div class="members-buttons-cell">  
21 - <% if p.is_admin? %>  
22 - <%= button_without_text :'reset-admin-role', _('Reset admin role'), :action => 'reset_admin_role', :id => p, :q => @q, :filter => @filter %>  
23 - <% else %>  
24 - <%= button_without_text :'set-admin-role', _('Set admin role'), :action => 'set_admin_role', :id => p, :q => @q, :filter => @filter %>  
25 - <% end %>  
26 - <% if !p.user.activated? %>  
27 - <%= button_without_text :'activate-user', _('Activate user'), :action => 'activate', :id => p, :q => @q, :filter => @filter %>  
28 - <% else %>  
29 - <%= button_without_text :'deactivate-user', _('Deactivate user'), :action => 'deactivate', :id => p, :q => @q, :filter => @filter %>  
30 - <% end %>  
31 - </div>  
32 - </td>  
33 - </tr>  
34 - <% end %>  
35 -</table>  
36 -  
37 -<%= pagination_links @collection, {:param_name => 'npage', :page_links => true} %>  
app/views/users/_users_search_form.html.erb 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 + <div class="search-field">
  2 + <span class="formfield">
  3 + <%= text_field_tag 'q', @q, :title => _("Find users") %>
  4 + </span>
  5 + <%= submit_button(:search, _('Search')) %>
  6 + </div>
0 \ No newline at end of file 7 \ No newline at end of file
app/views/users/_users_search_form.rhtml
@@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
1 - <div class="search-field">  
2 - <span class="formfield">  
3 - <%= text_field_tag 'q', @q, :title => _("Find users") %>  
4 - </span>  
5 - <%= submit_button(:search, _('Search')) %>  
6 - </div>  
7 \ No newline at end of file 0 \ No newline at end of file