--- /dev/null
+from django.contrib import admin
+
+from .models import CommentDocument
+
+
+class CommentDocumentAdmin(admin.ModelAdmin):
+ prepopulated_fields = {"slug": ("name",)}
+
+admin.site.register(CommentDocument, CommentDocumentAdmin)
--- /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 model 'CommentDocument'
+ db.create_table(u'comment_commentdocument', (
+ (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)),
+ ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=255)),
+ ('comment_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)),
+ ('order', self.gf('django.db.models.fields.IntegerField')()),
+ ))
+ db.send_create_signal(u'comment', ['CommentDocument'])
+
+
+ def backwards(self, orm):
+ # Deleting model 'CommentDocument'
+ db.delete_table(u'comment_commentdocument')
+
+
+ models = {
+ u'comment.commentdocument': {
+ 'Meta': {'ordering': "['order']", 'object_name': 'CommentDocument'},
+ 'comment_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'order': ('django.db.models.fields.IntegerField', [], {}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'})
+ }
+ }
+
+ complete_apps = ['comment']
\ No newline at end of file
--- /dev/null
+from django.db import models
+from django.core.urlresolvers import reverse
+
+
+class CommentDocument(models.Model):
+ name = models.CharField(max_length = 255, unique = True)
+ slug = models.SlugField(max_length = 255, unique = True)
+ comment_id = models.CharField(max_length = 255, unique = True)
+ order = models.IntegerField()
+
+ class Meta:
+ ordering = ['order']
+
+ def __unicode__(self):
+ return self.name
+
+ def get_absolute_url(self):
+ return reverse('comment_document', kwargs = dict(slug = self.slug))
--- /dev/null
+{% extends "base_mil.html" %}
+
+{% block body %}
+
+ <h1>{{object.name}}</h1>
+
+ <iframe frameborder="0" src="{{comment_url}}/text/{{object.comment_id}}/comments_frame/?" style="height: 600px; width: 99.9%; position: relative; top: 0px;"></iframe>
+
+{% endblock %}
\ No newline at end of file
--- /dev/null
+{% extends "base_mil.html" %}
+
+
+{% block body %}
+
+ <ol>
+ {% for document in object_list %}
+ <li><a href="{{document.get_absolute_url}}">{{document.name}}</a></li>
+ {% endfor %}
+ </ol>
+
+{% endblock %}
\ No newline at end of file
--- /dev/null
+from django.conf.urls import patterns, include, url
+
+from .views import CommentDocumentList, CommentDocument
+
+
+urlpatterns = patterns('',
+ url('^$', CommentDocumentList.as_view(), name = 'comment_document_index'),
+ url('^(?P<slug>[^/]+)/$', CommentDocument.as_view(), name = 'comment_document')
+)
\ No newline at end of file
--- /dev/null
+from django.views.generic import ListView, DetailView
+from django.conf import settings
+
+from .models import CommentDocument
+
+
+class CommentDocumentList(ListView):
+ model = CommentDocument
+
+
+class CommentDocument(DetailView):
+ model = CommentDocument
+
+ def get_context_data(self, **kwargs):
+ context = super(CommentDocument, self).get_context_data(**kwargs)
+ context['comment_url'] = settings.COMMENT_URL
+ return context
\ No newline at end of file
urlpatterns = i18n_patterns('',
url(r'^$', MILHomeView.as_view(), name="mil_home"),
url(r'^kompetencje/', include('curriculum.urls')),
+ url(r'^wez-udzial/', include('comment.urls'))
)
handler404 = 'edumed.views.mil_404_view'
'edumed',
'curriculum',
'catalogue',
+ 'comment',
'fnpdjango',
'south',