Admin contact list table reformatted for small view
authorLaury GvR <laury@gaslightmedia.com>
Thu, 9 Aug 2018 13:10:51 +0000 (09:10 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 9 Aug 2018 13:10:51 +0000 (09:10 -0400)
css/admin.css
views/admin/contacts/edit.html
views/admin/contacts/index.html

index 990ae6b..40a23a6 100644 (file)
@@ -454,3 +454,88 @@ display: inline-block;
     margin: 0;
     margin-right: 5px;
 }
+
+/* 
+Max width before this PARTICULAR table gets nasty
+This query will take effect for any screen smaller than 760px
+and also iPads specifically.
+*/
+@media 
+only screen and (max-width: 760px),
+(min-device-width: 768px) and (max-device-width: 1024px)  {
+
+       /* Force table to not be like tables anymore */
+    #wpbody-content #glm-admin-contact-wrapper #searchForm table,
+    #wpbody-content #glm-admin-contact-wrapper #searchForm thead,
+    #wpbody-content #glm-admin-contact-wrapper #searchForm tbody,
+    #wpbody-content #glm-admin-contact-wrapper #searchForm th,
+    #wpbody-content #glm-admin-contact-wrapper #searchForm td,
+    #wpbody-content #glm-admin-contact-wrapper #searchForm tr { 
+               display: block; 
+       }
+       
+       /* Hide table headers (but not display: none;, for accessibility) */
+       #wpbody-content #glm-admin-contact-wrapper #searchForm thead tr { 
+               position: absolute;
+               top: -9999px;
+               left: -9999px;
+       }
+       
+       #wpbody-content #glm-admin-contact-wrapper #searchForm tr { border: 1px solid #ccc; }
+       
+       #wpbody-content #glm-admin-contact-wrapper #searchForm td { 
+               /* Behave  like a "row" */
+               border: none;
+               border-bottom: 1px solid #eee; 
+               position: relative;
+               padding-left: 25%; 
+       }
+       
+       #wpbody-content #glm-admin-contact-wrapper #searchForm td:before { 
+               /* Now like a table header */
+               position: absolute;
+               /* Top/left values mimic padding */
+               top: 6px;
+               left: 6px;
+               width: 25%; 
+               padding-right: 10px; 
+               white-space: nowrap;
+       }
+       /*
+       Label the data
+       */
+       #wpbody-content #glm-admin-contact-wrapper #searchForm td:nth-of-type(1):before { content: "Name"; }
+       #wpbody-content #glm-admin-contact-wrapper #searchForm td:nth-of-type(2):before { content: "Active"; }
+       #wpbody-content #glm-admin-contact-wrapper #searchForm td:nth-of-type(3):before { content: "Primary"; }
+       #wpbody-content #glm-admin-contact-wrapper #searchForm td:nth-of-type(4):before { content: "Type"; }
+       #wpbody-content #glm-admin-contact-wrapper #searchForm td:nth-of-type(5):before { content: "Access"; }
+       #wpbody-content #glm-admin-contact-wrapper #searchForm td:nth-of-type(6):before { content: "User"; }
+    #wpbody-content #glm-admin-contact-wrapper #searchForm td:nth-of-type(7):before { content: "Entity"; }
+    
+    /* Table styles */
+    #wpbody-content #glm-admin-contact-wrapper #searchForm .wp-list-table {
+        max-width: 100%;
+    }
+    #wpbody-content #glm-admin-contact-wrapper #searchForm .wp-list-table tr {
+        padding: 10px 0;
+    }
+    #wpbody-content #glm-admin-contact-wrapper #searchForm .wp-list-table td:before {
+        top: 1px;
+        font-weight: bold;
+    }
+    #wpbody-content #glm-admin-contact-wrapper #searchForm .striped>tbody>:nth-child(even) {
+        background-color: #f2ffff;
+    }
+
+    /* Misc */
+    #glm-admin-contact-wrapper .glm-contact-top-buttons {
+        text-align: center;
+    }
+    #glm-admin-contact-wrapper .glm-contact-top-buttons > * {
+        margin: 10px auto 10px;
+        float: none;
+        clear: both;
+    }
+}
+
index fd0de8f..4e0fde9 100644 (file)
 
     {if apply_filters('glm_members_permit_admin_member_contacts_edit_contact', true)}
 
-    {if $option == 'create' || $option == 'edit'}
 
-    {if $option == 'create'}
-        <h2>Add New Contact</h2>
-    {else}
-        {if $newEmailError != ''}
-        <h2 class="glm-required glm-flash-updated">NOTE: Your new E-Mail address was not valid. Please see below.</h2>
+    <div class="glm-contact-top-buttons">
+        {if $option == 'create' || $option == 'edit'}
+
+        {if $option == 'create'}
+            <h2>Add New Contact</h2>
         {else}
