From 2834aca2fafd8bc0dfceed19ac23201e71718a6b Mon Sep 17 00:00:00 2001
From: Nathan Febuary <nathan@bedheadcreative.com>
Date: Wed, 5 Aug 2015 14:30:52 -0500
Subject: [PATCH] FAQ tweaks: fixed buttons, adjusted layout for all pages
 concerning FAQ, resolved Consistency issues.

---
 include/staff/faq-categories.inc.php | 11 ++---
 include/staff/faq-category.inc.php   | 62 ++++++++++++++++++----------
 include/staff/faq-view.inc.php       | 50 +++++++++++-----------
 scp/css/scp.css                      | 29 +++++++++----
 4 files changed, 95 insertions(+), 57 deletions(-)

diff --git a/include/staff/faq-categories.inc.php b/include/staff/faq-categories.inc.php
index 2a3d56c58..a94b5303d 100644
--- a/include/staff/faq-categories.inc.php
+++ b/include/staff/faq-categories.inc.php
@@ -93,11 +93,12 @@ foreach ($topics as $T) {
 
     </div>
 </form>
-<div style="margin-bottom:20px; padding-top:5px;">
-    <div class="flush-left">
-<h2><?php echo __('Frequently Asked Questions');?></h2>
-    </div></div>
-<hr>
+    <div class="has_bottom_border" style="margin-bottom:5px; padding-top:5px;">
+        <div class="pull-left">
+            <h2><?php echo __('Frequently Asked Questions');?></h2>
+        </div>
+        <div class="clear"></div>
+    </div>
 <div>
 <?php
 if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
diff --git a/include/staff/faq-category.inc.php b/include/staff/faq-category.inc.php
index e00d068e1..d037f9f7b 100644
--- a/include/staff/faq-category.inc.php
+++ b/include/staff/faq-category.inc.php
@@ -2,32 +2,49 @@
 if(!defined('OSTSTAFFINC') || !$category || !$thisstaff) die('Access Denied');
 
 ?>
-<div class="pull-left" style="width:700px;padding-top:10px;">
+<div class="has_bottom_border" style="margin-bottom:5px; padding-top:5px;">
+<div class="pull-left">
   <h2><?php echo __('Frequently Asked Questions');?></h2>
 </div>
-<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;">&nbsp;</div>
-<div class="clear"></div>
-<br>
-<div>
-    <strong><?php echo $category->getName() ?></strong>
-    <span>(<?php echo $category->isPublic()?__('Public'):__('Internal'); ?>)</span>
-    <time class="faq"> <?php echo __('Last updated').' '. Format::daydatetime($category->getUpdateDate()); ?></time>
+<?php if ($thisstaff->hasPerm(FAQ::PERM_MANAGE)) {
+echo sprintf('<div class="pull-right flush-right">
+    <a class="green action-button" href="faq.php?cid=%d&a=add">'.__('Add New FAQ').'</a>
+    <span class="action-button" data-dropdown="#action-dropdown-more"
+          style="/*DELME*/ vertical-align:top; margin-bottom:0">
+        <i class="icon-caret-down pull-right"></i>
+        <span ><i class="icon-cog"></i>'. __('More').'</span>
+    </span>
+    <div id="action-dropdown-more" class="action-dropdown anchor-right">
+        <ul>
+            <li><a class="user-action" href="categories.php?id=%d">
+                <i class="icon-pencil icon-fixed-width"></i>'
+                .__('Edit Category').'</a>
+            </li>
+            <li class="danger">
+                <a class="user-action" href="categories.php">
+                    <i class="icon-trash icon-fixed-width"></i>'
+                    .__('Delete Category').'</a>
+            </li>
+        </ul>
+    </div>
+</div>', $category->getId(), $category->getId());
+} else {
+?><?php
+} ?>
+    <div class="clear"></div>
+
 </div>
-<div class="cat-desc">
-<?php echo Format::display($category->getDescription()); ?>
+<div class="faq-category">
+    <div style="margin-bottom:10px;">
+        <div class="faq-title pull-left"><?php echo $category->getName() ?></div>
+        <div class="faq-status inline">(<?php echo $category->isPublic()?__('Public'):__('Internal'); ?>)</div>
+        <div class="clear"><time class="faq"> <?php echo __('Last updated').' '. Format::daydatetime($category->getUpdateDate()); ?></time></div>
+    </div>
+    <div class="cat-desc has_bottom_border">
+    <?php echo Format::display($category->getDescription()); ?>
 </div>
 <?php
-if ($thisstaff->hasPerm(FAQ::PERM_MANAGE)) {
-    echo sprintf('<div class="cat-manage-bar"><a href="categories.php?id=%d" class="Icon editCategory">'.__('Edit Category').'</a>
-             <a href="categories.php" class="Icon deleteCategory">'.__('Delete Category').'</a>
-             <a href="faq.php?cid=%d&a=add" class="Icon newFAQ">'.__('Add New FAQ').'</a></div>',
-            $category->getId(),
-            $category->getId());
-} else {
-?>
-<hr>
-<?php
-}
+
 
 $faqs = $category->faqs
     ->constrain(array('attachments__inline' => 0))
@@ -37,7 +54,7 @@ if ($faqs->exists(true)) {
             <ol>';
     foreach ($faqs as $faq) {
         echo sprintf('
-            <li><a href="faq.php?id=%d" class="previewfaq">%s <span>- %s</span></a> %s</li>',
+            <li><strong><a href="faq.php?id=%d" class="previewfaq">%s <span>- %s</span></a> %s</strong></li>',
             $faq->getId(),$faq->getQuestion(),$faq->isPublished() ? __('Published'):__('Internal'),
             $faq->attachments ? '<i class="icon-paperclip"></i>' : ''
         );
@@ -48,3 +65,4 @@ if ($faqs->exists(true)) {
     echo '<strong>'.__('Category does not have FAQs').'</strong>';
 }
 ?>
+</div>
diff --git a/include/staff/faq-view.inc.php b/include/staff/faq-view.inc.php
index 2fe515964..8f8daf77c 100644
--- a/include/staff/faq-view.inc.php
+++ b/include/staff/faq-view.inc.php
@@ -3,8 +3,30 @@ if(!defined('OSTSTAFFINC') || !$faq || !$thisstaff) die('Access Denied');
 
 $category=$faq->getCategory();
 
-?>
-<h2><?php echo __('Frequently Asked Questions');?></h2>
+?><div class="has_bottom_border" style="padding-top:5px;">
+<div class="pull-left"><h2><?php echo __('Frequently Asked Questions');?></h2></div>
+<div class="pull-right flush-right">
+<?php
+$query = array();
+parse_str($_SERVER['QUERY_STRING'], $query);
+$query['a'] = 'print';
+$query['id'] = $faq->getId();
+$query = http_build_query($query); ?>
+    <a href="faq.php?<?php echo $query; ?>" class="no-pjax action-button">
+    <i class="icon-print"></i>
+        <?php echo __('Print'); ?>
+    </a>
+<?php
+if ($thisstaff->hasPerm(FAQ::PERM_MANAGE)) { ?>
+    <a href="faq.php?id=<?php echo $faq->getId(); ?>&a=edit" class="action-button">
+    <i class="icon-edit"></i>
+        <?php echo __('Edit FAQ'); ?>
+    </a>
+<?php } ?>
+</div><div class="clear"></div>
+
+</div>
+
 <div id="breadcrumbs">
     <a href="kb.php"><?php echo __('All Categories');?></a>
     &raquo; <a href="kb.php?cid=<?php echo $category->getId(); ?>"><?php echo $category->getName(); ?></a>
@@ -16,13 +38,13 @@ $category=$faq->getCategory();
 <section>
     <header><?php echo __('Attachments');?>:</header>
 <?php foreach ($attachments as $att) { ?>
-    <div>
+<div>
     <i class="icon-paperclip pull-left"></i>
     <a target="_blank" href="<?php echo $att->file->getDownloadUrl(); ?>"
         class="attachment no-pjax">
         <?php echo Format::htmlchars($att->getFilename()); ?>
     </a>
-    </div>
+</div>
 <?php } ?>
 </section>
 <?php } ?>
@@ -67,25 +89,7 @@ if ($otherLangs) { ?>
 </div>
 
 <div class="faq-content">
-<div class="faq-manage pull-right">
-<?php
-$query = array();
-parse_str($_SERVER['QUERY_STRING'], $query);
-$query['a'] = 'print';
-$query['id'] = $faq->getId();
-$query = http_build_query($query); ?>
-    <a href="faq.php?<?php echo $query; ?>" class="no-pjax action-button">
-    <i class="icon-print"></i>
-        <?php echo __('Print'); ?>
-    </a>
-<?php
-if ($thisstaff->hasPerm(FAQ::PERM_MANAGE)) { ?>
-    <a href="faq.php?id=<?php echo $faq->getId(); ?>&a=edit" class="action-button">
-    <i class="icon-edit"></i>
-        <?php echo __('Edit FAQ'); ?>
-    </a>
-<?php } ?>
-</div>
+
 
 <div class="faq-title flush-left"><?php echo $faq->getLocalQuestion() ?>
 </div>
diff --git a/scp/css/scp.css b/scp/css/scp.css
index eeb6d0aa1..19219d379 100644
--- a/scp/css/scp.css
+++ b/scp/css/scp.css
@@ -94,6 +94,8 @@ a time.relative {
 #breadcrumbs {
     color: #333;
     margin-bottom: 15px;
+    background-color:#F4FAFF;
+    padding:8px;
 }
 
 #breadcrumbs a {
@@ -1458,7 +1460,9 @@ h2 > i.help-tip {
   background-repeat:no-repeat, repeat-x;
   border-bottom:1px solid #ddd;
 }
-
+#kb li:last-child {
+    border-bottom:none;
+}
 
 #kb li h4 {
     padding-bottom:3px;
@@ -1485,20 +1489,24 @@ h2 > i.help-tip {
 #faq {
   clear: both;
   margin: 0;
-  padding: 5px 0 10px 5px;
+  padding: 0px 0 10px 0px;
 }
 #faq ol {
   font-size: 15px;
   margin-left: 0;
   padding-left: 0;
+  margin:0!IMPORTANT;
 }
 #faq ol li {
   list-style: none;
-  margin: 0;
-  padding:5px 0;
+  margin: 0 0;
+  padding:10px 0 10px;
   color: #999;
   border-bottom:1px solid #ddd;
 }
+#faq ol li:last-child {
+  border-bottom:none;
+}
 
 #faq ol li a {
   display: inline;
@@ -1520,13 +1528,12 @@ h2 > i.help-tip {
 
 time.faq {
     display:inline-block;
-    float:right;
     color:#777;
 }
 
 .cat-desc {
     padding-top:5px;
-    padding-bottom:25px;
+    padding-bottom:15px;
 }
 
 .cat-manage-bar {
@@ -2315,15 +2322,23 @@ table.custom-info td {
     border-bottom: 1px dotted rgba(0,0,0,0.3);
 }
 
+div.faq-status {
+   padding-top:6px;
+
+}
+
 .faq-title {
     font-size: 170%;
     font-weight: 400;
-    padding-right: 200px;
+    margin-right:10px;
 }
 .faq-content {
     width: 670px;
     margin: 0 15px;
 }
+.faq-category {
+    margin:0 15px;
+}
 .faq-meta section + section {
     margin-top: 15px;
 }
-- 
GitLab