Milimetric has submitted this change and it was merged.

Change subject: Adding support page
......................................................................


Adding support page

  Moved the FAQ part from the about.html to a new support.html template.
  Added support controller.
  Added 3 different ways to get support (from mingle card 824)
  Added docs on support_index controller
  Fixed flake8 errors

Change-Id: Ifc6e87854fd1529e110b1a3d3aea4dc445db0685
---
A tests/test_controllers/test_support.py
M wikimetrics/controllers/__init__.py
A wikimetrics/controllers/support.py
M wikimetrics/templates/about.html
M wikimetrics/templates/layout.html
A wikimetrics/templates/support.html
6 files changed, 50 insertions(+), 1 deletion(-)

Approvals:
  Milimetric: Verified; Looks good to me, approved



diff --git a/tests/test_controllers/test_support.py 
b/tests/test_controllers/test_support.py
new file mode 100644
index 0000000..026fcec
--- /dev/null
+++ b/tests/test_controllers/test_support.py
@@ -0,0 +1,14 @@
+from nose.tools import assert_equal, assert_true
+from tests.fixtures import WebTest
+
+
+class TestSupportController(WebTest):
+    
+    def test_index(self):
+        response = self.app.get('/', follow_redirects=True)
+        assert_equal(
+            response._status_code, 200,
+            '/ should get the support page'
+        )
+
+        assert_true(response.data.find('Mailing list') >= 0)
diff --git a/wikimetrics/controllers/__init__.py 
b/wikimetrics/controllers/__init__.py
index 9bdaf0c..c77090d 100644
--- a/wikimetrics/controllers/__init__.py
+++ b/wikimetrics/controllers/__init__.py
@@ -12,6 +12,7 @@
 from authentication import *
 from metrics import *
 from cohorts import *
+from support import *
 from reports import *
 from demo import *
 
diff --git a/wikimetrics/controllers/support.py 
b/wikimetrics/controllers/support.py
new file mode 100644
index 0000000..51fab83
--- /dev/null
+++ b/wikimetrics/controllers/support.py
@@ -0,0 +1,14 @@
+import json
+import csv
+from flask import url_for, flash, render_template, redirect, request
+from ..configurables import app, db
+from authentication import is_public
+
+
[email protected]('/support/')
+@is_public
+def support_index():
+    """
+    Renders a page with the details on how to get support for the Wikimetrics 
project.
+    """
+    return render_template('support.html')
diff --git a/wikimetrics/templates/about.html b/wikimetrics/templates/about.html
index b82f2e5..06736f8 100644
--- a/wikimetrics/templates/about.html
+++ b/wikimetrics/templates/about.html
@@ -17,6 +17,5 @@
             <p>A report is a way for you to ask for the results of a metric 
applied to a cohort.  The reports are run asynchronously on a Celery queue and 
the results show up when they're ready, on the <a 
href="{{url_for('reports_index')}}">reports page</a></p>
         </li>
     </ul>
-    <p>We are putting together an on-wiki FAQ, if you have any questions 
before that please email <a href="mailto:[email protected]";>the 
analytics team</a>.</p>
 </div>
 {% endblock %}
diff --git a/wikimetrics/templates/layout.html 
b/wikimetrics/templates/layout.html
index 35db5c8..ccbfb4f 100644
--- a/wikimetrics/templates/layout.html
+++ b/wikimetrics/templates/layout.html
@@ -23,6 +23,7 @@
                         <li><a href="{{ url_for('cohorts_index') 
}}">Cohorts</a></li>
                         <li><a href="{{ url_for('metrics_index') 
}}">Metrics</a></li>
                         <li><a href="{{ url_for('reports_index') 
}}">Reports</a></li>
+                        <li><a href="{{ url_for('support_index') 
}}">Support</a></li>
                         <!--<li><a href="#">About</a></li>-->
                         <!--<li><a href="#">Contact</a></li>-->
                         <li class="pull-right">
diff --git a/wikimetrics/templates/support.html 
b/wikimetrics/templates/support.html
new file mode 100644
index 0000000..40e555b
--- /dev/null
+++ b/wikimetrics/templates/support.html
@@ -0,0 +1,20 @@
+{% extends "layout.html" %}
+{% block body %}
+<div class="hero-unit">
+  <h2>Support</h2>
+  <ul>
+    <li>
+      <strong>FAQ</strong>
+      <p>Visit the <a 
href="http://www.mediawiki.org/wiki/Wikimetrics/FAQ";>Frequently Asked Question 
page</a> </p>
+    </li>
+    <li>
+      <strong>Mailing list</strong>
+      <p>Subscribe to the <a 
href="https://lists.wikimedia.org/mailman/listinfo/wikimetrics";>Analytics 
mailing list</a> </p>
+    </li>
+    <li>
+      <strong>Submit a Bug Report</strong>
+      <p>If you discover a bug, please file a <a 
href="https://bugzilla.wikimedia.org/enter_bug.cgi?product=Analytics";>bug 
report in bugzilla.</a></p>
+    </li>
+  </ul>
+</div>
+{% endblock %}

-- 
To view, visit https://gerrit.wikimedia.org/r/79457
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifc6e87854fd1529e110b1a3d3aea4dc445db0685
Gerrit-PatchSet: 4
Gerrit-Project: analytics/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: Stefan.petrea <[email protected]>
Gerrit-Reviewer: Diederik <[email protected]>
Gerrit-Reviewer: Milimetric <[email protected]>
Gerrit-Reviewer: Stefan.petrea <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to