fnp
/
django-migdal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a398332
)
add inline html
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 10 Jan 2013 13:28:15 +0000
(14:28 +0100)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 10 Jan 2013 13:28:15 +0000
(14:28 +0100)
migdal/migrations/0006_auto__add_field_entry_in_stream__add_field_entry_first_published_at.py
patch
|
blob
|
history
migdal/models.py
patch
|
blob
|
history
migdal/templates/migdal/entry/entry_begin.html
patch
|
blob
|
history
migdal/templates/migdal/entry/entry_detail.html
patch
|
blob
|
history
setup.py
patch
|
blob
|
history
diff --git
a/migdal/migrations/0006_auto__add_field_entry_in_stream__add_field_entry_first_published_at.py
b/migdal/migrations/0006_auto__add_field_entry_in_stream__add_field_entry_first_published_at.py
index
8686f62
..
0153811
100644
(file)
--- a/
migdal/migrations/0006_auto__add_field_entry_in_stream__add_field_entry_first_published_at.py
+++ b/
migdal/migrations/0006_auto__add_field_entry_in_stream__add_field_entry_first_published_at.py
@@
-27,7
+27,8
@@
class Migration(SchemaMigration):
else:
entry.first_published_at = (
entry.published_at_en or entry.published_at_pl)
else:
entry.first_published_at = (
entry.published_at_en or entry.published_at_pl)
- entry.save()
+ orm.Entry.objects.filter(pk=entry.pk).update(
+ first_published_at=entry.first_published_at)
def backwards(self, orm):
# Deleting field 'Entry.in_stream'
def backwards(self, orm):
# Deleting field 'Entry.in_stream'
diff --git
a/migdal/models.py
b/migdal/models.py
index
4977562
..
3ab375d
100644
(file)
--- a/
migdal/models.py
+++ b/
migdal/models.py
@@
-105,6
+105,12
@@
class Entry(models.Model):
mail_text, settings.SERVER_EMAIL, [self.author_email]
)
mail_text, settings.SERVER_EMAIL, [self.author_email]
)
+ def inline_html(self):
+ for att in self.attachment_set.all():
+ if att.file.name.endswith(".html"):
+ with open(att.file.path) as f:
+ yield f.read()
+
add_translatable(Entry, languages=app_settings.OPTIONAL_LANGUAGES, fields={
'needed': models.CharField(_('needed'), max_length=1, db_index=True, choices=(
add_translatable(Entry, languages=app_settings.OPTIONAL_LANGUAGES, fields={
'needed': models.CharField(_('needed'), max_length=1, db_index=True, choices=(
diff --git
a/migdal/templates/migdal/entry/entry_begin.html
b/migdal/templates/migdal/entry/entry_begin.html
index
c26d6fd
..
e452a53
100644
(file)
--- a/
migdal/templates/migdal/entry/entry_begin.html
+++ b/
migdal/templates/migdal/entry/entry_begin.html
@@
-22,11
+22,12
@@
</div>
{% if object.image %}
</div>
{% if object.image %}
+ <a href="{{ object.image.url }}">
<img class="entry-picture" src="{% thumbnail object.image "200x150" as thumb %}
{{ thumb.url }}
{% empty %}
{{ object.image.url }}
<img class="entry-picture" src="{% thumbnail object.image "200x150" as thumb %}
{{ thumb.url }}
{% empty %}
{{ object.image.url }}
- {% endthumbnail %}" />
+ {% endthumbnail %}" />
</a>
{% endif %}
<div class="lead">
{{ object.lead }}
{% endif %}
<div class="lead">
{{ object.lead }}
diff --git
a/migdal/templates/migdal/entry/entry_detail.html
b/migdal/templates/migdal/entry/entry_detail.html
index
2e71d35
..
58a9491
100644
(file)
--- a/
migdal/templates/migdal/entry/entry_detail.html
+++ b/
migdal/templates/migdal/entry/entry_detail.html
@@
-28,6
+28,13
@@
{% entry_begin entry 1 %}
<div class="body">
{{ entry.body }}
{% entry_begin entry 1 %}
<div class="body">
{{ entry.body }}
+
+{% for inline_html in entry.inline_html %}
+<div class="inline_html">
+ {{ inline_html|safe }}
+</div>
+{% endfor %}
+
</div>
<div style="clear: both;"></div>
</div>
<div style="clear: both;"></div>
diff --git
a/setup.py
b/setup.py
index
3f77297
..
5be455f
100755
(executable)
--- a/
setup.py
+++ b/
setup.py
@@
-22,7
+22,7
@@
def whole_trees(package_dir, paths):
setup(
name='django-migdal',
setup(
name='django-migdal',
- version='0.
2
',
+ version='0.
3
',
author='Radek Czajka',
author_email='radoslaw.czajka@nowoczesnapolska.org.pl',
url = '',
author='Radek Czajka',
author_email='radoslaw.czajka@nowoczesnapolska.org.pl',
url = '',