changeset 2603:085033abcf39

Fixes issue #73 in sharky's repo - Sidebar too large in basic theme. Reduced the padding of the divs in the sidebar from 10px to 5px and also made the User Actions, Item Actions and View Options expandable to make the sidebar smaller in normal case. User can click on '+' to expand or collapse the appropriate menu.
author Ajitesh Gupta <ajgupta93@gmail.com>
date Mon, 26 May 2014 14:16:15 +0530
parents 4a997d9f5e26
children 600a9b4de684
files MoinMoin/static/js/common.js MoinMoin/themes/basic/static/css/basic.css MoinMoin/themes/basic/static/custom-less/basic.less MoinMoin/themes/basic/templates/show.html MoinMoin/themes/modernized/static/css/common.css
diffstat 5 files changed, 71 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/static/js/common.js	Fri May 09 15:30:04 2014 -0700
+++ b/MoinMoin/static/js/common.js	Mon May 26 14:16:15 2014 +0530
@@ -617,7 +617,9 @@
 
     moin.selected_link();
     moin.initTransclusionOverlays();
-    moin.QuicklinksExpander();
+    if(document.getElementById('moin-navibar')!=null) {
+        moin.QuicklinksExpander();
+    }
 
     $('.moin-insertname-action').click(function () {
         var fullname = $(this).data('name');
@@ -628,6 +630,21 @@
         moin.toggleSubtree(this);
     });
 
+    $('.moin-useractions').click(function () {
+        $('#user-actions').toggleClass('hidden');
+        return false;
+    });
+
+    $('.moin-viewoptions').click(function () {
+        $('#view-options').toggleClass('hidden');
+        return false;
+    });
+
+    $('.moin-itemactions').click(function () {
+        $('#item-actions').toggleClass('hidden');
+        return false;
+    });
+
     moin.enhanceUserSettings();
     moin.enhanceEdit();
     // placing initToggleComments after enhanceEdit prevents odd autoscroll issue when editing hidden comments
--- a/MoinMoin/themes/basic/static/css/basic.css	Fri May 09 15:30:04 2014 -0700
+++ b/MoinMoin/themes/basic/static/css/basic.css	Mon May 26 14:16:15 2014 +0530
@@ -4605,7 +4605,7 @@
 .list-group-item {
   position: relative;
   display: block;
-  padding: 10px 15px;
+  padding: 5px 15px;
   margin-bottom: -1px;
   background-color: #ffffff;
   border: 1px solid #dddddd;
@@ -5900,7 +5900,7 @@
 .moin-user-action-special {
   position: relative;
   display: block;
-  padding: 10px 15px;
+  padding: 5px 15px;
   margin-bottom: -1px;
   background-color: #ffffff;
   width: 100%;
@@ -6133,7 +6133,7 @@
 }
 .moin-quicklink {
   position: relative;
-  padding: 10px 15px 10px 15px;
+  padding: 5px 15px 5px 15px;
   border: 1px solid #dddddd;
   margin-bottom: -1px;
 }
@@ -6323,3 +6323,9 @@
 ul.moin-breadcrumb li:hover ul.moin-bcs-subitems {
   display: block;
 }
+.moin-viewoptions, .moin-itemactions, .moin-useractions {
+  float: right;
+}
+.list-group-item {
+  padding: 5px 15px;
+}
--- a/MoinMoin/themes/basic/static/custom-less/basic.less	Fri May 09 15:30:04 2014 -0700
+++ b/MoinMoin/themes/basic/static/custom-less/basic.less	Mon May 26 14:16:15 2014 +0530
@@ -82,6 +82,15 @@
   }
   border: 1px solid @list-group-border;
   border-radius: 0;
+  padding: 5px 15px;
+}
+
+.moin-viewoptions, .moin-itemactions, .moin-useractions {
+  float: right;
+}
+
+.list-group-item {
+  padding: 5px 15px;
 }
 
 .moin-diff-added {
@@ -157,7 +166,7 @@
 
 .moin-quicklink {
   position: relative;
-  padding: 10px 15px 10px 15px;
+  padding: 5px 15px 5px 15px;
   border: 1px solid @list-group-border;
   margin-bottom: -1px;
 
--- a/MoinMoin/themes/basic/templates/show.html	Fri May 09 15:30:04 2014 -0700
+++ b/MoinMoin/themes/basic/templates/show.html	Mon May 26 14:16:15 2014 +0530
@@ -32,33 +32,44 @@
         <!-- user, site, item actions -->
     <div class="list-group">
         {% if user_actions %}
-            <div class="list-group-item moin-list-heading"> {{ _("User Actions") }} </div>
-            {{ self.user_actions() }}
+            <div class="list-group-item moin-list-heading">
+                {{ _("User Actions") }}
+                <a class="moin-showhide moin-useractions" href="#" >[+]</a>
+            </div>
+            <div id="user-actions" class="hidden">{{ self.user_actions() }}</div>
         {% endif %}
 
-        <div class="list-group-item moin-list-heading">View Options</div>
-        <button type="button"
-                class="btn btn-default moin-user-action-special moin-toggle-comments-button"
-                data-toggle="button"
-                title="Show Comments">
-            <span class="pull-left">
-                <i class="icon-comment icon-fixed-width"></i>
-                Comments
-            </span>
-        </button>
-        <button type="button"
-                class="btn btn-default moin-user-action-special moin-transclusions-button"
-                data-toggle="button"
-                title="Show Transclusions">
-            <span class="pull-left">
-                <i class="icon-edit icon-fixed-width"></i>
-                Transclusions
-            </span>
-        </button>
+        <div class="list-group-item moin-list-heading">
+            View Options
+            <a class="moin-showhide moin-viewoptions" href="#">[+]</a>
+        </div>
+        <div id="view-options" class="hidden">
+            <button type="button"
+                    class="btn btn-default moin-user-action-special moin-toggle-comments-button"
+                    data-toggle="button"
+                    title="Show Comments">
+                <span class="pull-left">
+                    <i class="icon-comment icon-fixed-width"></i>
+                    Comments
+                </span>
+            </button>
+            <button type="button"
+                    class="btn btn-default moin-user-action-special moin-transclusions-button"
+                    data-toggle="button"
+                    title="Show Transclusions">
+                <span class="pull-left">
+                    <i class="icon-edit icon-fixed-width"></i>
+                    Transclusions
+                </span>
+            </button>
+        </div>
 
         {% if item_actions %}
-            <div class="list-group-item moin-list-heading"> {{ _("Item Actions") }} </div>
-            {{ self.item_actions() }}
+            <div class="list-group-item moin-list-heading">
+                {{ _("Item Actions") }}
+                <a class="moin-showhide moin-itemactions" href="#" >[+]</a>
+            </div>
+            <div id="item-actions" class="hidden">{{ self.item_actions() }}</div>
         {% endif %}
     </div>
 
--- a/MoinMoin/themes/modernized/static/css/common.css	Fri May 09 15:30:04 2014 -0700
+++ b/MoinMoin/themes/modernized/static/css/common.css	Mon May 26 14:16:15 2014 +0530
@@ -539,4 +539,3 @@
 ul.moin-bcs-item li{position:relative}
 ul.moin-bcs-item li ul.moin-bcs-subitems{display:none;position:absolute}
 ul.moin-bcs-item li:hover ul.moin-bcs-subitems{display:block}
-