diaspora/app/views/layouts/_header.html.haml
2011-06-27 19:51:35 -07:00

63 lines
2.8 KiB
Text

-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
.container{:style => "position:relative;"}
- if current_user
= link_to image_tag('logo_small.png', :height => "16px", :width => "161px", :class => "diaspora_header_logo"), root_path
- else
= link_to image_tag('logo_large.png', :height => "32px", :width => "321px", :class => "diaspora_header_logo"), root_path
- if !current_user
.right
%ul#landing_nav
%li= link_to '@joindiaspora', "http://twitter.com/joindiaspora"
%li= link_to 'github', "https://github.com/diaspora/diaspora"
%li= link_to t('.blog'), 'http://blog.joindiaspora.com/'
%li= link_to t('.login'), new_user_session_path, :class => 'login'
- elsif (current_user || !@landing_page)
#global_search
= form_tag(people_path, :method => 'get', :id => "global_search_form") do
= text_field_tag 'q', nil, :placeholder => t('search'), :type => 'search', :results => 5
- if @notification_count
#notification_badge
= link_to "", notifications_path, :title => new_notification_text(@notification_count)
= image_tag 'icons/monotone_flag.png', :height => 20, :width => 20, :id => "notification-flag"
.badge_count{:class => ("hidden" if @notification_count == 0)}
= @notification_count
#message_inbox_badge
= link_to "", conversations_path , :title => new_message_text(@unread_message_count)
= image_tag 'icons/mail_grey.png', :height => 16, :width => 16
.badge_count{:class => ("hidden" if @unread_message_count == 0)}
= @unread_message_count
%ul#user_menu.dropdown
%li
.right
▼
.avatar
= owner_image_tag(:thumb_small)
= link_to current_user.name, '#'
%li= link_to t('.profile'), current_user.person
%li= link_to t('.settings'), edit_user_path
-if current_user.admin?
%li= link_to t('.admin'), user_search_path
%li= link_to t('.logout'), destroy_user_session_path
-unless @landing_page
%ul#aspect_nav
%li{:class => ('selected' if @aspect == :all)}
= link_to t('all_aspects'), aspects_path, :class => 'home_selector'
- for aspect in all_aspects
%li{:data=>{:guid=>aspect.id}, :class => ("selected" if object_aspect_ids.include?(aspect.id))}
= link_for_aspect(aspect, :class => 'aspect_selector name', :title => t('contacts', :count => aspect.contacts.size))
%li
= link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('contacts.index.add_a_new_aspect'), :rel => 'facebox'
.facebox_content
#add_aspect_pane
= render "aspects/new"