diaspora/app/views/layouts/application.mobile.haml

88 lines
3.3 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
DIASPORA*
%meta{:name => "description", :content => "Diaspora* Mobile"}
%meta{:name => "author", :content => "Diaspora, Inc."}
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
/ 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
%meta{:name => "apple-mobile-web-app-capable", :content => "yes"}
%link{:rel => "apple-touch-startup-image", :href => "/images/apple-splash.png"}
/ Stylesheets
= include_stylesheets :mobile
= yield(:custom_css)
%script{:src => "/javascripts/vendor/mbp-modernizr-custom.js"}
/ Media Queries Polyfill https://github.com/shichuan/mobile-html5-boilerplate/wiki/Media-Queries-Polyfill
:javascript
Modernizr.mq('(min-width:0)') || document.write('<script src="javascripts/vendor/mbp-respond.min.js">\x3C/script>')
= csrf_meta_tag
- if rtl?
= include_stylesheets :rtl, :media => 'all'
= yield(:head)
%body
%header
= link_to(image_tag('white@2x.png', :height => 20, :width => 127, :id => 'header_title'), aspects_path)
- if user_signed_in?
= link_to(image_tag('icons/compose_mobile2.png', :height => 28, :width => 28), new_status_message_path, :class => 'compose_icon')
- if flash.present?
%p
- flash.each do |name, msg|
= content_tag :div, msg, :id => "flash_#{name}"
#main{:role => "main"}
= yield
- if user_signed_in?
= render :partial =>'shared/footer'
/ javascripts at the bottom
= include_javascripts :mobile
/-if current_user
/ :javascript
/ Diaspora.I18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}");
:javascript
MBP.hideUrlBar();
-if AppConfig[:google_a_site]
:javascript
var _gaq=[["_setAccount","#{AppConfig[:google_a_site]}"],["_trackPageview"]];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
-if AppConfig[:piwik_id]
:javascript
var pkBaseURL = (("https:" == document.location.protocol) ? "https://#{AppConfig[:piwik_url]}/" : "http://#{AppConfig[:piwik_url]}/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", #{AppConfig[:piwik_id]});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}