incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wwitz...@apache.org
Subject [2/3] git commit: [#5195] Add Facebook field to metadata admin
Date Wed, 06 Feb 2013 15:39:34 GMT
[#5195] Add Facebook field to metadata admin


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

Branch: refs/heads/master
Commit: d6eb25a1a526dc9894b2f3ade2c28f6c49ec2217
Parents: ab5af7e
Author: Patrick Lenz <plenz@geek.net>
Authored: Fri Feb 1 10:51:26 2013 +0000
Committer: Wayne Witzel III <wwitzel@geek.net>
Committed: Wed Feb 6 03:15:46 2013 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py              |    5 +++++
 .../templates/admin_widgets/metadata_admin.html    |    3 +++
 Allura/allura/ext/admin/widgets.py                 |    1 +
 Allura/allura/model/project.py                     |    4 ++++
 4 files changed, 13 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d6eb25a1/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 c0ce5ed..5350c96 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -274,6 +274,7 @@ class ProjectAdminController(BaseController):
                support_page='',
                support_page_url='',
                twitter_handle='',
+               facebook_page='',
                removal='',
                moved_to_url='',
                export_controlled=False,
@@ -334,6 +335,10 @@ class ProjectAdminController(BaseController):
             h.log_action(log, 'change project twitter handle').info('')
             M.AuditLog.log('change project twitter handle to %s', twitter_handle)
             c.project.set_social_account('Twitter', twitter_handle)
+        if facebook_page != c.project.social_account('Facebook'):
+            h.log_action(log, 'change project facebook page').info('')
+            M.AuditLog.log('change project facebook page to %s', facebook_page)
+            c.project.set_social_account('Facebook', facebook_page)
         if support_page_url != c.project.support_page_url:
             h.log_action(log, 'change project support page url').info('')
             M.AuditLog.log('change project support page url to %s', support_page_url)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d6eb25a1/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index 5e5db7a..c663beb 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -41,6 +41,9 @@
     {{ widget.display_label(widget.fields.twitter_handle) }}
     <br>
     {{widget.display_field(widget.fields.twitter_handle) }}
+    {{ widget.display_label(widget.fields.facebook_page) }}
+    <br>
+    {{widget.display_field(widget.fields.facebook_page) }}
     {% if value.neighborhood.features['google_analytics'] %}
     {{ widget.display_label(widget.fields.tracking_id) }}
     <br>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d6eb25a1/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 2c5f5dd..9c8d886 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -163,6 +163,7 @@ class MetadataAdmin(ff.AdminForm):
         undelete = ew.InputField(field_type="hidden", label='Undelete')
         tracking_id = ew.InputField(field_type="text", label="Analytics Tracking ID")
         twitter_handle = ew.InputField(field_type="text", label='Twitter Handle')
+        facebook_page = ew.InputField(field_type="text", label='Facebook page')
 
 class AuditLog(ew_core.Widget):
     template='jinja:allura.ext.admin:templates/widgets/audit.html'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d6eb25a1/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index df6fdc9..230c337 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -757,6 +757,10 @@ class Project(MappedClass, ActivityNode, ActivityObject):
     def twitter_handle(self):
         return self.social_account('Twitter').accounturl
 
+    @property
+    def facebook_page(self):
+        return self.social_account('Facebook').accounturl
+
     def social_account(self, socialnetwork):
         try:
             account = (sn for sn in self.socialnetworks if sn.socialnetwork == socialnetwork).next()


Mime
View raw message