-        {if $contactUpdated}<h2 class="glm-notice glm-flash-updated">Contact Updated</h2>{/if}
-        {/if}
-        {if !$contactEditOwnRecord}
-        <a id="deleteContactButton" class="button button-primary glm-button glm-right">Delete this Contact</a>
-        {/if}
-        <div id="deleteContactDialog" class="glm-dialog-box" title="Delete Contact">
-            <center>
-                <p><a id="deleteContactCancel" class="button button-primary">Cancel</a></p>
-                <p><input id="deleteContactSubmit" type="submit" value="Delete this contact"></p>
-            </center>
-            <div class="glm-item-container">
-                <p><center><span class="glm-error">WARNING:</span></center></p>
-                <p>
-                    <span class="glm-warning">Clicking the "Delete this Contact" button above will
-                    delete all of the data and images associated with this contact.
-                    </span>
-                </p>
+            {if $newEmailError != ''}
+            <h2 class="glm-required glm-flash-updated">NOTE: Your new E-Mail address was not valid. Please see below.</h2>
+            {else}
+            {if $contactUpdated}<h2 class="glm-notice glm-flash-updated">Contact Updated</h2>{/if}
+            {/if}
+            {if !$contactEditOwnRecord}
+            <a id="deleteContactButton" class="button button-primary glm-button glm-right">Delete this Contact</a>
+            {/if}
+            <div id="deleteContactDialog" class="glm-dialog-box" title="Delete Contact">
+                <center>
+                    <p><a id="deleteContactCancel" class="button button-primary">Cancel</a></p>
+                    <p><input id="deleteContactSubmit" type="submit" value="Delete this contact"></p>
+                </center>
+                <div class="glm-item-container">
+                    <p><center><span class="glm-error">WARNING:</span></center></p>
+                    <p>
+                        <span class="glm-warning">Clicking the "Delete this Contact" button above will
+                        delete all of the data and images associated with this contact.
+                        </span>
+                    </p>
+                    <p>
+                        <span class="glm-error">Once deleted, this information will no longer be available and cannot be retrieved!</span>
+                    </p>
+                </div>
                 <p>
-                    <span class="glm-error">Once deleted, this information will no longer be available and cannot be retrieved!</span>
+                    This contact may instead be "Archived" rather than deleted using the "Contact Display:" pick-list. When archived, the contact is not displayed on the front-end
+                    of the Web site, any login assoicated with this contact is deactivated, and the contact will not show on contact lists unless "Archived" is selected.
+                    Unlike delete, an archived contact may be changed back to normal use.
                 </p>
             </div>
-            <p>
-                This contact may instead be "Archived" rather than deleted using the "Contact Display:" pick-list. When archived, the contact is not displayed on the front-end
-                of the Web site, any login assoicated with this contact is deactivated, and the contact will not show on contact lists unless "Archived" is selected.
-                Unlike delete, an archived contact may be changed back to normal use.
-            </p>
-        </div>
-    {/if}
+        {/if}
+
+        {if $fromMemberMenu}
+            <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=contacts&member={$memberID}" class="button button-primary glm-button glm-right">Return to Contact List</a>
+        {else}
+            <a href="{$thisUrl}?page=glm-members-admin-menu-contacts&glm_action=index&member={$memberID}" class="button button-primary glm-button glm-right">Return to Contact List</a>
+        {/if}
 
-    {if $fromMemberMenu}
-        <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=contacts&member={$memberID}" class="button button-primary glm-button glm-right">Return to Contact List</a>
-    {else}
-        <a href="{$thisUrl}?page=glm-members-admin-menu-contacts&glm_action=index&member={$memberID}" class="button button-primary glm-button glm-right">Return to Contact List</a>
-    {/if}
 
+        <div id="glm-contact-fullprofile-toggle" class="">Expand All</div>
+        <div id="tryOrange">Try Orange</div>
+        <div id="tryBlue">Try Blue</div>
+    </div>
 
-    <div id="glm-contact-fullprofile-toggle" class="">Expand All</div>
-    <div id="tryOrange">Try Orange</div>
-    <div id="tryBlue">Try Blue</div>
     {if $fromMemberMenu}
         <form action="{$thisUrl}?page=glm-members-admin-menu-member" method="post" enctype="multipart/form-data">
             <input type="hidden" name="glm_action" value="contacts">
                     </div>
                 </div>
                 <div id="glm-contact-company-info-toggle" class="glm-contact-content-toggle">
-                    <h3 class="section-title">Organization/Company Information</h3>
+                    <h3 class="section-title">Organization / Company Information</h3>
                 </div>
                 <div id="glm-contact-company-info-container" class="glm-admin-form-section glm-contact-content-data">
                     <div id="glm-contact-company-info">
                                 </td>
                             </tr>
                             <tr>
