Special conditions were not properly displaying'
authorLaury GvR <laury@gaslightmedia.com>
Mon, 17 Oct 2016 13:05:32 +0000 (09:05 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Mon, 17 Oct 2016 13:05:32 +0000 (09:05 -0400)
css/front.css [new file with mode: 0644]
models/admin/conditions/index.php
models/front/conditions/current.php
views/front/conditions/inside.html

diff --git a/css/front.css b/css/front.css
new file mode 100644 (file)
index 0000000..41d5022
--- /dev/null
@@ -0,0 +1,3 @@
+.condition-description {
+    margin-bottom: 10px;
+}
\ No newline at end of file
index 1c69fe3..313aabb 100644 (file)
@@ -190,7 +190,7 @@ class GlmMembersAdmin_conditions_index extends GlmDataConditions
         FROM ".GLM_MEMBERS_CONDITIONS_PLUGIN_DB_PREFIX."current_condition CC
         ";
         $current_condition = $this->wpdb->get_results( $sql, ARRAY_A );
-
+        
         // Compile template data
         $templateData = array(
             'conditionList' => $condition_list,
index 7be40b5..82825f9 100644 (file)
@@ -65,6 +65,11 @@ class GlmMembersFront_conditions_current extends GlmDataCurrentCondition
         
         $conditions_url = esc_url( home_url( '/' ) ) . "conditions";
         
+        // If this is a special condition
+        if ($current_condition[0]['id'] == 12) {
+            $special_condition = true;
+        }
+        
         // Compile template data
         $templateData = array(
             'currentCondition'  => $current_condition[0],
@@ -72,7 +77,8 @@ class GlmMembersFront_conditions_current extends GlmDataCurrentCondition
             'todaysDate' => $todays_date,
             'timeNow' => $time_now,
             'conditionsUrl' => $conditions_url,
-            'siteBaseUrl' => $site_base_url
+            'siteBaseUrl' => $site_base_url,
+            'specialCondition' => $special_condition
         );
         
         error_reporting(E_ALL ^ E_NOTICE);
index 49bf8ab..2df648e 100644 (file)
@@ -3,9 +3,11 @@
     <h2 class="status">Status:</h2>
     <h3 class="status">{$selectedCondition.name}</h3>
     <div class="date">{$todaysDate}{$timeNow}</div><br>
-    <div class="" id="condition-{$selectedCondition.id}">
-        <div>
+    <div class="condition-description" id="condition-{$selectedCondition.id}">
+        {if $special}
+            <span>{$currentCondition.special|nl2br}</span>
+        {else}
             <span>{$selectedCondition.descr|nl2br}</span>
-        </div>
+        {/if}
     </div>
 {/if}