Skip to content

Commit

Permalink
Merge branch 'feature/subtitle-and-caption' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Jan 13, 2015
2 parents 80b258e + 088c406 commit 13362e4
Show file tree
Hide file tree
Showing 69 changed files with 6,473 additions and 5,700 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ install:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql;
fi"
before_script:
- ./bin/flake8 --exclude=migrations zinnia
- ./bin/flake8 zinnia
script:
- ./bin/test
after_success:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ docs: coverage sphinx

kwalitee:
@echo "$(COLOR)* Running flake8$(NO_COLOR)"
@./bin/flake8 --count --show-source --show-pep8 --statistics --exclude=migrations zinnia
@./bin/flake8 --count --show-source --show-pep8 --statistics zinnia
@echo "$(SUCCESS_COLOR)* No kwalitee errors, Congratulations ! :)$(NO_COLOR)"

push-translations:
Expand Down
14 changes: 7 additions & 7 deletions versions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ blessings = 1.6
buildout-versions-checker = 1.5.1
collective.recipe.sphinxbuilder = 0.8.2
coverage = 3.7.1
django = 1.7.1
django = 1.7.2
django-contrib-comments = 1.5
django-mptt = 0.6.1
django-tagging = 0.3.4
django-xmlrpc = 0.1.5
djangorecipe = 1.11
docutils = 0.12
feedparser = 5.1.3
flake8 = 2.2.5
flake8 = 2.3.0
futures = 2.2.0
gdata = 2.0.18
jinja2 = 2.7.3
Expand All @@ -25,17 +25,17 @@ nose-progressive = 1.5.1
nose-sfd = 0.4
pbp.recipe.noserunner = 0.2.6
pep8 = 1.5.7
pillow = 2.6.1
pillow = 2.7.0
pyflakes = 0.8.1
pygments = 2.0.1
pyparsing = 2.0.3
python-coveralls = 2.4.3
pytz = 2014.10
pyyaml = 3.11
regex = 2014.12.15
requests = 2.5.0
sh = 1.09
six = 1.8.0
regex = 2014.12.24
requests = 2.5.1
sh = 1.11
six = 1.9.0
snowballstemmer = 1.2.0
sphinx = 1.3b2
textile = 2.2.1
Expand Down
5 changes: 4 additions & 1 deletion zinnia/admin/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class EntryAdmin(admin.ModelAdmin):
date_hierarchy = 'creation_date'
fieldsets = (
(_('Content'), {
'fields': (('title', 'status'), 'content', 'image')}),
'fields': (('title', 'status'), 'lead', 'content',)}),
(_('Illustration'), {
'fields': ('image', 'image_caption'),
'classes': ('collapse', 'collapse-closed')}),
(_('Publication'), {
'fields': (('start_publication', 'end_publication'),
'creation_date', 'sites'),
Expand Down
13 changes: 7 additions & 6 deletions zinnia/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
from django.utils.translation import ugettext_lazy as _
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper

from tagging.forms import TagField

from mptt.forms import TreeNodeChoiceField

from zinnia.models.entry import Entry
from zinnia.models.category import Category
from zinnia.admin.widgets import MiniTextarea
from zinnia.admin.widgets import TagAutoComplete
from zinnia.admin.widgets import MPTTFilteredSelectMultiple
from zinnia.admin.fields import MPTTModelMultipleChoiceField
Expand Down Expand Up @@ -62,10 +61,6 @@ class EntryAdminForm(forms.ModelForm):
widget=MPTTFilteredSelectMultiple(_('categories'), False,
attrs={'rows': '10'}))

tags = TagField(
label=_('Tags'), required=False,
widget=TagAutoComplete())

def __init__(self, *args, **kwargs):
super(EntryAdminForm, self).__init__(*args, **kwargs)
rel = ManyToManyRel(Category, 'id')
Expand All @@ -78,3 +73,9 @@ class Meta:
"""
model = Entry
fields = forms.ALL_FIELDS
widgets = {
'tags': TagAutoComplete,
'lead': MiniTextarea,
'excerpt': MiniTextarea,
'image_caption': MiniTextarea,
}
11 changes: 11 additions & 0 deletions zinnia/admin/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,14 @@ class Media:
'all': (static('css/select2.css'),)
}
js = (static('js/select2.js'),)


class MiniTextarea(widgets.AdminTextareaWidget):
"""
Vertically shorter version of the admin textarea widget.
"""
rows = 2

def __init__(self, attrs=None):
super(MiniTextarea, self).__init__(
{'rows': self.rows})
2 changes: 1 addition & 1 deletion zinnia/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def dataset(self):
"""
dataset = {}
for item in self.queryset.filter():
dataset[item] = ' '.join([six.text_type(getattr(item, field))
dataset[item] = ' '.join([six.text_type(getattr(item, field, ''))
for field in self.fields])
return dataset

Expand Down
Binary file modified zinnia/locale/bg/LC_MESSAGES/django.mo
Binary file not shown.

0 comments on commit 13362e4

Please sign in to comment.