Permalink
Browse files

Moved links to partial.

  • Loading branch information...
1 parent c5f9c58 commit 63f788e412f96dc68fc066dfb2186b0db0eb3be7 @barrym committed Feb 19, 2012
Showing with 26 additions and 26 deletions.
  1. +4 −4 app/views/layouts/application.html.haml
  2. +21 −0 app/views/links/_link.html.haml
  3. +1 −22 app/views/links/index.html.haml
@@ -40,10 +40,10 @@
%h3= link_to current_user.nickname, user_path(current_user), :class => 'pjax'
- if current_user.avatar?
= image_tag current_user.avatar.url(:large)
- %ul
- %li= link_to "Your profile", user_path(current_user), :class => 'pjax'
- %li= link_to "Your account", edit_user_path(current_user), :class => 'pjax'
- %li= link_to "Sign out", destroy_user_session_path, :method => :delete
+ %ul
+ %li= link_to "Your profile", user_path(current_user), :class => 'pjax'
+ %li= link_to "Your account", edit_user_path(current_user), :class => 'pjax'
+ %li= link_to "Sign out", destroy_user_session_path, :method => :delete
:javascript
$($('.dropdown-toggle').dropdown())
@@ -0,0 +1,21 @@
+- cache ["v2", link, link.user] do
+ .preview
+ .submitter
+ = image_tag link.user.avatar.url(:square)
+ .details{:class => link.is_media? ? 'media' : ''}
+ %h4
+ = link_to link.title, link_path(link), :class => 'pjax'
+ %div= link.source.display_name
+ %div
+ %span.reaction{:class => (link.likes_count > 0 ? 'some': '')}
+ -# %i.icon-heart
+ -# = link.likes_count
+ = pluralize(link.likes_count, 'like')
+ %span.reaction{:class => (link.comments_count > 0 ? 'some': '')}
+ -# %i.icon-comment
+ -# = link.comments_count
+ = pluralize(link.comments_count, 'comment')
+ %span.minor
+ %span.timeago{:title => link.updated_at.to_time.iso8601}
+ - if link.is_media?
+ = link_to image_tag(link.image.url(:thumbnail), :class => 'media'), link_path(link), :class => 'pjax'
@@ -22,28 +22,7 @@
%h1
= day.strftime("%A")
%small= day.strftime("%e %b")
- - links.each do |link|
- - cache ["v1", link, link.user] do
- .preview
- .submitter
- = image_tag link.user.avatar.url(:square)
- .details{:class => link.is_media? ? 'media' : ''}
- %h4
- = link_to link.title, link_path(link), :class => 'pjax'
- %div= link.source.display_name
- %div
- %span.reaction{:class => (link.likes_count > 0 ? 'some': '')}
- -# %i.icon-heart
- -# = link.likes_count
- = pluralize(link.likes_count, 'like')
- %span.reaction{:class => (link.comments_count > 0 ? 'some': '')}
- -# %i.icon-comment
- -# = link.comments_count
- = pluralize(link.comments_count, 'comment')
- %span.minor
- %span.timeago{:title => link.updated_at.to_time.iso8601}
- - if link.is_media?
- = link_to image_tag(link.image.url(:thumbnail), :class => 'media'), link_path(link), :class => 'pjax'
+ = render links
= paginate @links

0 comments on commit 63f788e

Please sign in to comment.