From a9d8be8dec9b2efc09e7f2a097f306191c1db29b Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 23 Jul 2014 11:26:17 +0100 Subject: [PATCH 1/2] brought up the sections of templates to be closer to the search box --- services/web/app/views/templates/index.jade | 2 +- services/web/public/stylesheets/app/templates.less | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/templates/index.jade b/services/web/app/views/templates/index.jade index d0c5b7aae2..64d927d186 100644 --- a/services/web/app/views/templates/index.jade +++ b/services/web/app/views/templates/index.jade @@ -37,7 +37,7 @@ block content .row -each tag in tags -if(tag.totalNumberOfTemplates > 0) - .page-header.col-md-12 + .template-section-header.col-md-12 h2 a(href=tag.tagPagePath) #{tag.name} .row diff --git a/services/web/public/stylesheets/app/templates.less b/services/web/public/stylesheets/app/templates.less index 103a839e01..c1463584cc 100644 --- a/services/web/public/stylesheets/app/templates.less +++ b/services/web/public/stylesheets/app/templates.less @@ -29,6 +29,10 @@ } +.template-section-header:extend(.page-header) { + margin-top: 0px; +} + .social_buttons { padding-top: 20px; } From e39e6c86a175ff229802ce7aaaaaff10434c8850 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 23 Jul 2014 11:29:04 +0100 Subject: [PATCH 2/2] moved where we write the window.sharelatex.x to the header as some times it is possible for the scripts to evaulate before those props have been read in --- services/web/app/views/layout.jade | 44 ++++++++++--------- .../web/public/coffee/main/templates.coffee | 2 - 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/services/web/app/views/layout.jade b/services/web/app/views/layout.jade index 473e488dad..95c7519885 100644 --- a/services/web/app/views/layout.jade +++ b/services/web/app/views/layout.jade @@ -34,6 +34,28 @@ html(itemscope, itemtype='http://schema.org/Product') script(src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js") script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.14/angular.min.js") + script. + window.sharelatex = { + siteUrl: '#{settings.siteUrl}', + jsPath: '#{jsPath}' + }; + + - if (typeof(settings.algolia) != "undefined") + script. + window.sharelatex.algolia = { + app_id:'#{settings.algolia.app_id}', + api_key:'#{settings.algolia.read_only_api_key}', + indexes:!{JSON.stringify(settings.algolia.indexes)} + } + + - if (typeof(settings.apis) != "undefined" && typeof(settings.apis.templates_api) != "undefined") + script. + window.sharelatex.templates = { + user_id : '!{settings.apis.templates_api.user_id}', + cdnDomain : '!{settings.apis.templates_api.cdnDomain}', + indexName : '!{settings.apis.templates_api.indexName}' + } + body - if(typeof(suppressNavbar) == "undefined") include layout/navbar @@ -73,25 +95,5 @@ html(itemscope, itemtype='http://schema.org/Product') category: "questions" }; - script. - window.sharelatex = { - siteUrl: '#{settings.siteUrl}', - jsPath: '#{jsPath}' - }; - - - if (typeof(settings.algolia) != "undefined") - script. - window.sharelatex.algolia = { - app_id:'#{settings.algolia.app_id}', - api_key:'#{settings.algolia.read_only_api_key}', - indexes:!{JSON.stringify(settings.algolia.indexes)} - } - - - if (typeof(settings.apis) != "undefined" && typeof(settings.apis.templates_api) != "undefined") - script. - window.sharelatex.templates = { - user_id : '!{settings.apis.templates_api.user_id}', - cdnDomain : '!{settings.apis.templates_api.cdnDomain}', - indexName : '!{settings.apis.templates_api.indexName}' - } + diff --git a/services/web/public/coffee/main/templates.coffee b/services/web/public/coffee/main/templates.coffee index a51a8f8c44..6a14a88342 100644 --- a/services/web/public/coffee/main/templates.coffee +++ b/services/web/public/coffee/main/templates.coffee @@ -17,8 +17,6 @@ define [ App.factory "algolia", -> - console.log window.sharelatex.algolia?.app_id, window.sharelatex.algolia?.api_key - if window?.sharelatex?.algolia?.app_id? client = new AlgoliaSearch(window.sharelatex.algolia?.app_id, window.sharelatex.algolia?.api_key) index = client.initIndex(window.sharelatex.algolia?.indexes?.templates)