You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/07/01 18:35:55 UTC

[1/2] git commit: [#6211] ticket:364 Refactored forum/discussion widget templates

Updated Branches:
  refs/heads/master 9ef3a2df0 -> faf6a3950


[#6211] ticket:364 Refactored forum/discussion widget templates


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

Branch: refs/heads/master
Commit: 673a6b732fd9966c5781bb40e52e9ca58a649170
Parents: 9ef3a2d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 19 10:16:39 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Jul 1 16:35:39 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/discuss.py            |  2 ++
 Allura/allura/templates/discussion/index.html   | 21 +++++++++++++++-
 Allura/allura/templates/widgets/discussion.html | 19 ---------------
 .../forgediscussion/controllers/forum.py        |  9 +++++--
 .../discussion_widgets/discussion.html          | 20 ----------------
 .../forgediscussion/templates/index.html        | 25 ++++++++++++++++++++
 6 files changed, 54 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/673a6b73/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index fbfbaf0..4fa05c8 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -67,6 +67,7 @@ class WidgetConfig(object):
     thread = DW.Thread()
     post = DW.Post()
     thread_header = DW.ThreadHeader()
+    discussion_header = DW.DiscussionHeader()
 
 # Controllers
 class DiscussionController(BaseController, FeedController):
@@ -87,6 +88,7 @@ class DiscussionController(BaseController, FeedController):
     @expose('jinja:allura:templates/discussion/index.html')
     def index(self, threads=None, limit=None, page=0, count=0, **kw):
         c.discussion = self.W.discussion
+        c.discussion_header = self.W.discussion_header
         if threads is None:
             threads = self.discussion.threads
         return dict(discussion=self.discussion, limit=limit, page=page, count=count, threads=threads)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/673a6b73/Allura/allura/templates/discussion/index.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/discussion/index.html b/Allura/allura/templates/discussion/index.html
index 7443462..cedcc16 100644
--- a/Allura/allura/templates/discussion/index.html
+++ b/Allura/allura/templates/discussion/index.html
@@ -16,4 +16,23 @@
        specific language governing permissions and limitations
        under the License.
 -#}
-{{c.discussion.display(value=discussion, threads=threads, limit=limit, page=page, count=count)}}
\ No newline at end of file
+{% extends g.theme.master %}
+
+{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Discussion{% endblock %}
+
+{% block header %}{{h.really_unicode(discussion.name)}}{% endblock %}
+
+{% block actions %}
+  {% if discussion.email_address %}
+    <a href="{{h.really_unicode(discussion.email_link(subject=None))}}" class="email" title="Send Email to Create a New Topic" ><b data-icon="{{g.icons['pencil'].char}}" class="ico {{g.icons['pencil'].css}}"></b></a>
+    <a href="feed" title="Feed" ><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}"></b></a>
+  {% endif %}
+{% endblock %}
+
+{% block edit_box %}
+  <div class="editbox">{{c.discussion_header.display(value=discussion)}}</div>
+{% endblock %}
+
+{% block content %}
+  {{c.discussion.display(value=discussion, threads=threads, limit=limit, page=page, count=count)}}
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/673a6b73/Allura/allura/templates/widgets/discussion.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/discussion.html b/Allura/allura/templates/widgets/discussion.html
index 41ef5d7..82ee24c 100644
--- a/Allura/allura/templates/widgets/discussion.html
+++ b/Allura/allura/templates/widgets/discussion.html
@@ -16,24 +16,6 @@
        specific language governing permissions and limitations
        under the License.
 -#}
-{% extends g.theme.master %}
-
-{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Discussion{% endblock %}
-
-{% block header %}{{h.really_unicode(value.name)}}{% endblock %}
-
-{% block actions %}
-  {% if value.email_address %}
-    <a href="{{h.really_unicode(value.email_link(subject=None))}}" class="email" title="Send Email to Create a New Topic" ><b data-icon="{{g.icons['mail'].char}}" class="ico {{g.icons['mail'].css}}"></b></a>
-    <a href="feed" title="Feed" ><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}"></b></a>
-  {% endif %}
-{% endblock %}
-
-{% block edit_box %}
-  <div class="editbox">{{widgets.discussion_header.display(value=value)}}</div>
-{% endblock %}
-
-{% block content %}
 {{widgets.subscription_form.display(value=value,
                                     threads=threads,
                                     action=value.url() + 'subscribe',
@@ -42,4 +24,3 @@
                                     limit=limit,
                                     page=page,
                                     count=count)}}
-{% endblock %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/673a6b73/ForgeDiscussion/forgediscussion/controllers/forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/forum.py b/ForgeDiscussion/forgediscussion/controllers/forum.py
index a68a973..dab6dcd 100644
--- a/ForgeDiscussion/forgediscussion/controllers/forum.py
+++ b/ForgeDiscussion/forgediscussion/controllers/forum.py
@@ -66,6 +66,7 @@ class WidgetConfig(object):
     post = FW.Post()
     thread_header = FW.ThreadHeader()
     announcements_table = FW.AnnouncementsTable()
+    discussion_header = FW.ForumHeader()
 
 class ForumController(DiscussionController):
     M=ModelConfig
@@ -92,7 +93,7 @@ class ForumController(DiscussionController):
         else:
             raise exc.HTTPNotFound()
 
-    @expose('jinja:allura:templates/discussion/index.html')
+    @expose('jinja:forgediscussion:templates/index.html')
     @validate(dict(page=validators.Int(if_empty=0),
                    limit=validators.Int(if_empty=25)))
     def index(self, threads=None, limit=25, page=0, count=0, **kw):
@@ -102,7 +103,11 @@ class ForumController(DiscussionController):
         c.subscribed=M.Mailbox.subscribed(artifact=self.discussion)
         threads = DM.ForumThread.query.find(dict(discussion_id=self.discussion._id, num_replies={'$gt': 0})) \
                                       .sort([('flags', pymongo.DESCENDING), ('last_post_date', pymongo.DESCENDING)])
-        return super(ForumController, self).index(threads=threads.skip(start).limit(int(limit)).all(), limit=limit, page=page, count=threads.count(), **kw)
+        response =  super(ForumController, self).index(threads=threads.skip(start).limit(int(limit)).all(),
+                                                       limit=limit, page=page, count=threads.count(), **kw)
+        c.discussion_header = self.W.discussion_header
+        c.whole_forum_subscription_form = self.W.subscribe_form
+        return response
 
     @expose()
     def icon(self):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/673a6b73/ForgeDiscussion/forgediscussion/templates/discussion_widgets/discussion.html
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/templates/discussion_widgets/discussion.html b/ForgeDiscussion/forgediscussion/templates/discussion_widgets/discussion.html
index 6d7302d..82ee24c 100644
--- a/ForgeDiscussion/forgediscussion/templates/discussion_widgets/discussion.html
+++ b/ForgeDiscussion/forgediscussion/templates/discussion_widgets/discussion.html
@@ -16,25 +16,6 @@
        specific language governing permissions and limitations
        under the License.
 -#}
-{% extends g.theme.master %}
-
-{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Discussion{% endblock %}
-
-{% block header %}{{h.really_unicode(value.name)}}{% endblock %}
-
-{% block actions %}
-  {% if value.email_address %}
-    <a href="{{h.really_unicode(value.email_link(subject=None))}}" class="email" title="Send Email to Create a New Topic" ><b data-icon="{{g.icons['pencil'].char}}" class="ico {{g.icons['pencil'].css}}"></b></a>
-    <a href="feed" title="Feed" ><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}"></b></a>
-  {% endif %}
-  {{widgets.whole_forum_subscription_form.display(value=c.subscribed, action='subscribe_to_forum', style='icon', thing='discussion')}}
-{% endblock %}
-
-{% block edit_box %}
-  <div class="editbox">{{widgets.discussion_header.display(value=value)}}</div>
-{% endblock %}
-
-{% block content %}
 {{widgets.subscription_form.display(value=value,
                                     threads=threads,
                                     action=value.url() + 'subscribe',
@@ -43,4 +24,3 @@
                                     limit=limit,
                                     page=page,
                                     count=count)}}
-{% endblock %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/673a6b73/ForgeDiscussion/forgediscussion/templates/index.html
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/templates/index.html b/ForgeDiscussion/forgediscussion/templates/index.html
new file mode 100644
index 0000000..da2c3a9
--- /dev/null
+++ b/ForgeDiscussion/forgediscussion/templates/index.html
@@ -0,0 +1,25 @@
+{#-
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+-#}
+{% extends 'allura:templates/discussion/index.html' %}
+
+
+{% block actions %}
+  {{ super() }}
+  {{c.whole_forum_subscription_form.display(value=c.subscribed, action='subscribe_to_forum', style='icon', thing='discussion')}}
+{% endblock %}


[2/2] git commit: [#6211] remove commit widget template (was unused, and was a widget extending master template which is weird)

Posted by br...@apache.org.
[#6211] remove commit widget template (was unused, and was a widget extending master template which is weird)


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

Branch: refs/heads/master
Commit: faf6a3950a498fb6cabe19e65ad791698d12b140
Parents: 673a6b7
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Jul 1 16:01:14 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Jul 1 16:35:40 2013 +0000

----------------------------------------------------------------------
 .../allura/templates/widgets/repo/commit.html   | 65 --------------------
 1 file changed, 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/faf6a395/Allura/allura/templates/widgets/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/repo/commit.html b/Allura/allura/templates/widgets/repo/commit.html
deleted file mode 100644
index 0858365..0000000
--- a/Allura/allura/templates/widgets/repo/commit.html
+++ /dev/null
@@ -1,65 +0,0 @@
-{#-
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
--#}
-{% extends g.theme.master %}
-
-{% block title %}
-  {{c.project.name}} / {{c.app.config.options.mount_label}} / Commit {{commit.shorthand_id()}}
-{% endblock %}
-
-{% macro commit_link(commit) -%}
-<a href={{commit.url()}}>{{commit.shorthand_id}}</a>
-{%- endmacro %}
-
-{% block header %}Commit {{commit_link(commit)}}{% endblock %}
-
-{% block content %}
-{{c.revision_widget.display(value=commit, prev=prev, next=next)}}
-<table>
-  <tbody>
-    {% for diff in commit.diffs.added %}
-    <tr>
-      <td>add</td>
-      <td><a href="./tree/{{h.really_unicode(diff)}}">{{h.really_unicode(diff)}}</a></td>
-    </tr>
-    {% endfor %}{% for diff in commit.diffs.removed %}
-    <tr>
-      <td>remove</td>
-      <td><a href="{{prev[0].url()}}tree/{{h.really_unicode(diff)}}">{{h.really_unicode(diff)}}</a></td>
-    </tr>
-    {% endfor %}{% for diff in commit.diffs.changed %}
-    <tr>
-      <td>change</td>
-      <td>
-        <a href="./tree/{{h.really_unicode(diff)}}">{{h.really_unicode(diff)}}</a>
-        <a href="./tree/{{h.really_unicode(diff)}}?diff={{prev[0]._id}}">(diff)</a>
-      </td>
-    </tr>
-    {% endfor %}{% for diff in commit.diffs.copied %}
-    <tr>
-      <td>copy</td>
-      <td>
-        <a href="{{prev[0].url()}}tree/{{h.really_unicode(diff.old)}}">{{h.really_unicode(diff.old)}}</a>
-        <br/>to<br/>
-        <a href="./tree/{{h.really_unicode(diff)}}">{{h.really_unicode(diff)}}</a>
-      </td>
-    </tr>
-    {% endfor %}
-  </tbody>
-</table>
-{% endblock %}