allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [26/26] allura git commit: [#7885] Added tooltip config to master jinja template
Date Mon, 15 Jun 2015 14:23:15 GMT
[#7885] Added tooltip config to master jinja template


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/b0743a49
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/b0743a49
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/b0743a49

Branch: refs/heads/hs/7885
Commit: b0743a49749193b868a5c0f4dfb2142aa5b6a225
Parents: 034134b
Author: Heith Seewald <hseewald@slashdotmedia.com>
Authored: Mon Jun 8 15:43:53 2015 -0400
Committer: Heith Seewald <hseewald@slashdotmedia.com>
Committed: Mon Jun 15 14:21:49 2015 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/widgets.py              |  25 ++-
 Allura/allura/lib/widgets/forms.py              |   4 +
 Allura/allura/nf/allura/css/allura.css          |   2 +-
 .../allura/public/nf/css/forge/tooltipster.css  |  29 ++-
 .../allura/templates/jinja_master/master.html   | 223 ++++++++++---------
 5 files changed, 164 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 5fb5bbd..3f342fd 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -150,7 +150,14 @@ class ScreenshotAdmin(ff.ForgeForm):
         fields = [
             ew.InputField(name='screenshot', field_type='file',
                           label='New Screenshot'),
-            ew.InputField(name='caption', field_type="text", label='Caption')
+            ew.InputField(name='caption',
+                          field_type="text",
+                          label='Caption',
+                          attrs={
+                              'title': "Reuse your project name in screenshot file names
and create a caption to briefly describe each screenshot.",
+                              'class': 'tooltip',
+                          }
+                          )
         ]
         return fields
 
@@ -168,18 +175,26 @@ class MetadataAdmin(ff.AdminForm):
                              validator=formencode.All(
                                  fev.UnicodeString(not_empty=True, max=40),
                                  V.MaxBytesValidator(max=40)),
-                             attrs=dict(maxlength=40,
-                                        title="This is the publicly viewable name of the
project, and will appear on project listings. It should be what you want to see as the project
title in search listing."))
+                             attrs={'maxlength': 40,
+                                    'title': "This is the publicly viewable name of the project,
and will appear on project listings. It should be what you want to see as the project title
in search listing.",
+                                    'class': 'tooltip',
+                                    })
         summary = ew.InputField(field_type="text", label='Short Summary',
                                 validator=formencode.All(
                                     fev.UnicodeString(max=70),
                                     V.MaxBytesValidator(max=70)),
-                                attrs=dict(maxlength=70))
+                                attrs={'maxlength': 70,
+                                       'title': 'Briefly state what your project is and what
it does without repeating the project name. This summary appears in Google search results
beneath the project name.',
+                                       'class': 'tooltip',
+                                       })
         short_description = ew.TextArea(label='Full Description',
                                         validator=formencode.All(
                                             fev.UnicodeString(max=1000),
                                             V.MaxBytesValidator(max=1000)),
-                                        attrs=dict(title="Add a few paragraphs describing
your project to new users."))
+                                        attrs={
+                                            'title': 'Describe the full functionality of
your project using related keywords. The first sentence has the most impact on search. Provide
unique content that calls out keywords and describes the merits of your project.',
+                                            'class': 'tooltip'
+                                        })
         icon = ew.FileField(label='Icon')
         external_homepage = ew.InputField(field_type="text", label='Homepage',
                                           validator=fev.URL(add_http=True))

http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index 714a32b..f523208 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -947,6 +947,10 @@ class NeighborhoodAddProjectForm(ForgeForm):
                           ),
             ew.InputField(name='project_unixname',
                           label='Short Name', field_type='text',
+                          attrs={
+                              'title': 'Create a URL name that matches your project name
as closely as possible to improve search indexing and maximize visibility.',
+                              'class': 'tooltip'
+                          },
                           validator=provider.shortname_validator),
             ew.CheckboxSet(name='tools', options=tools_options),
         ])

