use shared partial for desktop and mobile application head
closes #7194
This commit is contained in:
parent
af331bfb30
commit
9aac486510
5 changed files with 47 additions and 75 deletions
|
|
@ -7,6 +7,7 @@
|
|||
* Don't display mail-related view content if it is disabled in the pod's config [#7190](https://github.com/diaspora/diaspora/pull/7190)
|
||||
* Use typeahead.js from rails-assets.org [#7192](https://github.com/diaspora/diaspora/pull/7192)
|
||||
* Refactor ShareVisibilitesController to use PostService [#7196](https://github.com/diaspora/diaspora/pull/7196)
|
||||
* Unify desktop and mobile head elements [#7194](https://github.com/diaspora/diaspora/pull/7194)
|
||||
|
||||
## Bug fixes
|
||||
* Fix fetching comments after fetching likes [#7167](https://github.com/diaspora/diaspora/pull/7167)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ module LayoutHelper
|
|||
def current_user_atom_tag
|
||||
return unless @person.present?
|
||||
content_tag(:link, "", rel: "alternate", href: @person.atom_url, type: "application/atom+xml",
|
||||
title: t(".public_feed", name: @person.name))
|
||||
title: t("layouts.application.public_feed", name: @person.name))
|
||||
end
|
||||
|
||||
def translation_missing_warnings
|
||||
|
|
|
|||
30
app/views/application/_head.haml
Normal file
30
app/views/application/_head.haml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
%title
|
||||
= page_title yield(:page_title)
|
||||
|
||||
%meta{charset: "utf-8"}/
|
||||
= content_for?(:meta_data) ? yield(:meta_data) : metas_tags
|
||||
|
||||
/ favicon
|
||||
/ For Apple devices
|
||||
%link{rel: "apple-touch-icon", href: image_path("apple-touch-icon.png")}
|
||||
/ For Nokia devices
|
||||
%link{rel: "shortcut icon", href: image_path("apple-touch-icon.png")}
|
||||
/ All others
|
||||
%link{rel: "shortcut icon", href: image_path("favicon.png")}
|
||||
|
||||
= chartbeat_head_block
|
||||
= include_mixpanel
|
||||
|
||||
- if rtl?
|
||||
= stylesheet_link_tag :rtl, media: "all"
|
||||
|
||||
- if Rails.env.test?
|
||||
= stylesheet_link_tag :poltergeist_disable_transition, media: "all"
|
||||
|
||||
= jquery_include_tag
|
||||
= current_user_atom_tag
|
||||
|
||||
= yield(:head)
|
||||
|
||||
= csrf_meta_tag
|
||||
= include_gon(camel_case: true, nonce: content_security_policy_nonce(:script))
|
||||
|
|
@ -3,47 +3,23 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
!!!
|
||||
%html{lang: I18n.locale.to_s, dir: (rtl?) ? 'rtl' : 'ltr'}
|
||||
%html{lang: I18n.locale.to_s, dir: (rtl? ? "rtl" : "ltr")}
|
||||
%head{prefix: og_prefix}
|
||||
%title
|
||||
= page_title yield(:page_title)
|
||||
|
||||
%meta{charset: 'utf-8'}/
|
||||
= render "head"
|
||||
%meta{name: "viewport", content: "width=device-width, initial-scale=1"}/
|
||||
= content_for?(:meta_data) ? yield(:meta_data) : metas_tags
|
||||
|
||||
%link{rel: 'shortcut icon', href: "#{image_path('favicon.png')}" }
|
||||
|
||||
= chartbeat_head_block
|
||||
= include_mixpanel
|
||||
|
||||
= include_color_theme
|
||||
|
||||
- if rtl?
|
||||
= stylesheet_link_tag :rtl, media: 'all'
|
||||
|
||||
- if Rails.env.test?
|
||||
= stylesheet_link_tag :poltergeist_disable_transition, media: "all"
|
||||
|
||||
= old_browser_js_support
|
||||
|
||||
<!--[if IE]>
|
||||
= javascript_include_tag :ie
|
||||
<![endif]-->
|
||||
|
||||
= jquery_include_tag
|
||||
= javascript_include_tag :main, :templates
|
||||
= load_javascript_locales
|
||||
|
||||
= translation_missing_warnings
|
||||
= current_user_atom_tag
|
||||
|
||||
= yield(:head)
|
||||
= csrf_meta_tag
|
||||
|
||||
|
||||
= include_gon(camel_case: true, nonce: content_security_policy_nonce(:script))
|
||||
|
||||
%body{ class: "page-#{controller_name} action-#{action_name}" }
|
||||
%body{class: "page-#{controller_name} action-#{action_name}"}
|
||||
= yield :before_content
|
||||
|
||||
%noscript
|
||||
|
|
|
|||
|
|
@ -3,56 +3,21 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
!!!
|
||||
%html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'}
|
||||
%head
|
||||
%title
|
||||
= pod_name
|
||||
%html{lang: I18n.locale.to_s, dir: (rtl? ? "rtl" : "ltr")}
|
||||
%head{prefix: og_prefix}
|
||||
= render "head"
|
||||
= include_color_theme "mobile"
|
||||
|
||||
%meta{:name => "description", :content => "diaspora* mobile"}/
|
||||
%meta{:name => "author", :content => "Diaspora, Inc."}/
|
||||
%meta{: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: image_path("apple-touch-icon.png")}
|
||||
/ For Nokia devices
|
||||
%link{rel: "shortcut icon", href: image_path("apple-touch-icon.png")}
|
||||
/ For desktop
|
||||
%link{rel: 'shortcut icon', href: image_path("favicon.png")}
|
||||
%meta{name: "viewport", content: "width=device-width, minimum-scale=1 maximum-scale=1"}/
|
||||
%meta{name: "HandheldFriendly", content: "True"}/
|
||||
%meta{name: "MobileOptimized", content: "320"}/
|
||||
%meta{"http-equiv" => "cleartype", :content => "on"}/
|
||||
|
||||
/ 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"}
|
||||
= yield :meta_data
|
||||
|
||||
= chartbeat_head_block
|
||||
|
||||
/ Stylesheets
|
||||
|
||||
= include_color_theme "mobile"
|
||||
= yield(:custom_css)
|
||||
|
||||
|
||||
= csrf_meta_tag
|
||||
|
||||
- if rtl?
|
||||
= stylesheet_link_tag :rtl, :media => 'all'
|
||||
|
||||
- if Rails.env.test?
|
||||
= stylesheet_link_tag :poltergeist_disable_transition, media: "all"
|
||||
|
||||
= jquery_include_tag
|
||||
|
||||
= yield(:head)
|
||||
|
||||
= include_gon(camel_case: true, nonce: content_security_policy_nonce(:script))
|
||||
%body
|
||||
#app
|
||||
= render "layouts/header"
|
||||
|
|
@ -62,10 +27,10 @@
|
|||
#main{:role => "main"}
|
||||
- if current_page?(:activity_stream)
|
||||
%h3
|
||||
= t('streams.activity.title')
|
||||
= t("streams.activity.title")
|
||||
= yield
|
||||
|
||||
/ javascripts at the bottom
|
||||
= javascript_include_tag "mobile/mobile"
|
||||
= load_javascript_locales
|
||||
= include_chartbeat
|
||||
= include_mixpanel_guid
|
||||
|
|
|
|||
Loading…
Reference in a new issue