Commit a79f54ef4052676cb816063ff28295902ff8aa2b
1 parent
ec2301c4
Exists in
master
and in
3 other branches
added web page links app and modified list templates of resources
Showing
8 changed files
with
44 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
| 1 | +from django.db import models | ||
| 2 | +from subject.models import Tag | ||
| 3 | + | ||
| 4 | +from topics.models import Topic | ||
| 5 | +from users.models import User | ||
| 6 | +# Create your models here. | ||
| 7 | +class Link(models.Model): | ||
| 8 | + name = models.CharField( _("Name"), unique = True,max_length= 200) | ||
| 9 | + slug = AutoSlugField(_("Slug"),populate_from='name',unique=True) | ||
| 10 | + | ||
| 11 | + description_brief = models.TextField(_("simpler_description"), blank=True) | ||
| 12 | + description = models.TextField(_("description"), blank= True) | ||
| 13 | + | ||
| 14 | + link_url = models.URLField(verbose_name = _("Link_URL")) | ||
| 15 | + | ||
| 16 | + tags = models.ManyToManyField(Tag, verbose_name='tags', blank=True, null=True) | ||
| 17 | + visible = models.BooleanField(_('Visible'), default = True) | ||
| 18 | + all_students = models.BooleanField(_('all_students'), default= False) | ||
| 19 | + students = models.ManyToManyField(User,verbose_name=_('Students'), related_name='students', blank = True) | ||
| 20 | + topic = models.ForeignKey(Topic, verbose_name='topic') | ||
| 21 | + initial_view = models.BooleanField(_('Initial View'), default = False) | ||
| 22 | + initia_view_date = models.DateField(_('Initial View Date'), required= False) | ||
| 23 | + class Meta: | ||
| 24 | + verbose_name = "Link" | ||
| 25 | + verbose_name_plural = "Links" | ||
| 26 | + | ||
| 27 | + def __str__(self): | ||
| 28 | + pass | ||
| 29 | + | ||
| 0 | \ No newline at end of file | 30 | \ No newline at end of file |
topics/templates/topics/list.html
| @@ -55,6 +55,7 @@ | @@ -55,6 +55,7 @@ | ||
| 55 | <li><a href="#"><i class="fa fa-video-camera"></i> {% trans 'Video Embed' %}</a></li> | 55 | <li><a href="#"><i class="fa fa-video-camera"></i> {% trans 'Video Embed' %}</a></li> |
| 56 | <li><a href="#"><i class="fa fa-comments-o"></i> {% trans 'Forum' %}</a></li> | 56 | <li><a href="#"><i class="fa fa-comments-o"></i> {% trans 'Forum' %}</a></li> |
| 57 | <li><a href="{% url 'file_links:create' topic.slug %}"><i class="fa fa-file-archive-o"></i> {% trans 'File Link' %}</a></li> | 57 | <li><a href="{% url 'file_links:create' topic.slug %}"><i class="fa fa-file-archive-o"></i> {% trans 'File Link' %}</a></li> |
| 58 | + <li><a href="#" > <i class="fa fa-globe"></i> {% trans "Link to Website" %}</a> | ||
| 58 | <li><a href="{% url 'webpages:create' topic.slug %}"><i class="fa fa-file-code-o"></i> {% trans 'Webpage' %}</a></li> | 59 | <li><a href="{% url 'webpages:create' topic.slug %}"><i class="fa fa-file-code-o"></i> {% trans 'Webpage' %}</a></li> |
| 59 | <li><a href="#"><i class="fa fa-question-circle-o"></i> {% trans 'Questionary' %}</a></li> | 60 | <li><a href="#"><i class="fa fa-question-circle-o"></i> {% trans 'Questionary' %}</a></li> |
| 60 | </ul> | 61 | </ul> |