diaspora/app/views/layouts/application.mobile.haml
2014-02-09 17:42:28 +01:00

121 lines
4.4 KiB
Text

-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
!!!
%html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'}
%head
%title
= pod_name
%meta{:name => "description", :content => "diaspora* mobile"}/
%meta{:name => "author", :content => "Diaspora, Inc."}/
%meta{:charset => 'utf-8'}/
%meta{:property => "og:site_name", :content => "#{AppConfig.settings.pod_name}"}/
/ Viewport scale
%meta{:name =>'viewport', :content => "width=device-width, minimum-scale=1 maximum-scale=1"}/
%meta{:name => "HandheldFriendly", :content => "True"}/
%meta{:name => "MobileOptimized", :content => "320"}/
/ Force cleartype on WP7
%meta{'http-equiv' => "cleartype", :content => 'on'}/
/ Home screen icon (sized for retina displays)
%link{:rel => 'apple-touch-icon', :href => '/apple-touch-icon.png'}
/ For Nokia devices
%link{:rel => 'shortcut icon', :href => '/apple-touch-icon.png'}
/ iOS mobile web app indicator
/ NOTE(we will enable these once we don't have to rely on back/forward buttons anymore)
/%meta{:name => "apple-mobile-web-app-capable", :content => "yes"}
/%link{:rel => "apple-touch-startup-image", :href => "/images/apple-splash.png"}
= chartbeat_head_block
/ Stylesheets
= stylesheet_link_tag :mobile, :format => 'all'
= yield(:custom_css)
= csrf_meta_tag
- if rtl?
= stylesheet_link_tag :rtl, :media => 'all'
= yield(:head)
%body
#app
%header#main_nav
= link_to(image_tag('icons/asterisk_white_mobile.png'), stream_path, id: 'header_title')
- if user_signed_in?
#nav_badges
-# Notifications
= link_to notifications_path, class: "badge", id: "notification_badge" do
= image_tag('icons/notifications_white.png')
- if current_user.unread_notifications.count > 0
%span.badge_count{id: "notification"}
= current_user.unread_notifications.count
-# Conversations
= link_to conversations_path, class: "badge", id: "conversations_badge" do
= image_tag('icons/mail_white.png', id: 'conversation_icon')
- if current_user.unread_message_count > 0
%span.badge_count{id: "conversation"}
= current_user.unread_message_count
-# Composition
- if yield(:header_action).present?
= yield(:header_action)
- else
= link_to(image_tag('icons/compose_mobile.png'), new_status_message_path, class: "badge")
-# Menu
= link_to(image_tag('icons/menu.png'), "#", id: "menu_badge", class: "badge")
#main.container{:role => "main"}
- if current_page?(:activity_stream)
%h3
= t('streams.activity.title')
= yield
- if user_signed_in?
= render :partial =>'shared/footer'
#drawer
%header
#global_search
= form_tag('/search', method: 'get', class: 'search_form', "accept-charset" => "UTF-8") do
%div
= hidden_field_tag "utf8", "✓"
= search_field_tag "q", nil, id: "q", placeholder: t("search"), results: "5", autocomplete: "off", class: "ac_input"
.container
%nav
%ul
%li
= link_to t("streams.activity.title"), activity_stream_path
%li
= link_to t("streams.mentions.title"), mentioned_stream_path
%li
= t('streams.aspects.title')
%li#aspects_list
%ul
- for aspect in current_user.aspects
%li
= aspect.name
%li
= link_to(t('layouts.header.profile'), user_profile_path(current_user.username))
%li
= link_to(t('_contacts'), contacts_path)
%li
= link_to t('layouts.header.settings'), users_edit_path
%li
= link_to t('layouts.application.toggle'), toggle_mobile_path
%li
= link_to t('layouts.header.logout'), destroy_user_session_path, method: :delete
/ javascripts at the bottom
= jquery_include_tag
= javascript_include_tag :mobile
= include_chartbeat