Blog pub date

remotes/origin/1203
Nazar Kotjuk 10 years ago
parent db3339a729
commit 30cd0fa053
  1. 2
      article/models.py
  2. 2
      templates/client/article/article.html
  3. 2
      templates/client/includes/article/blog_list.html

@ -123,7 +123,7 @@ class Article(TranslatableModel):
files = generic.GenericRelation('file.FileModel', content_type_field='content_type', object_id_field='object_id')
class Meta:
ordering = ['-created']
ordering = ['-publish_date']
def __unicode__(self):
return self.lazy_translation_getter('main_title', self.pk)

@ -19,7 +19,7 @@
{% include 'client/includes/article/article_logo.html' with obj=object %}
<h1>{{ object.main_title }}</h1>
<strong><span>{{ object.created|date:"d E Y" }}</span>{% if object.theme.all.exists %}{% include 'includes/article_theme.html' with obj=object %}{% endif %}</strong>
<strong><span>{{ object.publish_date|date:"d E Y" }}</span>{% if object.theme.all.exists %}{% include 'includes/article_theme.html' with obj=object %}{% endif %}</strong>
{% if request.user.is_admin %}
<a target="_blank" class="button green " href="/admin/article/blog/{{ object.slug }}/">{% trans 'изменить' %}</a>
{% endif %}

@ -7,7 +7,7 @@
{% include 'includes/article/article_preview.html' with obj=blog %}
<h3><a href="{{ blog.get_permanent_url }}" title="">{{ blog.main_title }}</a></h3>
{{ blog.preview|safe }}
<strong><span>{{ blog.created|date:"d E Y" }}</span>{% if blog.tag.all.exists %}{% include 'includes/article_tags.html' with obj=blog %}{% endif %}</strong>
<strong><span>{{ blog.publish_date|date:"d E Y" }}</span>{% if blog.tag.all.exists %}{% include 'includes/article_tags.html' with obj=blog %}{% endif %}</strong>
</div>
</div>
{% if forloop.counter == 5 or objects|length < 5 %}

Loading…
Cancel
Save