You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2016/01/21 16:29:45 UTC
[06/10] allura git commit: [#8020] remove dead 'flag' code (long long
ago non-moderators could help flag things as spam). This is separate from the
moderator's flag as spam option, and from thread-level flags (e.g. sticky)
[#8020] remove dead 'flag' code (long long ago non-moderators could help flag things as spam). This is separate from the moderator's flag as spam option, and from thread-level flags (e.g. sticky)
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/3a94beae
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3a94beae
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3a94beae
Branch: refs/heads/ib/8020b
Commit: 3a94beae9c0b9df175d785a748c81287f9b1d11c
Parents: d316b2d
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Jan 6 13:28:58 2016 -0500
Committer: Denis Kotov <de...@gmail.com>
Committed: Wed Jan 20 16:03:45 2016 +0200
----------------------------------------------------------------------
Allura/allura/controllers/discuss.py | 12 ----------
Allura/allura/lib/widgets/discuss.py | 15 ------------
Allura/allura/model/discuss.py | 3 ---
Allura/allura/templates/widgets/flag_post.html | 24 --------------------
.../templates/widgets/moderate_posts.html | 2 --
Allura/docs/api-rest/examples/discussion.json | 2 --
Allura/docs/api-rest/schemas/discussion.json | 4 ----
.../forgediscussion/controllers/forum.py | 1 -
8 files changed, 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/3a94beae/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index 40320ee..41a8cf1 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -62,7 +62,6 @@ class WidgetConfig(object):
edit_post = DW.EditPost()
moderate_thread = DW.ModerateThread()
moderate_post = DW.ModeratePost()
- flag_post = DW.FlagPost()
post_filter = DW.PostFilter()
moderate_posts = DW.ModeratePosts()
# Other widgets
@@ -371,17 +370,6 @@ class PostController(BaseController):
@h.vardec
@expose()
@require_post()
- @validate(pass_validator, error_handler=error_handler)
- def flag(self, **kw):
- self.W.flag_post.to_python(kw, None)
- if c.user._id not in self.post.flagged_by:
- self.post.flagged_by.append(c.user._id)
- self.post.flags += 1
- redirect(request.referer)
-
- @h.vardec
- @expose()
- @require_post()
def attach(self, file_info=None):
require_access(self.post, 'moderate')
self.post.add_multiple_attachments(file_info)
http://git-wip-us.apache.org/repos/asf/allura/blob/3a94beae/Allura/allura/lib/widgets/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/discuss.py b/Allura/allura/lib/widgets/discuss.py
index d343969..0e24d5b 100644
--- a/Allura/allura/lib/widgets/discuss.py
+++ b/Allura/allura/lib/widgets/discuss.py
@@ -54,13 +54,6 @@ class ModeratePost(ew.SimpleForm):
submit_text=None)
-class FlagPost(ew.SimpleForm):
- template = 'jinja:allura:templates/widgets/flag_post.html'
- defaults = dict(
- ew.SimpleForm.defaults,
- submit_text=None)
-
-
class AttachPost(ff.ForgeForm):
defaults = dict(
ff.ForgeForm.defaults,
@@ -119,10 +112,6 @@ class PostFilter(ff.ForgeForm):
label='Pending moderation'),
ew.Option(py_value='ok', label='Ok')],
if_missing='pending'),
- ew.IntField(name='flag',
- label='Show posts with at least "n" flags',
- css_class='text',
- if_missing=0),
ew.InputField(name='username',
label='Show post filtered by username'),
ew.SubmitButton(label='Filter Posts')
@@ -317,10 +306,6 @@ class Post(HierWidget):
$('div.discussion-post').each(function () {
var post = this;
$('.submit', post).button();
- $('.flag_post', post).click(function (evt) {
- evt.preventDefault();
- this.parentNode.submit();
- });
$('.moderate_post', post).click(function(e){
e.preventDefault();
var mod = $(this).text();
http://git-wip-us.apache.org/repos/asf/allura/blob/3a94beae/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 69bf556..96096da 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -484,8 +484,6 @@ class Post(Message, VersionedArtifact, ActivityObject):
subject = FieldProperty(schema.Deprecated)
status = FieldProperty(schema.OneOf('ok', 'pending', 'spam',
if_missing='pending'))
- flagged_by = FieldProperty([schema.ObjectId])
- flags = FieldProperty(int, if_missing=0)
last_edit_date = FieldProperty(datetime, if_missing=None)
last_edit_by_id = AlluraUserProperty()
edit_count = FieldProperty(int, if_missing=0)
@@ -506,7 +504,6 @@ class Post(Message, VersionedArtifact, ActivityObject):
subject=self.subject,
status=self.status,
text=self.text,
- flagged_by=map(str, self.flagged_by),
timestamp=self.timestamp,
last_edited=self.last_edit_date,
author_id=str(author._id),
http://git-wip-us.apache.org/repos/asf/allura/blob/3a94beae/Allura/allura/templates/widgets/flag_post.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/flag_post.html b/Allura/allura/templates/widgets/flag_post.html
deleted file mode 100644
index 64a7d6e..0000000
--- a/Allura/allura/templates/widgets/flag_post.html
+++ /dev/null
@@ -1,24 +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.
--#}
-{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
-<form method="POST" action="{{action}}">
- <input type="hidden" name="delete" value="True"/>
- {{ g.icons['flag'].render(show_title=True, extra_css='flag_post') }}
- {{lib.csrf_token()}}
-</form>
http://git-wip-us.apache.org/repos/asf/allura/blob/3a94beae/Allura/allura/templates/widgets/moderate_posts.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/moderate_posts.html b/Allura/allura/templates/widgets/moderate_posts.html
index 7a81e1e..6a73669 100644
--- a/Allura/allura/templates/widgets/moderate_posts.html
+++ b/Allura/allura/templates/widgets/moderate_posts.html
@@ -32,7 +32,6 @@
<th><a href="#">[x]</a></th>
<th>Timestamp</th>
<th>Status</th>
- <th>Flags?</th>
<th>Author</th>
<th>Subject</th>
<th>Text</th>
@@ -49,7 +48,6 @@
</td>
<td>{{h.ago(post.timestamp)}}</td>
<td>{{post.status}}</td>
- <td>{{post.flags}}</td>
{% set author = post.author() %}
<td>{{author.display_name}} ({{author.username}})</td>
<td>{{post.thread.subject or '(no subject)'}}</td>
http://git-wip-us.apache.org/repos/asf/allura/blob/3a94beae/Allura/docs/api-rest/examples/discussion.json
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/examples/discussion.json b/Allura/docs/api-rest/examples/discussion.json
index 128269b..51fa7fb 100755
--- a/Allura/docs/api-rest/examples/discussion.json
+++ b/Allura/docs/api-rest/examples/discussion.json
@@ -8,7 +8,6 @@
"shortname": "devs",
"_id": "55ad23c34d21224d82656add",
"last_post": {
- "flagged_by": [],
"status": "ok",
"last_edited": "2015-07-20 16:39:53.290000",
"author": "root",
@@ -29,7 +28,6 @@
"shortname": "general",
"_id": "5568f6684d212236d1eaed07",
"last_post": {
- "flagged_by": [],
"status": "ok",
"last_edited": null,
"author": "root",
http://git-wip-us.apache.org/repos/asf/allura/blob/3a94beae/Allura/docs/api-rest/schemas/discussion.json
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/schemas/discussion.json b/Allura/docs/api-rest/schemas/discussion.json
index 8f62a2f..5a66073 100755
--- a/Allura/docs/api-rest/schemas/discussion.json
+++ b/Allura/docs/api-rest/schemas/discussion.json
@@ -36,10 +36,6 @@
"type": "object",
"id": "last_post",
"properties": {
- "flagged_by": {
- "type": "array",
- "id": "flagged_by"
- },
"status": {
"type": "string",
"id": "status"
http://git-wip-us.apache.org/repos/asf/allura/blob/3a94beae/ForgeDiscussion/forgediscussion/controllers/forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/forum.py b/ForgeDiscussion/forgediscussion/controllers/forum.py
index ba1f366..bb0fa33 100644
--- a/ForgeDiscussion/forgediscussion/controllers/forum.py
+++ b/ForgeDiscussion/forgediscussion/controllers/forum.py
@@ -60,7 +60,6 @@ class WidgetConfig(object):
subscribe_form = SubscribeForm()
edit_post = DW.EditPost(show_subject=True)
moderate_thread = FW.ModerateThread()
- flag_post = DW.FlagPost()
post_filter = DW.PostFilter()
moderate_posts = DW.ModeratePosts()
# Other widgets