incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: Made Incentify installable app with option to control display
Date Fri, 13 Sep 2013 17:12:39 GMT
Updated Branches:
  refs/heads/cj/donay-incentify 7b57d6fb3 -> 334bc3435


Made Incentify installable app with option to control display


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

Branch: refs/heads/cj/donay-incentify
Commit: 334bc343508f832a03fc2ce1c50d95451eff7635
Parents: 7b57d6f
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Fri Sep 13 17:12:14 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Fri Sep 13 17:12:14 2013 +0000

----------------------------------------------------------------------
 DonayIncentify/donayincentify/incentify.py       | 13 ++++++++++++-
 .../forgetracker/templates/tracker/ticket.html   | 19 ++++++++++++-------
 DonayIncentify/setup.py                          |  5 ++++-
 3 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/334bc343/DonayIncentify/donayincentify/incentify.py
----------------------------------------------------------------------
diff --git a/DonayIncentify/donayincentify/incentify.py b/DonayIncentify/donayincentify/incentify.py
index 6932f14..dbcfec7 100644
--- a/DonayIncentify/donayincentify/incentify.py
+++ b/DonayIncentify/donayincentify/incentify.py
@@ -15,7 +15,18 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-class Incentify(object):
+from allura.app import Application
+from allura.app import DefaultAdminController
+from allura.app import ConfigOption
+
+class IncentifyApp(Application):
+    tool_label = 'Incentify'
+    tool_description = 'Donay Incentify button for tickets'
+    default_mount_label = 'Incentify'
+    default_mount_point = 'incentify'
+    config_options = Application.config_options + [
+            ConfigOption('ShowIncentify', bool, True),
+        ]
     template_path_rules = [
             ['>', 'Tickets'],
         ]

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/334bc343/DonayIncentify/donayincentify/override/forgetracker/templates/tracker/ticket.html
----------------------------------------------------------------------
diff --git a/DonayIncentify/donayincentify/override/forgetracker/templates/tracker/ticket.html
b/DonayIncentify/donayincentify/override/forgetracker/templates/tracker/ticket.html
index 7b295e0..b474e2e 100644
--- a/DonayIncentify/donayincentify/override/forgetracker/templates/tracker/ticket.html
+++ b/DonayIncentify/donayincentify/override/forgetracker/templates/tracker/ticket.html
@@ -32,13 +32,6 @@
 {% block header %}#{{ticket.ticket_num}} {{ticket.summary}}{% if ticket.deleted %}<span>
(deleted)</span>{% endif %}{% endblock %}
 
 {% block actions %}
-<script type="text/javascript">
-    incentify_type = 'allura';
-    incentify_width = 728;
-    incentify_height = 90;
-    incentify_panel_type = 'html';
-</script>
-<script type="text/javascript" src="https://secure.donay.com/site/scripts/incentify.js"
async></script>
 <a href="{{ticket.url()}}feed.rss" title="Follow this Ticket"><b data-icon="{{g.icons['feed'].char}}"
class="ico {{g.icons['feed'].css}}"></b></a>
 {% if c.user and c.user != c.user.anonymous() %}
   {{c.subscribe_form.display(value=subscribed, tool_subscribed=tool_subscribed, action='subscribe',
style='icon')}}
@@ -148,6 +141,18 @@
 {% if voting_enabled %}
   {{ c.vote_form.display(artifact=ticket) }}
 {% endif %}
+{% set incentify = c.project.app_instance('incentify') %}
+{% if incentify and incentify.config.options.get('ShowIncentify', True) %}
+<div id="incentify-content">
+    <script type="text/javascript">
+        incentify_type = 'allura';
+        incentify_width = 728;
+        incentify_height = 90;
+        incentify_panel_type = 'html';
+    </script>
+    <script type="text/javascript" src="https://secure.donay.com/site/scripts/incentify.js"
async></script>
+</div>
+{% endif %}
 <div id="ticket_content">
   {{g.markdown.convert(ticket.description)|safe}}
   {% if ticket.attachments %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/334bc343/DonayIncentify/setup.py
----------------------------------------------------------------------
diff --git a/DonayIncentify/setup.py b/DonayIncentify/setup.py
index 8a69609..b0eb661 100644
--- a/DonayIncentify/setup.py
+++ b/DonayIncentify/setup.py
@@ -33,6 +33,9 @@ setup(name='DonayIncentify',
       install_requires=['Allura', 'ForgeTracker', ],
       entry_points="""
       # -*- Entry points: -*-
+      [allura]
+      donayincentify = donayincentify.incentify:IncentifyApp
+
       [allura.theme.override]
-      donayincentify = donayincentify.incentify:Incentify
+      donayincentify = donayincentify.incentify:IncentifyApp
       """,)


Mime
View raw message