formWizard.php 7.27 KB
Newer Older
Clément Damiens's avatar
 
Clément Damiens committed
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php 
$cssJS = array(
    '/plugins/jQuery-Knob/js/jquery.knob.js',
    '/plugins/jQuery-Smart-Wizard/js/jquery.smartWizard.js',
    //'/plugins/jQuery-Smart-Wizard/styles/smart_wizard.css',
  // SHOWDOWN
  '/plugins/showdown/showdown.min.js',
  // MARKDOWN
  '/plugins/to-markdown/to-markdown.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$poiList = array();

14
if(isset($this->costum["contextType"]) && isset($this->costum["contextId"])){
Clément Damiens's avatar
 
Clément Damiens committed
15
    $poiList = PHDB::find(Poi::COLLECTION, 
16 17
                    array( "parent.".$this->costum["contextId"] => array('$exists'=>1), 
                           "parent.".$this->costum["contextId"].".type"=>$this->costum["contextType"],
Clément Damiens's avatar
 
Clément Damiens committed
18
                           "type"=>"cms") );
Raph El's avatar
Raph El committed
19
}
Clément Damiens's avatar
 
Clément Damiens committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
?>

<style type="text/css">
  @font-face{
      font-family: "montserrat";
       src: url("<?php echo Yii::app()->getModule("costum")->getAssetsUrl() ?>/font/co/montserrat-regular.woff") format("woff"),
       url("<?php echo Yii::app()->getModule("costum")->getAssetsUrl() ?>/font/co/montserrat-regular.ttf") format("ttf")
  }.mst{font-family: 'montserrat'!important;}

  @font-face{
      font-family: "CoveredByYourGrace";
      src: url("<?php echo Yii::app()->getModule("costum")->getAssetsUrl() ?>/font/co/CoveredByYourGrace.ttf")
  }.cbyg{font-family: 'CoveredByYourGrace'!important;}
    
    
  #customHeader{
    margin-top: 0px;
  }
  #costumBanner{
   /* max-height: 375px; */
  }
  #costumBanner h1{
    position: absolute;
    color: white;
    background-color: rgba(0,0,0,0.4);
    font-size: 29px;
    bottom: 0px;
    padding: 20px;
  }
  #costumBanner h1 span{
    color: #eeeeee;
    font-style: italic;
  }
  #costumBanner img{
    min-width: 100%;
  }
  .btn-main-menu{
57
    background: <?php echo $this->costum["colors"]["pink"]; ?>;
Clément Damiens's avatar
 
Clément Damiens committed
58 59 60 61 62 63 64 65 66 67
    border-radius: 10px;
    padding: 10px !important;
    color: white;
    cursor: pointer;
    border:3px solid transparent;
    font-size: 1.5em
    /*min-height:100px;*/
  }
  .btn-main-menuW{
    background: white;
68
    color: <?php echo $this->costum["colors"]["pink"]; ?>;
Clément Damiens's avatar
 
Clément Damiens committed
69 70 71 72
    border:none;
    cursor:text ;
  }
  .btn-main-menu:hover{
73
    border:2px solid <?php echo $this->costum["colors"]["pink"]; ?>;
Clément Damiens's avatar
 
Clément Damiens committed
74
    background-color: white;
75
    color: <?php echo $this->costum["colors"]["pink"]; ?>;
Clément Damiens's avatar
 
Clément Damiens committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
  }
  .btn-main-menuW:hover{
    border:none;
  }
  @media screen and (min-width: 450px) and (max-width: 1024px) {
    .logoDescription{
      width: 60%;
      margin:auto;
    }
  }

  @media (max-width: 1024px){
    #customHeader{
      margin-top: -1px;
    }
  }
  @media (max-width: 768px){
    h1, h2, h3, h4, h5, h6 {
        display: block;
        font-size: 1.9em;
    }
  }
  #customHeader #newsstream .loader{
    display: none;
  }

</style>
Raph El's avatar
Raph El committed
103 104 105 106
<script type="text/javascript">
    var sectionDyf = {};
    
</script>
Clément Damiens's avatar
 
Clément Damiens committed
107
<?php
Raph El's avatar
Raph El committed
108 109 110 111 112
  // $params = [  "tpl" => $this->costum["slug"],
  //       "slug"=>$el["slug"],
  //       "canEdit"=>$canEdit,
  //       "el"=>$el  ];
  // echo $this->renderPartial("survey.views.tpls.acceptAndAdmin", $params, true ); 
Clément Damiens's avatar
 
Clément Damiens committed
113 114 115 116 117
?>  

<div class="col-xs-12 no-padding" id="customHeader" style="background-color: white">
<?php
$color1 = "#E63458";
118
if(isset($this->costum["cms"]["color1"]))
Raph El's avatar
Raph El committed
119 120 121
  $color1 = $this->costum["cms"]["color1"];
