Adding more foundation 6
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 18 Jun 2019 20:49:04 +0000 (16:49 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 18 Jun 2019 20:49:04 +0000 (16:49 -0400)
Setup the search form to use foundation 6.
Need to redo how the update and add flow works.

css/admin.css
models/admin/messages/index.php
views/admin/messages/editHtmlEmail.html
views/admin/messages/editTemplate.html
views/admin/messages/listMessagesTable.html
views/admin/messages/listTemplates.html
views/admin/messages/search.html

index a924403..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#glm-member-db-messages-app * label {
-    display: block;
-    clear: both;
-}
-/* ul.wp-submenu { */
-/*     margin-left: 0; */
-/* } */
-/* body { */
-/*     background-color: rgb(241, 241, 241) !important; */
-/* } */
-/* input[type="text"] { */
-/*     display: inline; */
-/* } */
-/* .wp-admin select { */
-/*     padding: .5rem !important; */
-/*     line-height: 1.5; */
-/*     height: 2.4375rem; */
-/* } */
index e89a7a3..7af3f55 100644 (file)
@@ -309,6 +309,7 @@ class GlmMembersAdmin_messages_index extends GlmDataEmailMessages
             // echo '<pre>$_REQUEST: ' . print_r( $_REQUEST, true ) . '</pre>';
 
             $tData = array(
+                'searched'      => isset($_REQUEST['search']) ? true: false,
                 'messages'      => $messages,
                 'mTypeSelected' => $mTypeSelected,
                 'categories'    => $categories,
@@ -371,6 +372,7 @@ class GlmMembersAdmin_messages_index extends GlmDataEmailMessages
             break;
 
         case 'editTemplate':
+            $error = false;
             $view      = 'editTemplate';
             $newEntry  = false;
             $Templates = new GlmDataEmailTemplates( $this->wpdb, $this->config );
@@ -383,24 +385,42 @@ class GlmMembersAdmin_messages_index extends GlmDataEmailMessages
             $tData = array(
                 'template' => $template,
                 'newEntry' => $newEntry,
+                'error'    => $error,
             );
             break;
 
         case 'updateTemplate':
+            $error   = false;
+            $success = false;
             $templateData['thisOption'] = 'listTemplates';
             // echo '<pre>'.print_r($_REQUEST, true).'</pre>';
             $Templates = new GlmDataEmailTemplates( $this->wpdb, $this->config );
             if ( isset( $_REQUEST['id'] ) && $id = filter_var( $_REQUEST['id'], FILTER_VALIDATE_INT ) ) {
+                $newEntry = false;
                 $template = $Templates->updateEntry( $id );
             } else {
                 $newEntry = true;
                 $template = $Templates->insertEntry();
             }
             if ( $template['status'] != 1 ) {
-                $view = 'editHtmlEmail';
+                $error = true;
+                $view  = 'editTemplate';
                 $tData = array(
                     'template' => $template,
                     'newEntry' => $newEntry,
+                    'error'    => $error,
+                    'success'  => $success,
+                );
+                break;
+            } else {
+                $template = $Templates->editEntry( $id );
+                $success  = true;
+                $view     = 'editTemplate';
+                $tData    = array(
+                    'template' => $template,
+                    'newEntry' => $newEntry,
+                    'error'    => $error,
+                    'success'  => $success,
                 );
                 break;
             }
index f8f66af..5a8ef75 100644 (file)
@@ -9,7 +9,7 @@
     {include file='admin/ui/deleteDialog.html'}
 {/if}
 
-<form action="{$thisUrl}?page={$thisPage}" method="post" style="max-width: 800px;">
+<form action="{$thisUrl}?page={$thisPage}" method="post" style="max-width: 600px;">
     <input type="hidden" name="option" value="updateHtmlEmail" />
     {if !$newEntry}
         <input type="hidden" name="id" value="{$message.fieldData.id}" />
@@ -19,7 +19,7 @@
     {assign var="data" value=$message}
 
     {assign var="field" value="archived"}
-    {assign var="fieldLabel" value="Archived:"}
+    {assign var="fieldLabel" value="Archived"}
     {include file="admin/ui/f6-checkbox.html"}
 
     {assign var="field" value="template_id"}
index 4354dbe..0bc6ded 100644 (file)
@@ -9,7 +9,24 @@
     {include file='admin/ui/deleteDialog.html'}
 {/if}
 
-<form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+{if $error}
+    <div class="callout alert" data-closable>
+        There was an error saving your data.
+        <button class="close-button" aria-label="Dismiss alert" type="button" data-close>
+            <span aria-hidden="true">&times;</span>
+        </button>
+    </div>
+{/if}
+{if $success}
+    <div class="callout success" data-closable>
+        Your data was Saved!
+        <button class="close-button" aria-label="Dismiss alert" type="button" data-close>
+            <span aria-hidden="true">&times;</span>
+        </button>
+    </div>
+{/if}
+
+<form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data" style="max-width: 600px;">
     <input type="hidden" name="option" value="updateTemplate" />
     {if !$newEntry}
         <input type="hidden" name="id" value="{$template.fieldData.id}" />
index 6d8009f..50027f2 100644 (file)
@@ -1,12 +1,12 @@
-<table class="wp-list-table widefat fixed posts glm-admin-table" style="width: 1200px;">
+<table class="stack">
     <thead>
         <tr>
-            <th align="left" style="width: 20px">ID</th>
+            <th align="left" width="20">ID</th>
             <th align="left">Subject</th>
             <th align="left">Last Updated</th>
             <th align="left">Last Sent</th>
             <th align="left">Queued</th>
-            <th align="left" style="width: 100px">Preview</th>
+            <th align="left" width="50">Preview</th>
         </tr>
     </thead>
     <tbody>
index 8b5d350..d4c6437 100644 (file)
@@ -3,12 +3,12 @@
 
 <a href="{$thisUrl}?page={$thisPage}&option=editTemplate" class="button button-primary glm-right">Add Template</a>
 
-<table class="wp-list-table widefat fixed posts glm-admin-table" style="width: 1200px;">
+<table class="stack">
     <thead>
         <tr>
-            <th align="left" style="width: 20px">ID</th>
+            <th align="left" width="20">ID</th>
             <th align="left">Name</th>
-            <th align="left" style="width: 100px">Preview</th>
+            <th align="left" width="50">Preview</th>
         </tr>
     </thead>
     <tbody>
index b8fb1f5..e0ff341 100644 (file)
@@ -1,5 +1,5 @@
 {include file='admin/header.html'}
-<h3>Search Members</h3>
+<h3>Search</h3>
 
 {if $searchResults}
     <form action="{$thisUrl}?page={$thisPage}" method="post">
         {if $smarty.request.filterContactLastName}
             <input type="hidden" name="filterContactLastName" value="{$smarty.request.filterContactLastName}" />
         {/if}
-        <table>
-            <tr>
-                <th>Message</th>
-                <td>
-                    <select name="message_id" required>
-                        <option value="">-- Select --</option>
-                        {foreach $messages as $message}
-                        <option value="{$message.id}">{$message.subject}</option>
-                        {/foreach}
-                    </select>
-                </td>
-            </tr>
-            <tr>
-                <td colspan="2">
-                    <input type="submit" value="Send Messages" />
-                </td>
-            </tr>
-        </table>
+        <div class="grid-x grid-margin-x">
+            <div class="cell small-12">
+                <label for="message_id">Message</label>
+                <select id="message_id" name="message_id" required>
+                    <option value="">-- Select --</option>
+                    {foreach $messages as $message}
+                    <option value="{$message.id}">{$message.subject}</option>
+                    {/foreach}
+                </select>
+            </div>
+        </div>
+        <div class="grid-x grid-margin-x">
+            <div class="cell small-12">
+                <input type="submit" class="button" value="Send Messages" />
+            </div>
+        </div>
     </form>
 {else}
+    {if isset($searched) && $searched}
+    <div class="callout alert" data-closable>
+        There were no members or contacts matching your search.
+        <button class="close-button" aria-label="Dismiss alert" type="button" data-close>
+            <span aria-hidden="true">&times;</span>
+        </button>
+    </div>
+    {/if}
     {* Search Form *}
     <form action="{$thisUrl}?page={$thisPage}" method="post">
         <input type="hidden" name="page" value="{$thisPage}" />
         <input type="hidden" name="option" value="search" />
         <input type="hidden" name="search" value="1" />
-        <div clas="glma-row">
-            <div class="glma-small-4 glma-columns">
-                <h4>{$terms.term_member_cap} Info</h4>
-                <label for="filterMemberName">
-                    Name
-                </label>
-                <input id="filterMemberName" name="filterMemberName" />
-                <label for="filterMemberTypes">
-                    {$terms.term_member_cap} Type
-                </label>
-                <select id="filterMemberTypes" name="filterMemberTypes">
-                    <option value=""></option>
-                    {foreach $member_types as $type}
-                        <option value="{$type.id}"{if $type.id == $mTypeSelected} selected{/if}>{$type.name}</option>
-                    {/foreach}
-                </select>
-            </div>
-            <div class="glma-small-4 glma-columns">
-                <h4>{$terms.term_contact_cap} Info</h4>
-                <label for="filterContactEmail">
-                    Email
-                </label>
-                <input id="filterContactEmail" name="filterContactEmail" />
-                <label for="filterContactFirstName">
-                    First Name
-                </label>
-                <input id="filterContactFirstName" name="filterContactFirstName" />
-                <label for="filterContactLastName">
-                    Last Name
-                </label>
-                <input id="filterContactLastName" name="filterContactLastName" />
-            </div>
-            <div class="glma-small-4 glma-columns">
-                <h4>{$terms.term_member_cap} Profile Info</h4>
-                {* Multiselect Search Module. Set the necessary parameters for the element here *}
-                {assign var="multiSelectFilterID" value="filterCategories"}
-                {assign var="multiSelectFilterName" value="filterCategories[]"}
-                {assign var="multiSelectFilterData" value=$categories}
-                {assign var="multiSelectFilterPlaceholder" value="Filter Categories"}
-                {assign var="multiSelectFilterSearchTerm" value="Categories"}
-                {include file='admin/ui/multiSelectSearch.html'}
-                {* End Multiselect Search Module *}
-                <label for="filterMemberStatus">
-                    Status
-                </label>
-                <select id="filterMemberStatus" name="filterMemberStatus">
-                    <option value=""></option>
-                    {foreach $statusTypes as $key => $status}
-                        <option value="{$key}">{$status}</option>
-                    {/foreach}
-                </select>
-                <label for="filterMemberCity">
-                    City
-                </label>
-                <select id="filterMemberCity" name="filterMemberCity">
-                    <option value=""></option>
-                    {foreach $cities as $city}
-                        <option value="{$city.id}">{$city.name}</option>
-                    {/foreach}
-                </select>
-                {if $settings.enable_counties}
-                    <label for="filterMemberCounty">
-                        County
-                    </label>
-                    <select id="filterMemberCounty" name="filterMemberCounty">
-                        <option value=""></option>
-                        {foreach $counties as $county}
-                            <option value="{$county.id}">{$county.name}</option>
-                        {/foreach}
-                    </select>
-                {/if}
-                <label for="filterMemberState">
-                    State
-                </label>
-                <select id="filterMemberState" name="filterMemberState">
-                    <option value=""></option>
-                    {foreach $states as $abbr => $state}
-                        <option value="{$abbr}">{$state}</option>
-                    {/foreach}
-                </select>
-                <label for="filterMemberZip">
-                    Zip
-                </label>
-                <input id="filterMemberZip" name="filterMemberZip" />
+
+        <div class="grid-x grid-margin-x">
+            <div class="cell small-12">
+                <div class="grid-x medium-grid-frame">
+                    <div class="cell small-12 medium-6 medium-grid-container">
+                        <div class="grid-y grid-paddingxx">
+                            <div class="cell small-12 medium-6">
+                                <fieldset class="fieldset">
+                                    <legend>{$terms.term_member_cap} Info</legend>
+                                    <label for="filterMemberName"> Name </label>
+                                    <input type="text" id="filterMemberName" name="filterMemberName" />
+                                    <label for="filterMemberTypes"> {$terms.term_member_cap} Type </label>
+                                    <select id="filterMemberTypes" name="filterMemberTypes">
+                                        <option value=""></option>
+                                        {foreach $member_types as $type}
+                                            <option value="{$type.id}">{$type.name}</option>
+                                        {/foreach}
+                                    </select>
+                                </fieldset>
+                            </div>
+                            <div class="cell small-12 medium-6">
+                                <fieldset class="fieldset">
+                                    <legend>{$terms.term_contact_cap} Info</legend>
+                                    <label for="filterContactEmail"> Email </label>
+                                    <input type="text" id="filterContactEmail" name="filterContactEmail" />
+                                    <label for="filterContactFirstName"> First Name </label>
+                                    <input type="text" id="filterContactFirstName" name="filterContactFirstName" />
+                                    <label for="filterContactLastName"> Last Name </label>
+                                    <input type="text" id="filterContactLastName" name="filterContactLastName" />
+                                </fieldset>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="grid-x grid-padding-x medium-auto">
+                        <div class="cell small-12 medium-auto">
+                            <fieldset class="fieldset">
+                                <legend>{$terms.term_member_cap} Profile Info</legend>
+                                {* Multiselect Search Module. Set the necessary parameters for the element here *}
+                                {assign var="multiSelectFilterID" value="filterCategories"}
+                                {assign var="multiSelectFilterName" value="filterCategories[]"}
+                                {assign var="multiSelectFilterData" value=$categories}
+                                {assign var="multiSelectFilterPlaceholder" value="Filter Categories"}
+                                {assign var="multiSelectFilterSearchTerm" value="Categories"}
+                                {include file='admin/ui/multiSelectSearch.html'}
+                                {* End Multiselect Search Module *}
+                                <label for="filterMemberStatus"> Status </label>
+                                <select id="filterMemberStatus" name="filterMemberStatus">
+                                    <option value=""></option>
+                                    {foreach $statusTypes as $key => $status}
+                                        <option value="{$key}">{$status}</option>
+                                    {/foreach}
+                                </select>
+                                <label for="filterMemberCity"> City </label>
+                                <select id="filterMemberCity" name="filterMemberCity">
+                                    <option value=""></option>
+                                    {foreach $cities as $city}
+                                        <option value="{$city.id}">{$city.name}</option>
+                                    {/foreach}
+                                </select>
+                                {if $settings.enable_counties}
+                                    <label for="filterMemberCounty"> County </label>
+                                    <select id="filterMemberCounty" name="filterMemberCounty">
+                                        <option value=""></option>
+                                        {foreach $counties as $county}
+                                            <option value="{$county.id}">{$county.name}</option>
+                                        {/foreach}
+                                    </select>
+                                {/if}
+                                <label for="filterMemberState"> State </label>
+                                <select id="filterMemberState" name="filterMemberState">
+                                    <option value=""></option>
+                                    {foreach $states as $abbr => $state}
+                                        <option value="{$abbr}">{$state}</option>
+                                    {/foreach}
+                                </select>
+                                <label for="filterMemberZip"> Zip </label>
+                                <input type="text" id="filterMemberZip" name="filterMemberZip" />
+                            </fieldset>
+                        </div>
+                    </div>
+                </div>
             </div>
         </div>
 
-        <div class="glma-row">
-            <div class="glma-small-12 glma-columns">
+        <div class="grid-x grid-margin-x">
+            <div class="cell small-12">
                 <input class="button" type="submit" value="Search" />
             </div>
         </div>
 {if $emailsQueued}<span class="glm-notice glm-flash-updated">Emails Queued</span>{/if}
 
 {if $searchResults}
-    <table class="wp-list-table widefat fixed posts glm-admin-table" style="width: 1200px;">
+    <table class="stack" style="max-width: 800px;">
         <thead>
             <tr>
                 <th>ID</th>