-                                <th {if $contactInfo.fieldRequired.org}class="glm-required"{/if}>Organization/Company Name</th>
+                                <th {if $contactInfo.fieldRequired.org}class="glm-required"{/if}>Organization / Company Name</th>
                                 <td {if $contactInfo.fieldFail.org}class="glm-form-bad-input"{/if}>
                                     <input type="text" name="org" value="{$contactInfo.fieldData.org}" class="glm-form-text-input-medium">
                                     {if $contactInfo.fieldFail.org}<p>{$contactInfo.fieldFail.org}</p>{/if}
                         </div>
                     </div>
                 </div>
-                <div id="glm-contact-notes-toggle" class="glm-contact-content-toggle">
+                <div id="glm-contact-notes-toggle" class="glm-contact-content-toggle {if $contactEditOwnRecord}glm-hidden{/if}">
                     <h3 class="section-title">Notes</h3>
                 </div>
-                <div id="glm-contact-notes-container" class="glm-admin-form-section glm-contact-content-data">
+                <div id="glm-contact-notes-container" class="glm-admin-form-section glm-contact-content-data {if $contactEditOwnRecord}glm-hidden{/if}">
                     <div id="glm-contact-notes">
                         <table class="glm-admin-table glm-admin-table-inner">
                             <tr>
index 589b6a2..35e3eb3 100644 (file)
     {include file='admin/contacts/header.html'}
 {/if}
 
-{if apply_filters('glm_members_permit_admin_member_contacts_add_contact', true)}
-    {if $fromMemberMenu}
-        <a href="{$thisUrl}?page={$thisPage}&glm_action=contacts&member={$memberID}&option=create" class="button button-primary glm-button glm-right">Add New {$terms.term_member_cap} Contact</a>
-    {else}
-        <a href="{$thisUrl}?page=glm-members-admin-menu-contacts&glm_action=index&option=create" class="button button-primary glm-button glm-right">Add New {$terms.term_member_cap} Contact</a>
-    {/if}
-       <br>
-       <br clear="all">
-    {if !$fromMemberMenu && !$loggedInMember}
-        <div id="exportContactsButton" class="button button-secondary glm-admin-export-button">Contact Export/Reports</div>
+    <div class="glm-contact-top-buttons">
+    {if apply_filters('glm_members_permit_admin_member_contacts_add_contact', true)}
+        {if $fromMemberMenu}
+            <a href="{$thisUrl}?page={$thisPage}&glm_action=contacts&member={$memberID}&option=create" class="button button-primary glm-button glm-right">Add New {$terms.term_member_cap} Contact</a>
+        {else}
+            <a href="{$thisUrl}?page=glm-members-admin-menu-contacts&glm_action=index&option=create" class="button button-primary glm-button glm-right">Add New {$terms.term_member_cap} Contact</a>
+        {/if}
+        <br>
+        <br clear="all">
+        {if !$fromMemberMenu && !$loggedInMember}
+            <div id="exportContactsButton" class="button button-secondary glm-admin-export-button">Contact Export/Reports</div>
+        {/if}
     {/if}
-{/if}
+    </div>
 
     <form action="{$thisUrl}?page={$thisPage}" method="post" id="searchForm">
         <input type="hidden" name="prevStart" value="{$prevStart}">
         <input type="hidden" name="nextStart" value="{$nextStart}">
         <input type="hidden" name="limit" value="{$limit}">
 
-        <div class="">
+        <div class="glm-contact-admin-searchfilters">
             <span{if $haveFilter} class="glm-notice"{/if}><b>List Filters:</b>&nbsp;&nbsp;</span>
             &nbsp;&nbsp;
-            <span class="glm-nowrap">
+            <span>
                 <b>Text Search: </b><input  id="glmContactsSearch" name="filterText" type="text" id="autoTest" value="{$filterText}">
                 <input id="glmContactSearchSubmit" type="submit" value="Submit">
-        </div>
+            </span>
 
         {apply_filters('glm-member-db-custom-filter-search', '', 'glm-member-db-contacts' )}
 
+        </div>
+
         <br clear="all">
 
         <p><b>Total found:</b> {$numbContacts}&nbsp;&nbsp;</p>
@@ -72,7 +76,7 @@
             {/if}
                     </td>
                     <td class="glm-shrink">{$c.active.name}</td>
-                    <td class="glm-shrink">{if $c.primary_contact.value}Yes{/if}</td>
+                    <td class="glm-shrink">{$c.primary_contact.name}</td>
                     <td>{$c.contact_type.name}</td>
                     <td class="glm-shrink">{$c.access.name}</td>
                     <td class="glm-nowrap">{$c.username}</td>