From 2ca42ea5e6deb624e8ba9eea6b2af19f2b5ae672 Mon Sep 17 00:00:00 2001 From: Justin Ramos Date: Sun, 20 Nov 2016 22:00:05 +0000 Subject: [PATCH] adding content_for(:javascript) closes #7209 --- Changelog.md | 2 +- app/views/application/_head.haml | 12 ++++++------ app/views/layouts/application.html.haml | 20 +++++++++++--------- app/views/layouts/application.mobile.haml | 6 ++++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Changelog.md b/Changelog.md index f891752df..679a025c8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,7 +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) +* Unify desktop and mobile head elements [#7194](https://github.com/diaspora/diaspora/pull/7194) [#7209](https://github.com/diaspora/diaspora/pull/7209) * Refactor flash messages on ajax errors for comments, likes, reshares and aspect memberships [#7202](https://github.com/diaspora/diaspora/pull/7202) * Only require AWS-module for fog [#7201](https://github.com/diaspora/diaspora/pull/7201) * Only show community spotlight links on the contacts page if community spotlight is enabled [#7213](https://github.com/diaspora/diaspora/pull/7213) diff --git a/app/views/application/_head.haml b/app/views/application/_head.haml index 8019030c8..497277976 100644 --- a/app/views/application/_head.haml +++ b/app/views/application/_head.haml @@ -12,9 +12,6 @@ / All others %link{rel: "shortcut icon", href: image_path("favicon.png")} -= chartbeat_head_block -= include_mixpanel - - if rtl? = stylesheet_link_tag :rtl, media: "all" @@ -22,9 +19,12 @@ = stylesheet_link_tag :poltergeist_disable_transition, media: "all" = jquery_include_tag += include_gon(camel_case: true, nonce: content_security_policy_nonce(:script)) += yield(:javascript) + += chartbeat_head_block += csrf_meta_tag = current_user_atom_tag += include_mixpanel = yield(:head) - -= csrf_meta_tag -= include_gon(camel_case: true, nonce: content_security_policy_nonce(:script)) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0dbcaae99..8b4099a8f 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -5,18 +5,20 @@ !!! %html{lang: I18n.locale.to_s, dir: (rtl? ? "rtl" : "ltr")} %head{prefix: og_prefix} - = render "head" %meta{name: "viewport", content: "width=device-width, initial-scale=1"}/ + - content_for :javascript do + = old_browser_js_support + + + + = javascript_include_tag :main, :templates + = load_javascript_locales + + = render "head" = include_color_theme - = old_browser_js_support - - - - = javascript_include_tag :main, :templates - = load_javascript_locales = translation_missing_warnings %body{class: "page-#{controller_name} action-#{action_name}"} diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index e65f3f459..618327572 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -5,6 +5,10 @@ !!! %html{lang: I18n.locale.to_s, dir: (rtl? ? "rtl" : "ltr")} %head{prefix: og_prefix} + - content_for :javascript do + = javascript_include_tag "mobile/mobile" + = load_javascript_locales + = render "head" = include_color_theme "mobile" @@ -30,7 +34,5 @@ = t("streams.activity.title") = yield - = javascript_include_tag "mobile/mobile" - = load_javascript_locales = include_chartbeat = include_mixpanel_guid