http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/nf/allura/css/allura.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/allura.css b/Allura/allura/nf/allura/css/allura.css
index 18dbd62..17ee342 100644
--- a/Allura/allura/nf/allura/css/allura.css
+++ b/Allura/allura/nf/allura/css/allura.css
@@ -86,4 +86,4 @@ tr.rev div.markdown_content p {
 
 #phone_verification_overlay iframe {
     height: 320px;
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/public/nf/css/forge/tooltipster.css
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/css/forge/tooltipster.css b/Allura/allura/public/nf/css/forge/tooltipster.css
index db56bc3..0c9dd4a 100755
--- a/Allura/allura/public/nf/css/forge/tooltipster.css
+++ b/Allura/allura/public/nf/css/forge/tooltipster.css
@@ -21,25 +21,32 @@
 }
 
 /* If you're using the icon option, use this next selector to style them */
+
+.tooltipster-div {
+    position: relative;
+    height: 100%;
+}
+
 .tooltipster-icon {
     cursor: help;
     background: #00AFFE;
-    font-size: medium;
-    font-weight: 600;
+    font-size: small;
+    font-weight: bold;
+    height: 1.3em;
     color: white;
-    border: 1px solid #067DB8;
-    border-radius: 15%;
+    border: 0.1em solid #067DB8;
+    border-radius: 18.5%;
     position: absolute;
-    padding: 0 4px;
-    left: 41.3%;
-    margin-top: -27.5px;
-    margin-bottom: 141px;
+    display: inline-block;
+    margin-top: 0.3em;
+    top: 2.7%;
+    right: 2%;
+    z-index: 9999999;
+    padding: 0 0.3em;
 }
 
-/* If you're using the icon option, use this next selector to style them */
 .tooltipster-icon:hover {
     background: #067DB8;
-    border: 1px solid #00AFFE;
 }
 
 /* This is the base styling required to make all Tooltipsters work */
@@ -313,4 +320,4 @@
     font-style: italic;
     line-height: 16px;
     padding: 8px 10px;
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/templates/jinja_master/master.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/master.html b/Allura/allura/templates/jinja_master/master.html
index cc6b548..74b09bc 100644
--- a/Allura/allura/templates/jinja_master/master.html
+++ b/Allura/allura/templates/jinja_master/master.html
@@ -20,15 +20,17 @@
 <!-- Server: {{g.server_name}} -->
 {% import 'allura:templates/jinja_master/lib.html' as lib with context %}
 {% if g.theme.jinja_macros %}
-  {% import g.theme.jinja_macros as theme_macros with context %}
+    {% import g.theme.jinja_macros as theme_macros with context %}
 {% endif %}
 {% do g.register_forge_js('js/jquery-base.js', location='head_js') %}
 {% do g.register_forge_js('js/jquery.notify.js') %}
+{% do g.register_forge_js('js/jquery.tooltipster.js') %}
 {% do g.register_forge_js('js/modernizr.js') %}
 {% do g.register_forge_js('js/sylvester.js') %}
 {% do g.register_forge_js('js/pb.transformie.min.js') %}
 {% do g.register_forge_js('js/allura-base.js') %}
 {% do g.register_forge_css('css/forge/hilite.css') %}
+{% do g.register_forge_css('css/forge/tooltipster.css') %}
 {% do g.register_css('/nf/tool_icon_css?' + g.build_key, compress=False) %}
 {% do g.theme.require() %}
 {% do g.resource_manager.register_widgets(c) %}
@@ -37,130 +39,147 @@
 <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
 <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
 <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
-<!--[if (gt IE 9)|!(IE)]>--> <html lang="en" class="no-js"> <!--<![endif]-->
-  <head>
+<!--[if (gt IE 9)|!(IE)]>-->
+<html lang="en" class="no-js"> <!--<![endif]-->
+<head>
     <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
     <title>{% block title %}Your title goes here{% endblock %}</title>
-    {{theme_macros.extra_header(g.theme_href(''))}}
+    {{ theme_macros.extra_header(g.theme_href('')) }}
     <script type="text/javascript">
-            /*jslint onevar: false, nomen: false, evil: true, css: true, plusplus: false,
white: false, forin: true, on: true, immed: false */
-            /*global confirm, alert, unescape, window, jQuery, $, net, COMSCORE */
+        /*jslint onevar: false, nomen: false, evil: true, css: true, plusplus: false, white:
false, forin: true, on: true, immed: false */
+        /*global confirm, alert, unescape, window, jQuery, $, net, COMSCORE */
     </script>
     {% for blob in g.resource_manager.emit('head_css') %}
