From 3eae01e8f9f95e6dc10ab9b6dcc9ab2005a5fea2 Mon Sep 17 00:00:00 2001 From: Felipe Henrique de Almeida Bormann Date: Wed, 1 Feb 2017 19:19:59 -0300 Subject: [PATCH] modified link to have description_brief on it's model and created resource_card but still has to adjust design on header and access link of links --- links/forms.py | 4 ++-- links/migrations/0007_auto_20170201_1907.py | 20 ++++++++++++++++++++ links/models.py | 2 +- links/templates/links/_form.html | 10 +++++----- subjects/templates/subjects/list_search.html | 22 +++++++++++++++------- subjects/templates/subjects/resource_card.html | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ subjects/views.py | 17 ++++++++++++----- 7 files changed, 121 insertions(+), 20 deletions(-) create mode 100644 links/migrations/0007_auto_20170201_1907.py create mode 100644 subjects/templates/subjects/resource_card.html diff --git a/links/forms.py b/links/forms.py index 2349d25..9011530 100644 --- a/links/forms.py +++ b/links/forms.py @@ -29,14 +29,14 @@ class LinkForm(forms.ModelForm): class Meta: model = Link - fields = ['name','link_url', 'brief_description', 'all_students', 'students', 'groups', 'visible'] + fields = ['name','link_url', 'description_brief', 'all_students', 'students', 'groups', 'visible'] labels = { 'name': _('Link name'), 'end_view' : _('End View'), 'end_view_date': _('End View Date') } widgets = { - 'brief_description': forms.Textarea, + 'description_brief': forms.Textarea, 'students': forms.SelectMultiple, 'groups': forms.SelectMultiple, } diff --git a/links/migrations/0007_auto_20170201_1907.py b/links/migrations/0007_auto_20170201_1907.py new file mode 100644 index 0000000..228ade6 --- /dev/null +++ b/links/migrations/0007_auto_20170201_1907.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.4 on 2017-02-01 22:07 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('links', '0006_auto_20170201_1756'), + ] + + operations = [ + migrations.RenameField( + model_name='link', + old_name='description', + new_name='description_brief', + ), + ] diff --git a/links/models.py b/links/models.py index 8876e1d..38704f5 100644 --- a/links/models.py +++ b/links/models.py @@ -10,7 +10,7 @@ from django.utils import timezone class Link(Resource): - description = models.TextField(_("simpler_description"), blank=True) + description_brief = models.TextField(_("simpler_description"), blank=True) link_url = models.URLField(verbose_name = _("Link_URL")) diff --git a/links/templates/links/_form.html b/links/templates/links/_form.html index 6ee271d..c770abc 100644 --- a/links/templates/links/_form.html +++ b/links/templates/links/_form.html @@ -61,18 +61,18 @@
- - {% render_field form.brief_description class='form-control text_wysiwyg' %} + + {% render_field form.description_brief class='form-control text_wysiwyg' %} - {{ form.brief_description.help_text }} + {{ form.description_brief.help_text }} - {% if form.brief_description.errors %} + {% if form.description_brief.errors %}