// if($canEdit)
//   echo "<a class='btn btn-xs btn-danger editBtn' href='javascript:;' data-key='color1' data-type='color'  data-path='costum.cms.color1' data-label='Couleur Principale '><i class='fa fa-pencil'></i></a>";
Clément Damiens's avatar
 
Clément Damiens committed
122 123
?>

Raph El's avatar
Raph El committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
  <div class="col-xs-12 no-padding" >
    <!-- style="background-color:<?php //echo $this->costum["colors"]["grey"]; ?>; max-width:100%;"> -->

    <div class="col-xs-12 no-padding" style="">
    <style type="text/css">
      .monTitle{
        border-top: 1px dashed <?php echo $this->costum["colors"]["pink"]; ?>; 
        border-bottom: 1px dashed <?php echo $this->costum["colors"]["pink"]; ?>;
            margin-top: -20px;
      }
    </style>
  <?php $formSmallSize =  12; ?>
      <div class="col-md-12 col-lg-<?php echo $formSmallSize?> no-padding "><br/>

        <div class="col-xs-12 no-padding" style="background-color: white; ">

          <div class="col-xs-12 no-padding">

            <script type="text/javascript">
            var formInputs = {};
            var answerObj = <?php echo (!empty($answer)) ? json_encode( $answer ) : "null"; ?>;
            </script>
            <div class="col-xs-12 margin-top-20">
            <?php
            $wizardUid = (String) $form["_id"];
                        if($mode != "fa"){
                            $params = [
                                "parentForm"=>$parentForm,
                                "el" => $el,
                                "color1" => $color1,
                                "canEdit" => $canEdit,
                                "answer"=>$answer,
                                "forms"=>$forms,
                                "allAnswers"=>@$allAnswers,
                                "what" => "dossiers",
                                "wizid"=> $wizardUid
                            ];
Raph El's avatar
Raph El committed
161
                            echo $this->renderPartial($parentForm["answersTpl"],$params);
Raph El's avatar
Raph El committed
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
                        }

                        if( $mode == "fa" && $canEditForm === true ){
                            $params = [
                                "canEditForm"=>$canEditForm,
                                "mode" => $mode,
                                "form" => $form,
                                "el" => $el
                            ];
                            echo $this->renderPartial("survey.views.tpls.forms.config",$params);
                        }
            if( isset($answer) && !empty($showForm) && $showForm === true  ) {
                            $params = [
                                "parentForm"=>$parentForm,
                                "form" => $form,
                                "forms"=>$forms,
                                "el" => $el,
                                "active" => "all",
                                "color1" => $this->costum["colors"]["dark"],
                                "color2" => $this->costum["colors"]["pink"],
                                "canEdit" => $canEdit,
                                "canEditForm" => $canEditForm,
                                "answer"=>$answer,
                                "showForm" => $showForm,
                                "mode" => $mode,
                                "wizid"=> $wizardUid
                            ];

                            echo $this->renderPartial("survey.views.tpls.forms.wizard",$params); 
            }
Clément Damiens's avatar
 
Clément Damiens committed
192 193 194
            ?>

            </div>
Raph El's avatar
Raph El committed
195
          </div>
Clément Damiens's avatar
 
Clément Damiens committed
196
        </div>
Raph El's avatar
Raph El committed
197
      </div>
Clément Damiens's avatar
 
Clément Damiens committed
198 199 200 201 202 203 204 205
    </div>
  </div>


</div>

<script type="text/javascript">
//to edit costum page pieces 
Tibor Katelbach's avatar
tweaks  
Tibor Katelbach committed
206
var configDynForm = <?php echo json_encode(@$this->costum['dynForm']); ?>;
Raph El's avatar
Raph El committed
207 208 209
var answerId = <?php echo json_encode((String)$answer['_id']); ?>;
var mode = <?php echo json_encode($mode); ?>;
var elTest = <?php echo json_encode($el); ?>;
Clément Damiens's avatar
 
Clément Damiens committed
210 211
//information and structure of the form in this page  
var tplCtx = {};
Raph El's avatar
Raph El committed
212 213 214
if(location.hash.indexOf("#answer.index.id.new")>=0){
    history.replaceState("#answer.index.id.new", "", "#answer.index.id."+answerId+".mode."+mode);
}
Clément Damiens's avatar
 
Clément Damiens committed
215 216

jQuery(document).ready(function() {
Raph El's avatar
Raph El committed
217 218
    mylog.log("render","/modules/costum/views/custom/deal/form.php");
  
Clément Damiens's avatar
 
Clément Damiens committed
219 220 221 222 223
});


</script>