Permalink
Browse files

Hide posts if blog URL is set. Use blog url as link for blog if set.

  • Loading branch information...
1 parent 6d86003 commit 80ba045b2d16959501b9e434e3892aeb4cd8667c @rposborne rposborne committed May 3, 2012
@@ -15,7 +15,8 @@
%li{ :class => controller.controller_name == 'private_galleries' ? 'active' : '' }= link_to 'Private Galleries', admin_private_galleries_path
%li{ :class => controller.controller_name == 'galleries' ? 'active' : '' }= link_to 'Galleries', admin_galleries_path
%li{ :class => controller.controller_name == 'pages' ? 'active' : '' }= link_to 'Pages', admin_pages_path
- %li{ :class => controller.controller_name == 'posts' ? 'active' : '' }= link_to 'Posts', admin_posts_path
+ -if photographer.blog_url.nil?
+ %li{ :class => controller.controller_name == 'posts' ? 'active' : '' }= link_to 'Posts', admin_posts_path
%li{ :class => controller.controller_name == 'photographers' ? 'active' : '' }= link_to 'Settings', edit_admin_photographer_path
%li.divider-vertical
%li= link_to 'Logout', destroy_photographer_session_path, :method => :delete
@@ -14,7 +14,7 @@
%li{ :class => (defined?(@gallery) and @gallery.id == gallery.id ? 'active' : '') }= link_to(gallery.name, gallery_path(gallery))
- pages.each do |page|
%li{ :class => (defined?(@page) and @page.id == page.id ? 'active' : '') }= link_to(page.name, page_path(page))
- %li{ :class => controller.controller_name == 'posts' ? 'active' : '' }= link_to('Blog', posts_path)
+ %li{ :class => controller.controller_name == 'posts' ? 'active' : '' }= link_to('Blog', photographer.blog_url.nil? ? posts_path : photographer.blog_url)
%li.divider-vertical
%li{ :class => controller.controller_name == 'contact_requests' ? 'active' : '' }= link_to('Contact', new_contact_request_path)
.pull-right= link_to(photographer.name, root_path, :class => 'brand')
@@ -15,12 +15,13 @@
%li= link_to(truncate(page.name, :length => 32), page_path(page))
%li= link_to('Contact', new_contact_request_path)
.span3
- %h4 Recent Posts
- %ul.unstyled
- - recent_posts.each do |post|
- %li= link_to(truncate(post.title, :length => 32), post_path(post))
+ -unless photographer.blog_url
+ %h4 Recent Posts
+ %ul.unstyled
+ - recent_posts.each do |post|
+ %li= link_to(truncate(post.title, :length => 32), post_path(post))
- .span5
+ .span5.pull-right
%p= photographer.description
#footer-floor
.container

0 comments on commit 80ba045

Please sign in to comment.