allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [10/12] allura git commit: [#3593] add tour to Admin Welcome page
Date Tue, 12 Jul 2016 14:04:35 GMT
[#3593] add tour to Admin Welcome page


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

Branch: refs/heads/db/3593
Commit: 3ac1102067a70fdb7355bb3f97423672792d3397
Parents: a76915d
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Jul 6 18:40:31 2016 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Tue Jul 12 10:02:57 2016 -0400

----------------------------------------------------------------------
 Allura/allura/config/app_cfg.py                 |   1 -
 Allura/allura/ext/admin/admin_main.py           |  11 +-
 .../ext/admin/templates/project_admin.html      | 184 ++++++++++---------
 Allura/allura/lib/helpers.py                    |  10 -
 Allura/allura/nf/allura/css/site_style.css      |  13 ++
 5 files changed, 112 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/3ac11020/Allura/allura/config/app_cfg.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/app_cfg.py b/Allura/allura/config/app_cfg.py
index b21979b..f340a63 100644
--- a/Allura/allura/config/app_cfg.py
+++ b/Allura/allura/config/app_cfg.py
@@ -104,7 +104,6 @@ class ForgeConfig(AppConfig):
         jinja2_env.filters['filesizeformat'] = helpers.do_filesizeformat
         jinja2_env.filters['datetimeformat'] = helpers.datetimeformat
         jinja2_env.filters['filter'] = lambda s,t=None: filter(t and jinja2_env.tests[t],
s)
-        jinja2_env.filters['map'] = helpers.map_jinja_filter
         jinja2_env.filters['nl2br'] = helpers.nl2br_jinja_filter
         jinja2_env.globals.update({'hasattr': hasattr})
         config['pylons.app_globals'].jinja2_env = jinja2_env

http://git-wip-us.apache.org/repos/asf/allura/blob/3ac11020/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index e751dc8..a9c5daf 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -141,7 +141,7 @@ class AdminApp(Application):
         else:
             links += [
                 SitemapEntry('Welcome', admin_url),
-                SitemapEntry('Metadata', admin_url + 'overview'),
+                SitemapEntry('Metadata', admin_url + 'overview', className="admin-nav-metadata"),
             ]
             if c.project.neighborhood.name != "Users":
                 links += [
@@ -153,7 +153,7 @@ class AdminApp(Application):
             links.append(SitemapEntry('Export', admin_url + 'export'))
         if c.project.is_root and has_access(c.project, 'admin')():
             links.append(
-                SitemapEntry('User Permissions', admin_url + 'groups/'))
+                SitemapEntry('User Permissions', admin_url + 'groups/', className="admin-nav-user-perms"))
         if not c.project.is_root and has_access(c.project, 'admin')():
             links.append(
                 SitemapEntry('Permissions', admin_url + 'permissions/'))
@@ -206,12 +206,7 @@ class ProjectAdminController(BaseController):
     @with_trailing_slash
     @expose('jinja:allura.ext.admin:templates/project_admin.html')
     def index(self, **kw):
-        scm_tools = []
-        for tool in c.project.app_configs:
-            app = g.entry_points["tool"].get(tool.tool_name)
-            if app and issubclass(app, RepositoryApp):
-                scm_tools.append(tool)
-        return dict(scm_tools=scm_tools)
+        return dict()
 
     @without_trailing_slash
     @expose('jinja:allura.ext.admin:templates/project_invitations.html')

http://git-wip-us.apache.org/repos/asf/allura/blob/3ac11020/Allura/allura/ext/admin/templates/project_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_admin.html b/Allura/allura/ext/admin/templates/project_admin.html
index 6920236..2d42a68 100644
--- a/Allura/allura/ext/admin/templates/project_admin.html
+++ b/Allura/allura/ext/admin/templates/project_admin.html
@@ -17,105 +17,113 @@
        under the License.
 -#}
 {% extends g.theme.master %}
-{% set wiki_found = False %}
-{% set tracker_found = False %}
-{% set forum_found = False %}
 
-{% block title %}{{c.project.name}} / Admin{% endblock %}
+{% do g.register_forge_js('js/hopscotch.min.js') %} {# location='body_js_tail' #}
+{% do g.register_forge_css('css/hopscotch.min.css') %} {# location='body_js_tail' #}
 
-{% block header %}Project Admin{% endblock %}
+{% block title %}{{c.project.name}} / Admin Welcome{% endblock %}
 
-{% block content %}
-  <p>{{config.site_name}} projects come with a number of Tools, which can be configured
and adjusted to your needs.</p>
+{% block header %}Welcome to your {{config.site_name}} project!{% endblock %}
 
-  <div class="grid-1">
-    &nbsp;
-  </div>
-  <div class="grid-13">
-    <h3>Project Setup</h3>
-    <p>The first thing to do to setup your project is to create a solid description,
so folks coming to your page can figure out what the project is all about. You'll then want
to input information about the project, and we'll make sure all this relevant information
gets added to the {{config.site_name}} project directory.</p>
-  </div>
-  <div class="grid-4">
-    <a href="overview">Update MetaData</a>
-  </div>
-  <div style="clear:both"></div>
+{% set tour = {
+    "id": "admin-welcome",
+    "showPrevButton": false,
+    "steps": [
+        {
+            "title": "Describe your project",
+            "content": "Enter your project description, then upload screenshots if you've
got them, and categorize your project.  This helps people know what your project is all about.",
+            "target": ".admin-nav-metadata",
+            "placement": "right",
+            "yOffset": -17,
+        },
+        {
+            "title": "Add tools",
+            "content": "Add more code repositories, ticket trackers, wikis, links, whatever
your project needs!",
+            "target": 'add-tool-container',
+            "__comment": "if many tools are installed, this target could be on the second
row, but should be rare, particularly with brand new projects",
+            "placement": "bottom",
+            "xOffset": -180,
+            "arrowOffset": 200,
+        },
+        {
+            "title": "Customize",
+            "content": "Rename and change settings for your tools.  Remove any you don't
need.",
+            "target": "toggle-admin-btn",
+            "placement": "top",
+            "xOffset": -275,
+            "arrowOffset": 270,
+        },
+        {
+            "title": "Add users",
+            "content": "Add other developers to your project.",
+            "target": ".admin-nav-user-perms",
+            "placement": "right",
+            "yOffset": -17,
+        },
+        {
+            "title": "Start coding",
+            "content": "Commit your code to your repo.  Or, if you have code somewhere else,
<a href='ext/import/'>import it</a> or add link to it (add an 'External Link'
tool).",
+            "target": ".tool-git-32,.tool-hg-32,.tool-svn-32",
+            "placement": "bottom",
+            "xOffset": -17,
+        },
+    ]
+} %}
 
-  <div class="grid-1">
-    &nbsp;
-  </div>
-  <div class="grid-13">
-    <h3>Wikis</h3>
-    <p>You can create documentation, post proposed feature descriptions, and discuss
these shared documents.</p>
-  </div>
-  <div class="grid-4">
-    {% for tool in c.project.app_configs %}
-      {% if tool.tool_name.lower() == 'wiki' and not wiki_found %}
-        <a href="{{c.project.url()}}{{tool.options.mount_point}}/add">Add Page</a><br>
-        <a href="{{c.project.url()}}{{tool.options.mount_point}}/">View Wiki</a>
-        {% set wiki_found = True %}
-      {% endif %}
-    {% endfor %}
-  </div>
-  <div style="clear:both"></div>
-  {% if scm_tools %}
-    {% set tool = scm_tools[0] %}
-      <div class="grid-1">
-        &nbsp;
-      </div>
-    <div class="grid-13">
-      <h3>Code</h3>
-      <p>Source Control Management will help you keep track of code changes over time.
A repository has already been created, checkout, add files and upload code.</p>
-    </div>
-    <div class="grid-4">
-      <a href="{{c.project.url()}}{{tool.options.mount_point}}/fork">Checkout repo</a><br>
-      <a href="{{c.project.url()}}{{tool.options.mount_point}}/">View source</a>
-    </div>
-  {% endif %}
-  <div style="clear:both"></div>
 
-  <div class="grid-1">
-    &nbsp;
-  </div>
-  <div class="grid-13">
-  <h3>Tickets</h3>
-    <p>With the {{config.site_name}} tracker you can keep track of items of work that
need to be done. You can create one or more trackers for bugs, enhancements, tasks, that will
help you plan and manage your development process.</p>
-  </div>
-  <div class="grid-4">
-    {% for tool in c.project.app_configs %}
-      {% if tool.tool_name.lower() == 'tickets' and not tracker_found %}
-        <a href="{{c.project.url()}}{{tool.options.mount_point}}/new">Create Ticket</a><br>
-        <a href="{{c.project.url()}}{{tool.options.mount_point}}/milestones">Edit Milestones</a><br>
-        <a href="{{c.project.url()}}{{tool.options.mount_point}}/">View Tickets</a>
-        {% set tracker_found = True %}
-      {% endif %}
-    {% endfor %}
-  </div>
-  <div style="clear:both"></div>
+{% block content %}
+    <p>This is the Admin area of your project, where you can set your project details,
permissions, options and more.
+        Your project has many tools available in the top menu, each with its own customization
and settings.</p>
+    <p>Here's a quick tour of a few important things to get started:</p>
 
-  <div class="grid-1">
-    &nbsp;
-  </div>
-  <div class="grid-13">
-    <h3>Forums</h3>
-    <p>To use the forums, create a couple of forums, post introductory messages, and
check out the spam controll/post moderation options.</p>
-  </div>
-  <div class="grid-4">
-    {% for tool in c.project.app_configs %}
-      {% if tool.tool_name == 'Discussion' and not forum_found %}
-          <a href="{{c.project.url()}}{{tool.options.mount_point}}/?new_forum=True">Create
Forum</a><br>
-          <a href="{{c.project.url()}}{{tool.options.mount_point}}/">View Forums</a>
-        {% set forum_found = True %}
-      {% endif %}
+    {% for step in tour.steps %}
+    <div class="tour-step-info">
+        <h2>{{ step.title }}</h2>
+        <p>{{ step.content|safe }}
+        </p>
+        <div class="hopscotch-bubble not-really-hopscotch-bubble">
+            <button class="tour-show hopscotch-nav-button next" data-tour-id="{{ loop.index0
}}">Show Me</button>
+        </div>
+    </div>
     {% endfor %}
-  </div>
 {% endblock %}
 
 {% block extra_css %}
-<style>
-    .grid-20.pad .grid-1,
-    .grid-20.pad .grid-13,
-    .grid-20.pad .grid-4 {
-        margin-top: 2em;
+<style type="text/css">
+    div.hopscotch-bubble.not-really-hopscotch-bubble {
+        border: none;
+        position: initial;
+    }
+    .tour-step-info {
+        margin-bottom: 20px;
+    }
+    .tour-step-info h2 {
+        padding-bottom: 0;
+    }
+    .tour-step-info p {
+        padding-bottom: 8px;
+    }
+    .tour-step-info button {
+        float: none;
     }
 </style>
+{% endblock %}
+
+{% block extra_js %}
+<script>
+$(function() {
+    var tour = {{ h.escape_json(tour)|safe }};
+    tour.onError = function() {
+        var step = hopscotch.getCurrStepNum();
+        console.warn('Error on tour step #', step, tour.steps[step]);
+    };
+    $('.tour-show').click(function(){
+        var step = $(this).data('tour-id');
+        hopscotch.startTour(tour, step);
+    });
+    {% if 'first-visit' in request.params %}
+        hopscotch.startTour(tour);
+    {% endif %}
+});
+</script>
 {% endblock %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/3ac11020/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index c85e1e1..6e10208 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -1225,16 +1225,6 @@ def get_filter(ctx, filter_name):
         return partial(filter_, ctx.environment)
 
 
-@contextfilter
-def map_jinja_filter(ctx, seq, filter_name, *a, **kw):
-    """
-    A Jinja2 filter that applies the named filter with the
-    given args to the sequence this filter is applied to.
-    """
-    filter_ = get_filter(ctx, filter_name)
-    return [filter_(value, *a, **kw) for value in seq]
-
-
 def unidiff(old, new):
     """Returns unified diff between `one` and `two`."""
     return '\n'.join(difflib.unified_diff(

http://git-wip-us.apache.org/repos/asf/allura/blob/3ac11020/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 8cb3805..006db0f 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -948,6 +948,9 @@ thead th{
   height: auto;
   float: left;
 }
+.hopscotch-bubble button {
+  float: initial;
+}
 
 button, input[type="submit"], input[type="reset"], input[type="button"] {
   padding-bottom: 4px;
@@ -1077,6 +1080,12 @@ a.btn:active {
   background-image: -moz-linear-gradient(top, #ffffff 0%, #eeeeee 100%);
   background-image: linear-gradient(top, #ffffff 0%, #eeeeee 100%);
 }
+.hopscotch-bubble button:hover {
+  border-color: transparent !important;
+}
+.hopscotch-bubble button.hopscotch-bubble-close:hover {
+  border-width: 0 !important;
+}
 
 button[disabled]:hover, input[type=submit][disabled]:hover, input[type=reset][disabled]:hover,
input[type=button][disabled]:hover {
   cursor: auto;
@@ -1095,6 +1104,10 @@ li.active, .btn.active, .btn:active:hover, button:active:hover, .btn-set
.btn.ic
   -o-box-shadow: rgba(0, 0, 0, 0.1) 0 -2px 5px inset,rgba(0, 0, 0, 0.2) 0 1px 3px inset;
   box-shadow: rgba(0, 0, 0, 0.1) 0 -2px 5px inset,rgba(0, 0, 0, 0.2) 0 1px 3px inset;
 }
+.hopscotch-bubble button:active:hover {
+  box-shadow: none;
+  background: transparent url(../../../allura/images/sprite-green.png) -192px -92px no-repeat;
// reset to hopscotch.min.css value
+}
 
 button[disabled]:active:hover, input[type=submit][disabled]:active:hover, input[type=reset][disabled]:active:hover,
input[type=button][disabled]:active:hover {
   text-shadow: #fff 0 1px;


Mime
View raw message