From 616fe8fed349d1c16dc1513941105f71dbc29677 Mon Sep 17 00:00:00 2001 From: Caio SBA Date: Mon, 13 Feb 2012 04:40:55 -0200 Subject: [PATCH] Last fixes for new profile wall --- app/views/profile/_comment.rhtml | 1 + app/views/profile/_create_article.rhtml | 9 ++++++--- app/views/profile/_default_activity.rhtml | 1 + app/views/profile/_profile_comment_form.rhtml | 2 +- app/views/profile/_profile_scrap.rhtml | 33 +++++++++++++++------------------ app/views/profile/_upload_image.rhtml | 5 ++++- public/designs/icons/tango/style.css | 2 +- public/designs/templates/leftbar/stylesheets/style.css | 12 ++++++++++++ public/designs/templates/rightbar/stylesheets/style.css | 12 ++++++++++++ public/images/forum-activity-bg.png | Bin 0 -> 1758 bytes public/images/forum-activity-icon.png | Bin 0 -> 477 bytes public/images/gallery-image-activity-border-big.png | Bin 0 -> 1349 bytes public/images/gallery-image-activity-border.png | Bin 732 -> 0 bytes public/stylesheets/application.css | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------ 14 files changed, 124 insertions(+), 36 deletions(-) create mode 100644 public/images/forum-activity-bg.png create mode 100644 public/images/forum-activity-icon.png create mode 100644 public/images/gallery-image-activity-border-big.png diff --git a/app/views/profile/_comment.rhtml b/app/views/profile/_comment.rhtml index 3398bf4..2a6dcf5 100644 --- a/app/views/profile/_comment.rhtml +++ b/app/views/profile/_comment.rhtml @@ -25,6 +25,7 @@ <%= icon_button(:delete, _('Remove'), { :action => :remove_comment, :comment_id => comment.id }, :method => :get, :confirm => _('Are you sure you want to remove this comment and all its replies?')) %> <% end %> <% end %> +
<% if @comment && @comment.errors.any? && @comment.reply_of_id.to_i == comment.id %> diff --git a/app/views/profile/_create_article.rhtml b/app/views/profile/_create_article.rhtml index 29429bb..584ebd1 100644 --- a/app/views/profile/_create_article.rhtml +++ b/app/views/profile/_create_article.rhtml @@ -1,13 +1,16 @@
<%= link_to(profile_image(activity.user, :minor), activity.user.url) %>
-
+

<%= link_to activity.user.name, activity.user.url %>

- <%= activity.params['name'] %>
- <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(activity.params['lead']).gsub(/(\xA0|\xC2|\s)+/, ' ').gsub(/^\s+/, '') %> <%= link_to(_('See more +'), activity.params['url']) unless activity.get_lead.blank? %>
+ <%= activity.params['name'] %> +
+ <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(activity.params['lead']).gsub(/(\xA0|\xC2|\s)+/, ' ').gsub(/^\s+/, '') %> <%= link_to(_('See more'), activity.params['url']) unless activity.get_lead.blank? %>
+ <%= content_tag(:p, link_to(_('See complete forum'), activity.get_url), :class => 'see-forum') if activity.target.is_a?(Forum) %>

<%= time_ago_as_sentence(activity.created_at) + ' ' + _('ago') %>

+ <%= link_to _('Comment'), "#reply_content_#{activity.id}" %> <%= link_to_remote(content_tag(:span, _('Remove')), :url =>{:action => 'remove_activity', :activity_id => activity.id}, :update => "profile-activity-item-#{activity.id}") if logged_in? && current_person == @profile %>
diff --git a/app/views/profile/_default_activity.rhtml b/app/views/profile/_default_activity.rhtml index c3c487d..c4d0905 100644 --- a/app/views/profile/_default_activity.rhtml +++ b/app/views/profile/_default_activity.rhtml @@ -5,6 +5,7 @@

<%= link_to activity.user.name, activity.user.url %> <%= describe activity %>

<%= time_ago_as_sentence(activity.created_at) + ' ' + _('ago') %>

+ <%= link_to _('Comment'), "#reply_content_#{activity.id}" %> <%= link_to_remote(content_tag(:span, _('Remove')), :url =>{:action => 'remove_activity', :activity_id => activity.id}, :update => "profile-activity-item-#{activity.id}") if logged_in? && current_person == @profile %>
diff --git a/app/views/profile/_profile_comment_form.rhtml b/app/views/profile/_profile_comment_form.rhtml index 6152fa4..48619b8 100644 --- a/app/views/profile/_profile_comment_form.rhtml +++ b/app/views/profile/_profile_comment_form.rhtml @@ -2,7 +2,7 @@

