.notice {
font-size: 1.3em; }
+.normal {
+ font-size: 1.3em; }
+
.entry-wrapped .gallery-item {
float: left;
width: 300px;
.notice {
font-size: 1.3em;
}
+.normal {
+ font-size: 1.3em;
+}
.entry-wrapped {
.gallery-item{float:left; width:300px;text-align:center;margin-top:2em;}
.gallery-image{height:240px; width:300px; display: table-cell; vertical-align:middle;}
}),
)
+if 'django.contrib.sitemaps' in settings.INSTALLED_APPS:
+ from migdal.sitemap import sitemaps as migdal_sitemaps
+ from questions.sitemap import sitemaps as question_sitemaps
+ sitemaps = dict(migdal_sitemaps.items() + question_sitemaps.items())
+ urlpatterns += patterns('',
+ url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {
+ 'sitemaps': sitemaps
+ }),
+ )
+
if 'django_cas' in settings.INSTALLED_APPS:
urlpatterns += patterns('',
(r'^accounts/login/$', 'django_cas.views.login'),
list_display = ('question', 'email', 'created_at', 'approved', 'answered', 'published')
date_hierarchy = 'created_at'
fields = (
- ('email', 'created_at'),
+ ('email', 'created_at', 'changed_at'),
'question',
'approved',
'edited_question',
('published', 'published_at'),
)
- readonly_fields = ['created_at', 'answered_at', 'published_at']
+ readonly_fields = ['created_at', 'answered_at', 'published_at', 'changed_at']
admin.site.register(Question, QuestionAdmin)
--- /dev/null
+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Adding field 'Question.changed_at'
+ db.add_column('questions_question', 'changed_at',
+ self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime.now, blank=True),
+ keep_default=False)
+
+
+ def backwards(self, orm):
+ # Deleting field 'Question.changed_at'
+ db.delete_column('questions_question', 'changed_at')
+
+
+ models = {
+ 'questions.question': {
+ 'Meta': {'ordering': "['-created_at']", 'object_name': 'Question'},
+ '_answer_rendered': ('django.db.models.fields.TextField', [], {}),
+ 'answer': ('markupfield.fields.MarkupField', [], {'rendered_field': 'True', 'blank': 'True'}),
+ 'answer_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
+ 'answered': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+ 'answered_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'edited_question': ('django.db.models.fields.TextField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'published': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+ 'published_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'question': ('django.db.models.fields.TextField', [], {'db_index': 'True'})
+ }
+ }
+
+ complete_apps = ['questions']
\ No newline at end of file
email = models.EmailField(_('contact e-mail'), null=True, blank=True)
question = models.TextField(_('question'), db_index=True)
created_at = models.DateTimeField(_('created at'), auto_now_add=True)
+ changed_at = models.DateTimeField(_('changed at'), auto_now=True)
approved = models.BooleanField(_('approved'), default=False)
edited_question = models.TextField(_('edited question'), db_index=True, null=True, blank=True,
help_text=_("Leave empty if question doesn't need editing."))
--- /dev/null
+from django.contrib.sitemaps import Sitemap
+from .models import Question
+
+class QuestionSitemap(Sitemap):
+ changefreq = "never"
+ priority = 0.5
+
+ def items(self):
+ return Question.objects.filter(published=True)
+
+ def lastmod(self, obj):
+ return obj.changed_at
+
+ def location(self, obj):
+ return obj.get_absolute_url()
+
+
+sitemaps = {
+ "question": QuestionSitemap,
+}
{% extends "base.html" %}
+{% load url from future %}
{% block "titleextra" %}{{ question }} :: {% endblock %}
{% block "body" %}
<h1>{{ question }}</h1>
+<div class="normal">
{{ question.answer }}
<p><a href="{% url 'questions' %}">Wróć do listy pytań.</a></p>
+</div>
{% endblock %}
\ No newline at end of file
<h1>Pierwsza pomoc w prawie autorskim: pytanie do prawnika</h1>
-
+<div class="normal">
<form method="post" action="">
{% csrf_token %}
<table>
<tr><td></td><td><button>Wyślij</button></td></tr>
</table>
</form>
+</div>
{% endblock %}
\ No newline at end of file
{% block "body" %}
<h1>Pierwsza pomoc w prawie autorskim</h1>
-<p class="normal">Jeśli rozwiązania Twojego problemu nie ma na tej stronie,
-<a href="">zajrzyj do naszego podręcznika</a>. Jeśli i to nie pomoże,
+<div class="normal">
+<p>Jeśli rozwiązania Twojego problemu nie ma na tej stronie,
+<a href="{% url "migdal_entry_publications" "pierwsza-pomoc" %} ">zajrzyj do naszego podręcznika</a>. Jeśli i to nie pomoże,
<a href="{% url 'questions_form' %}">zadaj pytanie naszemu prawnikowi</a>.</p>
<ul>
<li><a href="{{ question.get_absolute_url }}">{{ question }}</a></li>
{% endfor %}
</ul>
+</div>
{% endblock %}
\ No newline at end of file
{% block "body" %}
<h1>Dziękujemy za przesłanie pytania</h1>
+<div class="normal">
???
+</div>
{% endblock %}
\ No newline at end of file
textile
django-markupfield
django-gravatar
-django_comments_xtd
+django_comments_xtd==1.0a5
django-pipeline>=1.2,<1.3
#pyScss