changeset 2390:2d0c705b6b42

Fixes #31, use of a custom class for quicklinks
author sharky93 <rishabhr123@gmail.com>
date Sat, 17 Aug 2013 18:10:50 +0530
parents d6f71eda64d6
children b90f9f175060
files MoinMoin/themes/basic/static/css/basic.css MoinMoin/themes/basic/static/custom-less/basic.less MoinMoin/themes/basic/templates/layout.html MoinMoin/themes/basic/templates/show.html
diffstat 4 files changed, 92 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/static/css/basic.css	Sat Aug 17 14:10:46 2013 +0530
+++ b/MoinMoin/themes/basic/static/css/basic.css	Sat Aug 17 18:10:50 2013 +0530
@@ -4393,3 +4393,34 @@
 .moin-navbar-inverse .navbar-nav > li > a {
   color: #c8ddf1;
 }
+.moin-quicklink {
+  position: relative;
+  padding: 10px 15px 10px 15px;
+  border: 1px solid #dddddd;
+  margin-bottom: -1px;
+}
+.moin-quicklink:last-child {
+  margin-bottom: 0;
+  border-bottom-right-radius: 4px;
+  border-bottom-left-radius: 4px;
+}
+.moin-quicklink:hover,
+.moin-quicklink:focus {
+  background-color: #f5f5f5;
+}
+.moin-quicklink-label {
+  display: block;
+}
+.moin-quicklink-label:hover,
+.moin-quicklink-label:focus {
+  text-decoration: none;
+}
+.moin-quicklink-delete {
+  position: absolute;
+  left: 80%;
+  top: 25%;
+}
+.moin-quicklink-delete:hover,
+.moin-quicklink-delete:focus {
+  text-decoration: none;
+}
--- a/MoinMoin/themes/basic/static/custom-less/basic.less	Sat Aug 17 14:10:46 2013 +0530
+++ b/MoinMoin/themes/basic/static/custom-less/basic.less	Sat Aug 17 18:10:50 2013 +0530
@@ -47,3 +47,39 @@
     }
   }
 }
+
+.moin-quicklink {
+  position: relative;
+  padding: 10px 15px 10px 15px;
+  border: 1px solid @list-group-border;
+  margin-bottom: -1px;
+
+  &:last-child {
+    margin-bottom: 0;
+    .border-bottom-radius(@border-radius-base);
+  }
+
+  // Hover state
+  &:hover,
+  &:focus {
+    background-color: @list-group-hover-bg;
+  }
+}
+
+.moin-quicklink-label {
+  display: block;
+  &:hover,
+  &:focus {
+    text-decoration: none;
+  }
+}
+
+.moin-quicklink-delete {
+  position: absolute;
+  left: 80%;
+  top: 25%;
+  &:hover,
+  &:focus {
+    text-decoration: none;
+  }
+}
\ No newline at end of file
--- a/MoinMoin/themes/basic/templates/layout.html	Sat Aug 17 14:10:46 2013 +0530
+++ b/MoinMoin/themes/basic/templates/layout.html	Sat Aug 17 18:10:50 2013 +0530
@@ -90,8 +90,13 @@
                         {% if loop.first %}
                             <div class="list-group-item">Quick Links</div>
                         {% endif %}
-                            <a class="list-group-item {{ cls }}" href="{{ url }}" {% if title %}title="{{ title }}"{% endif %}>{{ text|shorten_item_name }}
+                            <div class="moin-quicklink">
+                            <a class="moin-quicklink-label {{ cls }}" href="{{ url }}" {% if title %}title="{{ title }}"{% endif %}>{{ text|shorten_item_name }}
                             </a>
+                            <a class="moin-quicklink-delete" href="{{ url_for('frontend.quicklink_item', item_name=text) }}"> 
+                                <i class="icon-remove"></i>
+                            </a>
+                        </div>
                     {% endfor %}
                 </div>
             </div><!--/span-->
--- a/MoinMoin/themes/basic/templates/show.html	Sat Aug 17 14:10:46 2013 +0530
+++ b/MoinMoin/themes/basic/templates/show.html	Sat Aug 17 18:10:50 2013 +0530
@@ -30,24 +30,27 @@
             {%- if not check_exists or check_exists and exists %}
 
                 {%- if endpoint in user_actions %}
-                    <a class="list-group-item" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                    {%- if endpoint == 'frontend.quicklink_item' %}
+                        {%- if not user.is_quicklinked_to([item_name]) %}
+                            <a class="list-group-item" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                            <span class="icon-stack">
+                                <i class={{icon[endpoint]}}></i>
+                            </span> 
+                            {{ _('Add Link') }}
+                            </a>
+                        {%- endif %}
+                    {% elif endpoint == 'frontend.subscribe_item' %}
+                        <a class="list-group-item" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                         <span class="icon-stack">
                             <i class={{icon[endpoint]}}></i>
-                        </span>
-                        {%- if endpoint == 'frontend.quicklink_item' %}
-                            {%- if user.is_quicklinked_to([item_name]) %}
-                                {{ _('Remove Link') }}
-                            {%- else %}
-                                {{ _('Add Link') }}
-                            {%- endif %}
-                        {% elif endpoint == 'frontend.subscribe_item' %}
-                            {%- if user.is_subscribed_to([item_name]) %}
-                                {{ _('Unsubscribe') }}
-                            {%- else %}
-                                {{ _('Subscribe') }}
-                            {%- endif %}
-                        {% endif %}
-                    </a>
+                        </span> 
+                        {%- if user.is_subscribed_to([item_name]) %}
+                            {{ _('Unsubscribe') }}
+                        {%- else %}
+                            {{ _('Subscribe') }}
+                        {%- endif %}
+                        </a>
+                    {% endif %}
                 {%- endif %}
 
             {%- endif %}