Skip to content

Commit

Permalink
Dev: moved classes, id and attribute to core for layout_global.twig
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Aug 24, 2017
1 parent 1558bd4 commit 373c35e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions application/helpers/SurveyRuntimeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1750,13 +1750,26 @@ private function setClassAndIds()

$thissurvey['attr']['questioncounttext'] = '';

// Global
$thissurvey['id']['outerframe'] = 'outerframeContainer' ;
$thissurvey['id']['mainrow'] = 'main-row' ;
$thissurvey['id']['maincol'] = 'main-col' ;

$thissurvey['class']['html'] = 'no-js';
$thissurvey['class']['body'] = 'default';
$thissurvey['class']['outerframe'] = ' outerframe container ' ;
$thissurvey['class']['maincol'] = ' col-centered ' ;

$thissurvey['attr']['html'] = $thissurvey['attr']['body'] = $thissurvey['attr']['mainrow'] = $thissurvey['attr']['maincol'] = '';


// Clear all
$thissurvey['class']['clearall'] = 'return-to-survey';
$thissurvey['class']['clearalldiv'] = ' url-wrapper url-wrapper-survey-return ';
$thissurvey['class']['clearalla'] = ' ls-return ';
$thissurvey['attr']['clearall'] = $thissurvey['attr']['clearalldiv'] = $thissurvey['attr']['clearalla'] = '';


// Warnings
$this->aSurveyInfo['class']['activealert'] = ' alert alert-warning alert-dismissible fade in alert-dismissible ';
$this->aSurveyInfo['class']['errorHtml'] = ' fade in alert-dismissible ls-questions-have-errors alert alert-danger ';
Expand Down
10 changes: 5 additions & 5 deletions templates/default/views/layout_global.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
#}
{% if( not ( aSurveyInfo.options.ajaxmode == "on" and getPost('ajax')=="on" )) %}
<!DOCTYPE html>
<html lang="{{ aSurveyInfo.languagecode }}" dir="{{ aSurveyInfo.dir }}" class="no-js {{ aSurveyInfo.languagecode }} dir-{{ aSurveyInfo.dir }}">
<html lang="{{ aSurveyInfo.languagecode }}" dir="{{ aSurveyInfo.dir }}" class="{{ aSurveyInfo.languagecode }} dir-{{ aSurveyInfo.dir }} {{ aSurveyInfo.class.html }}" {{ aSurveyInfo.attr.html }}>

{# Headers, metadata, etc #}
{{ include('./subviews/head.twig') }}

</html>

<body class="default lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {% if( aSurveyInfo.options.brandlogo == "on") %}brand-logo{%endif%}" >
<body class="{{ aSurveyInfo.class.body }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {% if( aSurveyInfo.options.brandlogo == "on") %}brand-logo{%endif%}" {{ aSurveyInfo.attr.body }} >

{% if (aSurveyInfo.options.backgroundimage == "on") %}
{{ registerTemplateCssFile("css/background-image.css") }}
Expand Down Expand Up @@ -52,12 +52,12 @@
{% endblock %}

<!-- Outer Frame Container -->
<div class="outerframe container {% if (aSurveyInfo.options.animatebody == "on") %} animated {{ aSurveyInfo.options.bodyanimation }} {%endif%}" id="outerframeContainer">
<div class="{{ aSurveyInfo.class.outerframe }} {% if (aSurveyInfo.options.animatebody == "on") %} animated {{ aSurveyInfo.options.bodyanimation }} {%endif%}" id="{{ aSurveyInfo.id.outerframe }}" {{ aSurveyInfo.attr.outerframe }} >

<!-- Main Row -->
<div id="main-row">
<div id="{{ aSurveyInfo.id.mainrow }}" {{ aSurveyInfo.attr.mainrow }} >
<!-- Main Col -->
<div class="col-centered" id="main-col">
<div class="{{ aSurveyInfo.class.maincol }} " id="{{ aSurveyInfo.id.maincol }}" {{ aSurveyInfo.attr.maincol }}>

{# This is the main block that will be replaced/extended by other layouts#}
{% block content %}
Expand Down

0 comments on commit 373c35e

Please sign in to comment.