Skip to content

Commit 6ff3530

Browse files
committed
Merge branch 'release-1.2b3'
2 parents ebd553f + 027b7d9 commit 6ff3530

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+391
-175
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ runserver:
5252
# Clean build files
5353
clean:
5454
find . -name "*.pyc" -print0 | xargs -0 rm -rf
55+
find . -name "__pycache__" -print0 | xargs -0 rm -rf
5556
-rm -rf htmlcov
5657
-rm -rf .coverage
5758
-rm -rf build

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,21 @@ The release versions that are sent to the Python package index (PyPI) are also t
107107

108108
The versioning uses a three part version system, "a.b.c" - "a" represents a major release that may not be backwards compatible. "b" is incremented on minor releases that may contain extra features, but are backwards compatible. "c" releases are bug fixes or other micro changes that developers should feel free to immediately update to.
109109

110+
### Version 1.2 Beta 3
111+
112+
* **tag**: [v1.1b2](https://github.com/DistrictDataLabs/minimum-entropy/releases/tag/v1.2b3)
113+
* **deployment**: Monday, July 11, 2016
114+
* **commit**: [see tag](#)
115+
116+
The third beta fixes the tag grid system which got all wonky in the first implementation when actual data was put in. The new style is similar to the Stack Overflow tag grid style. Moreover, now tags are case insensitive, which should help eliminate duplicates. The activity stream was also updated to use templates for a bit more robust control. The "answered" activity now takes the answer as a target rather than as a theme, and answers have detail links to the question that they're on.
117+
110118
### Version 1.1 Beta 2
111119

112120
* **tag**: [v1.1b2](https://github.com/DistrictDataLabs/minimum-entropy/releases/tag/v1.1b2)
113121
* **deployment**: Friday, July 8, 2016
114-
* **commit**: [see tag](#)
122+
* **commit**: [ebd553f](https://github.com/DistrictDataLabs/minimum-entropy/commit/ebd553fd8ec202de38fb3f27de2993770ac48960)
115123

116-
The second beta release fixes a couple of bugs with the older profile system, and a lingering topic item from Kyudo. This release goes a bit further and creates a tagging system for questions (replacing topics) and allows for the ordering and search of questions in a more meaningful way. Hopefully this is the last official Beta version and Minimum Entropy can actually start to be used in a more meaningful way.
124+
The second beta release fixes a couple of bugs with the older profile system, and a lingering topic item from Kyudo. This release goes a bit further and creates a tagging system for questions (replacing topics) and allows for the ordering and search of questions in a more meaningful way. Hopefully this is the last official Beta version and Minimum Entropy can actually start to be used in a more meaningful way.
117125

118126
### Version 1.0 Beta 1
119127

docs/about.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,19 @@ The release versions that are sent to the Python package index (PyPI) are also t
4949

5050
The versioning uses a three part version system, "a.b.c" - "a" represents a major release that may not be backwards compatible. "b" is incremented on minor releases that may contain extra features, but are backwards compatible. "c" releases are bug fixes or other micro changes that developers should feel free to immediately update to.
5151

52+
### Version 1.2 Beta 3
53+
54+
* **tag**: [v1.1b2](https://github.com/DistrictDataLabs/minimum-entropy/releases/tag/v1.2b3)
55+
* **deployment**: Monday, July 11, 2016
56+
* **commit**: [see tag](#)
57+
58+
The third beta fixes the tag grid system which got all wonky in the first implementation when actual data was put in. The new style is similar to the Stack Overflow tag grid style. Moreover, now tags are case insensitive, which should help eliminate duplicates. The activity stream was also updated to use templates for a bit more robust control. The "answered" activity now takes the answer as a target rather than as a theme, and answers have detail links to the question that they're on.
59+
5260
### Version 1.1 Beta 2
5361

5462
* **tag**: [v1.1b2](https://github.com/DistrictDataLabs/minimum-entropy/releases/tag/v1.1b2)
5563
* **deployment**: Friday, July 8, 2016
56-
* **commit**: [see tag](#)
64+
* **commit**: [ebd553f](https://github.com/DistrictDataLabs/minimum-entropy/commit/ebd553fd8ec202de38fb3f27de2993770ac48960)
5765

5866
The second beta release fixes a couple of bugs with the older profile system, and a lingering topic item from Kyudo. This release goes a bit further and creates a tagging system for questions (replacing topics) and allows for the ordering and search of questions in a more meaningful way. Hopefully this is the last official Beta version and Minimum Entropy can actually start to be used in a more meaningful way.
5967

fugato/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: __init__.py [] [email protected] $
10+
# ID: __init__.py [8eae6c4] [email protected] $
1111

1212
"""
1313
The fugato app is designed to collect questions.

fugato/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: admin.py [] [email protected] $
10+
# ID: admin.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Description of the app for the admin site and CMS.

fugato/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: apps.py [] [email protected] $
10+
# ID: apps.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Describes the Fugato application for Django

fugato/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: exceptions.py [] [email protected] $
10+
# ID: exceptions.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Custom exceptions for API

fugato/managers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: managers.py [] [email protected] $
10+
# ID: managers.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Custom managers for the fugato models
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2016-07-10 13:09
3+
from __future__ import unicode_literals
4+
5+
import autoslug.fields
6+
from django.db import migrations
7+
from slugify import slugify
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
dependencies = [
13+
('fugato', '0003_auto_20160707_2054'),
14+
]
15+
16+
operations = [
17+
migrations.AlterField(
18+
model_name='question',
19+
name='slug',
20+
field=autoslug.fields.AutoSlugField(editable=False, populate_from='text', slugify=slugify, unique=True),
21+
),
22+
]

fugato/migrations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: __init__.py [] [email protected] $
10+
# ID: __init__.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Database migrations for the fugato application

fugato/models.py

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: models.py [] [email protected] $
10+
# ID: models.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Models for the fugato app.
@@ -27,7 +27,7 @@
2727
from model_utils.models import TimeStampedModel
2828
from django.core.urlresolvers import reverse
2929
from django.contrib.contenttypes.fields import GenericRelation
30-
30+
from slugify import slugify
3131
from operator import itemgetter
3232

3333
##########################################################################
@@ -36,15 +36,15 @@
3636

3737
class Question(TimeStampedModel):
3838

39-
text = models.CharField( max_length=512, null=False ) # The text of the question
40-
slug = AutoSlugField( populate_from='text', unique=True ) # The slug of the question
39+
text = models.CharField( max_length=512, null=False ) # The text of the question
40+
slug = AutoSlugField( populate_from='text', slugify=slugify, unique=True ) # The slug of the question
4141
signature = models.CharField( max_length=28, unique=True, editable=False ) # The normalized signature
42-
details = models.TextField( help_text="Edit in Markdown", **nullable ) # Additional details about the question
43-
details_rendered = models.TextField( editable=False, **nullable ) # HTML rendered details text from MD
44-
related = models.ManyToManyField( 'self', editable=True, blank=True ) # Links between related questions
45-
author = models.ForeignKey( 'auth.User', related_name='questions' ) # The author of the question
46-
votes = GenericRelation( Vote, related_query_name='questions' ) # Vote on whether or not the question is relevant
47-
tags = models.ManyToManyField('tagging.Tag', related_name='questions') # Tag each question with terms for easy lookup
42+
details = models.TextField( help_text="Edit in Markdown", **nullable ) # Additional details about the question
43+
details_rendered = models.TextField( editable=False, **nullable ) # HTML rendered details text from MD
44+
related = models.ManyToManyField( 'self', editable=True, blank=True ) # Links between related questions
45+
author = models.ForeignKey( 'auth.User', related_name='questions' ) # The author of the question
46+
votes = GenericRelation( Vote, related_query_name='questions' ) # Vote on whether or not the question is relevant
47+
tags = models.ManyToManyField('tagging.Tag', related_name='questions') # Tag each question with terms for easy lookup
4848

4949
## Set custom manager on Question
5050
objects = QuestionManager()
@@ -61,6 +61,12 @@ def get_api_detail_url(self):
6161
"""
6262
return reverse('api:question-detail', args=(self.pk,))
6363

64+
def get_stream_repr(self):
65+
"""
66+
Returns the object representation for the activity stream.
67+
"""
68+
return '“{}”'.format(self)
69+
6470
def has_tag(self, tag):
6571
"""
6672
Returns True if the tag (a string) is in the list of tags.
@@ -107,11 +113,26 @@ class Meta:
107113
db_table = "answers"
108114
order_with_respect_to = 'question'
109115

116+
def get_absolute_url(self):
117+
"""
118+
Return the detail view of the Answer object, that is the url of the
119+
question with the vertical reference to the answer attached.
120+
"""
121+
url = self.question.get_absolute_url()
122+
url += "#answer-{}".format(self.id)
123+
return url
124+
110125
def get_api_detail_url(self):
111126
"""
112127
Returns the API detail endpoint for the object
113128
"""
114129
return reverse('api:answer-detail', args=(self.pk,))
115130

131+
def get_stream_repr(self):
132+
"""
133+
Returns the object representation for the activity stream.
134+
"""
135+
return self.question.get_stream_repr()
136+
116137
def __str__(self):
117138
return self.text

fugato/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: serializers.py [] [email protected] $
10+
# ID: serializers.py [8eae6c4] [email protected] $
1111

1212
"""
1313
JSON Serializers for the Fugato app

fugato/signals.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: signals.py [] [email protected] $
10+
# ID: signals.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Signals for the fugato app
@@ -80,8 +80,7 @@ def send_answered_activity_signal(sender, instance, created, **kwargs):
8080
'sender': sender,
8181
'actor': instance.author,
8282
'verb': 'answer',
83-
'theme': instance,
84-
'target': instance.question,
83+
'target': instance,
8584
'timestamp': instance.created,
8685
}
8786
stream.send(**activity)

fugato/templatetags/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: __init__.py [] [email protected] $
10+
# ID: __init__.py [6f1c3bb] [email protected] $
1111

1212
"""
1313
Template tags for fugato (though also generic usage as well).

fugato/templatetags/paginator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: paginator.py [] [email protected] $
10+
# ID: paginator.py [6f1c3bb] [email protected] $
1111

1212
"""
1313
Provides a paginator tag context for digg-style pagination.

fugato/tests.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: tests.py [] [email protected] $
10+
# ID: tests.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Tests the fugato app
@@ -119,26 +119,22 @@ def test_question_answer_send_stream(self):
119119

120120
# Ensure that the signal was sent once with required arguments
121121
handler.assert_called_once_with(verb='answer', sender=Answer,
122-
timestamp=answer.created, actor=self.user, theme=answer,
123-
target=self.question, signal=stream)
122+
timestamp=answer.created, actor=self.user, target=answer,
123+
signal=stream)
124124

125125
def test_question_answered_activity(self):
126126
"""
127127
Assert that when a question is answered, there is an activity stream item
128128
"""
129129
answer = Answer.objects.create(**fixtures['answer'])
130-
target_content_type = ContentType.objects.get_for_model(answer.question)
131-
target_object_id = answer.question.id
132-
theme_content_type = ContentType.objects.get_for_model(answer)
133-
theme_object_id = answer.id
130+
target_content_type = ContentType.objects.get_for_model(answer)
131+
target_object_id = answer.id
134132

135133
query = {
136134
'verb': 'answer',
137135
'actor': self.user,
138136
'target_content_type': target_content_type,
139137
'target_object_id': target_object_id,
140-
'theme_content_type': theme_content_type,
141-
'theme_object_id': theme_object_id,
142138
}
143139

144140
query = StreamItem.objects.filter(**query)

fugato/views.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: views.py [] [email protected] $
10+
# ID: views.py [8eae6c4] [email protected] $
1111

1212
"""
1313
Views for the Fugato app
@@ -185,8 +185,8 @@ def tags(self, request, pk=None):
185185
if question.has_tag(tag): continue
186186

187187
# Otherwise, get or create the tag
188-
tag, _ = Tag.objects.get_or_create(
189-
text = tag,
188+
tag, _ = Tag.objects.tag(
189+
tag,
190190
defaults = {
191191
'creator': request.user,
192192
}
@@ -196,8 +196,11 @@ def tags(self, request, pk=None):
196196
question.tags.add(tag)
197197

198198
# Next delete any tags that were removed from the question
199+
slugs = [
200+
slugify(t) for t in serializer.validated_data['csv_tags']
201+
]
199202
for tag in question.tags.all():
200-
if tag.text not in serializer.validated_data['csv_tags']:
203+
if tag.slug not in slugs:
201204
question.tags.remove(tag)
202205

203206
return Response(CSVTagSerializer.serialize_question(question))

manage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Copyright (C) 2016 District Data Labs
99
# For license information, see LICENSE.txt
1010
#
11-
# ID: manage.py [] [email protected] $
11+
# ID: manage.py [916a654] [email protected] $
1212

1313
"""
1414
Django default management commands, with some special sauce.

minent/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (C) 2016 District Data Labs
88
# For license information, see LICENSE.txt
99
#
10-
# ID: __init__.py [] [email protected] $
10+
# ID: __init__.py [916a654] [email protected] $
1111

1212
"""
1313
The Minimum Entropy project definition module.

minent/assets/css/taggrid.css

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
/* Styles for the tag grid page */
22

33
.tag-block {
4-
min-height: 128px;
4+
height: 192px;
5+
position: relative;
6+
border-bottom: 1px solid #ccc;
7+
margin: 8px 0;
58
}
69

7-
.tag-question-count {
8-
border: 1px solid #ccc;
9-
width: 64px;
10-
height: 64px;
11-
padding-top: 6px;
10+
.tag-heading-left {
11+
width: 80%;
1212
}
1313

14+
.tag-name {
15+
font-size: 0.90em;
16+
}
17+
18+
.tag-count {
19+
padding-left: 6px;
20+
}
21+
22+
.tag-body {
23+
margin: 6px 0;
24+
}
25+
26+
1427
.tag-description {
15-
font-size: .9em;
28+
font-size: .85em;
1629
}
1730

1831
.tag-meta-list {
1932
font-size: .8em;
33+
position: absolute;
34+
bottom: 0;
2035
}

0 commit comments

Comments
 (0)