-      {{ blob }}
+        {{ blob }}
     {% endfor %}
     {% for blob in g.resource_manager.emit('head_js') %}
-      {{ blob }}
+        {{ blob }}
     {% endfor %}
 
     {% if c.project and c.project.neighborhood.css %}
-      <style type="text/css">
-        {{c.project.neighborhood.get_custom_css()|safe}}
-      </style>
+        <style type="text/css">
+            {{c.project.neighborhood.get_custom_css()|safe}}
+        </style>
     {% elif neighborhood and neighborhood.css %}
-      <style type="text/css">
-        {{neighborhood.get_custom_css()}}
-      </style>
+        <style type="text/css">
+            {{neighborhood.get_custom_css()}}
+        </style>
     {% endif %}
     {% block extra_css %}{% endblock %}
-      <style>.{{ g.antispam.honey_class }} { display:none }</style>
+    <style>.{{ g.antispam.honey_class }} {
+        display: none
+    }</style>
 
     {% block head %}
     {% endblock %}
-    {% if g.production_mode %}{{g.analytics.display()}}{% endif %}
-  </head>
+    {% if g.production_mode %}{{ g.analytics.display() }}{% endif %}
+</head>
 
-  <body{% block body_attrs %}{% endblock %} id="forge">
-    <h2 class="hidden">
-        <span style="color:red">Error:</span> CSS did not load.<br>
-        This may happen on the first request due to CSS mimetype issues.
-        Try clearing your browser cache and refreshing.
-        <hr>
-    </h2>
-    {% block body_top_js %}
+<body{% block body_attrs %}{% endblock %} id="forge">
+<h2 class="hidden">
+    <span style="color:red">Error:</span> CSS did not load.<br>
+    This may happen on the first request due to CSS mimetype issues.
+    Try clearing your browser cache and refreshing.
+    <hr>
+</h2>
+{% block body_top_js %}
     {% for blob in g.resource_manager.emit('body_top_js') %}
-      {{ blob }}
+        {{ blob }}
     {% endfor %}
-    {% endblock %}
-    {{theme_macros.header(g.login_url, '/auth/logout')}}
-    {{theme_macros.site_notification()}}
-    {% set flash = tg.flash_obj.render('flash', use_js=False) %}
-    <section id="page-body" class="{{g.document_class(neighborhood)}}">
-	  <div id="nav_menu_holder">
-            {% block nav_menu %}
+{% endblock %}
+{{ theme_macros.header(g.login_url, '/auth/logout') }}
+{{ theme_macros.site_notification() }}
+{% set flash = tg.flash_obj.render('flash', use_js=False) %}
+<section id="page-body" class="{{ g.document_class(neighborhood) }}">
+    <div id="nav_menu_holder">
+        {% block nav_menu %}
             {% include g.theme.nav_menu %}
-            {% endblock %}
-      </div>
-      <div id="top_nav" class="">
+        {% endblock %}
+    </div>
+    <div id="top_nav" class="">
         {% block top_nav %}
-        {% include g.theme.top_nav %}
+            {% include g.theme.top_nav %}
         {% endblock %}