<% form_remote_tag :url => {:controller => 'profile', :action => 'leave_comment_on_activity'}, :update => 'profile_activities', :html => { :class => 'profile-wall-reply-form' } do %> - <%= text_area :comment, :body, {:id => "reply_content_#{activity.id}", :cols => 50, :rows => 1, :class => 'submit-with-keypress', :title => _('Leave your comment'), :onfocus => 'if(this.value==this.title){this.value="";this.style.color="#000"}', :onblur => 'if(this.value==""){this.value=this.title;this.style.color="#ccc"}', :value => _('Leave your comment'), :style => 'color: #ccc' } %> + <%= text_area :comment, :body, {:id => "reply_content_#{activity.id}", :cols => 50, :rows => 1, :class => 'submit-with-keypress', :title => _('Leave your comment'), :onfocus => 'if(this.value==this.title){this.value="";this.style.color="#000"};this.style.backgroundImage="url(' + current_person.profile_custom_icon + ')"', :onblur => 'if(this.value==""){this.value=this.title;this.style.color="#ccc"};this.style.backgroundImage="none"', :value => _('Leave your comment'), :style => 'color: #ccc' } %> <%= hidden_field_tag :source_id, activity.id, :id => "activity_id_#{activity.id}" %> <% end %>

diff --git a/app/views/profile/_profile_scrap.rhtml b/app/views/profile/_profile_scrap.rhtml index 4cb556a..29fb1e9 100644 --- a/app/views/profile/_profile_scrap.rhtml +++ b/app/views/profile/_profile_scrap.rhtml @@ -1,38 +1,35 @@ -
  • -
    +
  • +
    <%= link_to(profile_image(scrap.sender, :minor), scrap.sender.url) %> - <% if logged_in? && current_person.follows?(scrap.sender) && current_person != scrap.sender %> -

    <%= link_to_function _('Scrap'), "hide_and_show(['#profile-wall-message-response-#{scrap.id}'],['#profile-wall-message-#{scrap.id}', '#profile-wall-form-#{scrap.id}']);$('content_#{scrap.id}').value='';return false", :class => "profile-send-message", :title => _("Send a message to %s") % scrap.sender.name %>

    - <% end %>
    - <% comment_balloon :class => 'profile-wall-description' do %> -

    <%= link_to scrap.sender.name, scrap.sender.url %>

    -

    <%= txt2html scrap.content %>

    -

    <%= time_ago_as_sentence(scrap.created_at) + ' ' + _('ago') %>

    + <% comment_balloon :class => 'profile-activity-description' do %> +

    <%= link_to scrap.sender.name, scrap.sender.url %>

    +

    <%= txt2html scrap.content %>

    +

    <%= time_ago_as_sentence(scrap.created_at) + ' ' + _('ago') %>

    <% if logged_in? && current_person.follows?(scrap.sender) %> - <%= link_to_function _('Comment'), "hide_and_show(['#profile-wall-reply-response-#{scrap.id}'],['#profile-wall-reply-#{scrap.id}', '#profile-wall-reply-form-#{scrap.id}']);$('reply_content_#{scrap.id}').value='';$('reply_content_#{scrap.id}').focus();$('scrap_id_#{scrap.id}').value='#{scrap.id}';return false", :class => "profile-send-reply" %> + <%= link_to_function _('Comment'), "hide_and_show(['#profile-activity-reply-response-#{scrap.id}'],['#profile-activity-reply-#{scrap.id}', '#profile-activity-reply-form-#{scrap.id}']);$('reply_content_#{scrap.id}').value='';$('reply_content_#{scrap.id}').focus();$('scrap_id_#{scrap.id}').value='#{scrap.id}';return false", :class => "profile-send-reply" %> <% end %> - <%= link_to_remote(content_tag(:span, _('Remove')), :url =>{:action => 'remove_scrap', :scrap_id => scrap.id}, :update => "profile-wall-item-#{scrap.id}") if logged_in? && user.can_control_scrap?(scrap) %> + <%= link_to_remote(content_tag(:span, _('Remove')), :url =>{:action => 'remove_scrap', :scrap_id => scrap.id}, :update => "profile-activity-item-#{scrap.id}") if logged_in? && user.can_control_scrap?(scrap) %> <% end %>
    -
      +
        <% scrap.replies.map do |reply| %> <%= render :partial => 'profile_scrap', :locals => {:scrap => reply} %> <% end %>
      -