-      </div>
-      <div id="content_base">
-      {% block content_base %}
-			  {% if not hide_left_bar %}
-			    {% block sidebar_menu %}
-          {% include g.theme.sidebar_menu %}
-          {% endblock %}
-          {% set outer_width = 20 %}
-			  {% else %}
-          {% set outer_width = 24 %}
-        {% endif %}
-			  {% if show_right_bar %}
-          {% set inner_width = outer_width - 8 %}
-			  {% else %}
-          {% set inner_width = outer_width %}
-        {% endif %}
-        <div class="grid-{{outer_width}} pad">
-          <h2 class="dark{% block header_classes %} title{% endblock %}">{% block header
%}{% endblock %}
-            <!-- actions -->
-            <small>
-            {% block actions %}{% endblock %}
-            </small>
-            <!-- /actions -->
-          </h2>
-		{% block edit_box %}{% endblock %}
-          <div{% if show_right_bar %} class="{% block inner_grid %}grid-{{inner_width}}"{%
endblock %}{% endif %}>
-            {% block before_content %}{% endblock %}
-            {% block content %}{% endblock %}
-          </div>
-			{% if show_right_bar %}
-          <div id="sidebar-right" class="grid-6 fright">
-            {% block right_content %}{% endblock %}
-          </div>
-          {% endif %}
-          {% block after_content %}{% endblock %}
-        </div>
-      {% endblock %}
-      </div>
-    </section>
-    {{theme_macros.footer(g.year(), g.theme_href(''))}}
-    <div id="messages">
-        {% for n in h.pop_user_notifications() %}
-          <section class="message {{ n.subject or 'info' }}">
+    </div>
+    <div id="content_base">
+        {% block content_base %}
+            {% if not hide_left_bar %}
+                {% block sidebar_menu %}
+                    {% include g.theme.sidebar_menu %}
+                {% endblock %}
+                {% set outer_width = 20 %}
+            {% else %}
+                {% set outer_width = 24 %}
+            {% endif %}
+            {% if show_right_bar %}
+                {% set inner_width = outer_width - 8 %}
+            {% else %}
+                {% set inner_width = outer_width %}
+            {% endif %}
+            <div class="grid-{{ outer_width }} pad">
+                <h2 class="dark{% block header_classes %} title{% endblock %}">{% block
header %}{% endblock %}
+                    <!-- actions -->
+                    <small>
+                        {% block actions %}{% endblock %}
+                    </small>
+                    <!-- /actions -->
+                </h2>
+                {% block edit_box %}{% endblock %}
+                <div{% if show_right_bar %}
+                    class="{% block inner_grid %}grid-{{ inner_width }}"{% endblock %}{%
endif %}>
+                    {% block before_content %}{% endblock %}
+                    {% block content %}{% endblock %}
+                </div>
+                {% if show_right_bar %}
+                    <div id="sidebar-right" class="grid-6 fright">
+                        {% block right_content %}{% endblock %}
+                    </div>
+                {% endif %}
+                {% block after_content %}{% endblock %}
+            </div>
+        {% endblock %}
+    </div>
+</section>
+{{ theme_macros.footer(g.year(), g.theme_href('')) }}
+<div id="messages">
+    {% for n in h.pop_user_notifications() %}
+        <section class="message {{ n.subject or 'info' }}">
             <header>Notification:</header>
             <div class="content">{{ n.text }}</div>
-          </section>
-        {% endfor %}
-    </div>
-    {% if c.show_login_overlay %}
-        {{theme_macros.login_overlay()}}
-    {% endif %}
-    {% for blob in g.resource_manager.emit('body_js') %}
-      {{ blob }}
-    {% endfor %}
-    {% for blob in g.resource_manager.emit('body_js_tail') %}
-      {{ blob }}
+        </section>
     {% endfor %}
-    {% block extra_js %}{% endblock %}
-    {% if neighborhood %}
-      {{ neighborhood.site_specific_html | safe }}
-    {% elif c.project.neighborhood %}
-      {{ c.project.neighborhood.site_specific_html | safe }}
-    {% endif %}
-    {{theme_macros.custom_js()}}
-    {% if flash %}
-    <script type="text/javascript">{{flash | safe}}</script>
-    {% endif %}
-  </body>
+</div>
+{% if c.show_login_overlay %}
+    {{ theme_macros.login_overlay() }}
+{% endif %}
+{% for blob in g.resource_manager.emit('body_js') %}
+    {{ blob }}
+{% endfor %}
+{% for blob in g.resource_manager.emit('body_js_tail') %}
+    {{ blob }}
+{% endfor %}
+{% block extra_js %}{% endblock %}
+{% if neighborhood %}
+    {{ neighborhood.site_specific_html | safe }}
+{% elif c.project.neighborhood %}
+    {{ c.project.neighborhood.site_specific_html | safe }}
+{% endif %}
+{{ theme_macros.custom_js() }}
+{% if flash %}
+    <script type="text/javascript">{{ flash | safe }}</script>
+{% endif %}
+<script>
+    $(document).ready(function () {
+        $(".tooltip").tooltipster({
+            animation: 'fade',
+            delay: 200,
+            theme: 'tooltipster-light',
+            trigger: 'hover',
+            position: 'right',
+            iconCloning: false,
+            maxWidth: 300
+        });
+    })
+</script>
+</body>
 </html>


Mime
View raw message