Commit 88102736c92883ebeadb349939b5cc9ae301eeea
1 parent
993d6cda
Exists in
master
and in
5 other branches
remove img course #229
Showing
5 changed files
with
7 additions
and
31 deletions
Show diff stats
courses/forms.py
... | ... | @@ -51,7 +51,7 @@ class CourseForm(forms.ModelForm): |
51 | 51 | class Meta: |
52 | 52 | model = Course |
53 | 53 | fields = ('name', 'objectivies', 'content', 'max_students', 'init_register_date', 'end_register_date', |
54 | - 'init_date', 'end_date', 'image', 'category',) | |
54 | + 'init_date', 'end_date', 'category',) | |
55 | 55 | labels = { |
56 | 56 | 'name': _('Name'), |
57 | 57 | 'objectivies': _('Objectives'), |
... | ... | @@ -61,7 +61,6 @@ class CourseForm(forms.ModelForm): |
61 | 61 | 'end_register_date': _('Course registration end date'), |
62 | 62 | 'init_date': _('Course start date'), |
63 | 63 | 'end_date': _('Course end date'), |
64 | - 'image': _('Image'), | |
65 | 64 | 'category': _('CourseCategory'), |
66 | 65 | } |
67 | 66 | help_texts = { |
... | ... | @@ -73,7 +72,6 @@ class CourseForm(forms.ModelForm): |
73 | 72 | 'end_register_date': _('Date that ends the registration period of the course (dd/mm/yyyy)'), |
74 | 73 | 'init_date': _('Date that the course starts (dd/mm/yyyy)'), |
75 | 74 | 'end_date': _('Date that the course ends (dd/mm/yyyy)'), |
76 | - 'image': _('Representative image of the course'), | |
77 | 75 | 'category': _('CourseCategory which the course belongs'), |
78 | 76 | } |
79 | 77 | |
... | ... | @@ -91,7 +89,7 @@ class UpdateCourseForm(CourseForm): |
91 | 89 | class Meta: |
92 | 90 | model = Course |
93 | 91 | fields = ('name', 'objectivies', 'content', 'max_students', 'init_register_date', 'end_register_date', |
94 | - 'init_date', 'end_date', 'image', 'category','students',) | |
92 | + 'init_date', 'end_date', 'category','students',) | |
95 | 93 | labels = { |
96 | 94 | 'name': _('Name'), |
97 | 95 | 'objectivies': _('Objectives'), |
... | ... | @@ -101,7 +99,6 @@ class UpdateCourseForm(CourseForm): |
101 | 99 | 'end_register_date': _('Course registration end date'), |
102 | 100 | 'init_date': _('Course start date'), |
103 | 101 | 'end_date': _('Course end date'), |
104 | - 'image': _('Image'), | |
105 | 102 | 'category': _('CourseCategory'), |
106 | 103 | 'students': _('Student'), |
107 | 104 | } |
... | ... | @@ -114,7 +111,6 @@ class UpdateCourseForm(CourseForm): |
114 | 111 | 'end_register_date': _('Date that ends the registration period of the course (dd/mm/yyyy)'), |
115 | 112 | 'init_date': _('Date that the course starts (dd/mm/yyyy)'), |
116 | 113 | 'end_date': _('Date that the course ends (dd/mm/yyyy)'), |
117 | - 'image': _('Representative image of the course'), | |
118 | 114 | 'category': _('CourseCategory which the course belongs'), |
119 | 115 | 'students': _("Course's Students"), |
120 | 116 | } | ... | ... |
courses/models.py
... | ... | @@ -46,7 +46,6 @@ class Course(models.Model): |
46 | 46 | end_register_date = models.DateField(_('Register Date (End)')) |
47 | 47 | init_date = models.DateField(_('Begin of Course Date')) |
48 | 48 | end_date = models.DateField(_('End of Course Date')) |
49 | - image = models.ImageField(verbose_name = _('Image'), blank = True, upload_to = 'courses/') | |
50 | 49 | category = models.ForeignKey(CourseCategory, verbose_name = _('Category'), related_name='course_category') |
51 | 50 | professors = models.ManyToManyField(User,verbose_name=_('Professors'), related_name='courses_professors') |
52 | 51 | students = models.ManyToManyField(User,verbose_name=_('Students'), related_name='courses_student', blank = True) |
... | ... | @@ -146,7 +145,7 @@ class Material(Resource): |
146 | 145 | topic = models.ForeignKey(Topic, verbose_name = _('Topic'), related_name='materials') |
147 | 146 | students = models.ManyToManyField(User, verbose_name = _('Students'), related_name='materials') |
148 | 147 | all_students = models.BooleanField(_('All Students'), default=False) |
149 | - | |
148 | + | |
150 | 149 | class FileMaterial(models.Model): |
151 | 150 | material = models.ForeignKey(Material, verbose_name = _('Material'), related_name='material_file') |
152 | 151 | file = models.FileField(upload_to='uploads/%Y/%m/%d') |
... | ... | @@ -156,7 +155,7 @@ class LinkMaterial(models.Model): |
156 | 155 | material = models.ForeignKey(Material, verbose_name = _('Material'), related_name='material_link') |
157 | 156 | name = models.CharField(max_length=100) |
158 | 157 | description = models.TextField() |
159 | - url = models.URLField('Link', max_length=300) | |
158 | + url = models.URLField('Link', max_length=300) | |
160 | 159 | |
161 | 160 | """ |
162 | 161 | It is a category for each subject. | ... | ... |
courses/templates/course/course_card.html
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | </div> |
27 | 27 | {% elif user|has_role:'student' %} |
28 | 28 | {% if not request.user in course.students.all %} |
29 | - <a onclick="subscribe($(this), '{% url 'course:subscribe' course.slug %}', {{ course.id}}, '{% trans 'Are you sure you want to subscribe to this course?' %}')"><button class="btn btn-sm btn-primary btn-raised pull-right">{% trans 'Subscribe' %}</button></a> | |
29 | + <a onclick="subscribe($(this), '{% url 'course:subscribe' course.slug %}', {{ course.id}}, '{% trans 'Are you sure you want to subscribe to this course?' %}')"><button class="btn btn-sm btn-primary btn-raised pull-right">{% trans 'Subscribe' %}</button></a> | |
30 | 30 | {% endif %} |
31 | 31 | {% endif %} |
32 | 32 | </div> |
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | <div class="panel-collapse collapseOne-{{course.slug}} collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true" aria-hidden="false" tabindex="0"> |
35 | 35 | <div class="panel-body"> |
36 | 36 | <p><b>{% trans 'Course Name' %}: </b>{{course.name}}</p> |
37 | - <p><b>{% trans 'Coordinator' %}: </b>{{course.professors.all.0}}</p> | |
37 | + <p><b>{% trans 'Professor' %}: </b>{{course.professors.all.0}}</p> | |
38 | 38 | <p> |
39 | 39 | <b>{% trans 'Description' %}:</b> |
40 | 40 | <i> | ... | ... |
courses/templates/course/create.html
... | ... | @@ -20,16 +20,7 @@ |
20 | 20 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
21 | 21 | {% if field.auto_id == 'id_init_register_date' or field.auto_id == 'id_end_register_date' or field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%} |
22 | 22 | <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> |
23 | - {% elif field.auto_id == 'id_image' %} | |
24 | - {% render_field field class='form-control' %} | |
25 | - <div class="input-group"> | |
26 | - <input type="text" readonly="" class="form-control" placeholder="Choose your photo..."/> | |
27 | - <span class="input-group-btn input-group-sm"> | |
28 | - <button type="button" class="btn btn-fab btn-fab-mini"> | |
29 | - <i class="material-icons">{% trans 'attach_file' %}</i> | |
30 | - </button> | |
31 | - </span> | |
32 | - </div> | |
23 | + | |
33 | 24 | {% else %} |
34 | 25 | {% render_field field class='form-control' %} |
35 | 26 | {% endif %} | ... | ... |
courses/templates/course/update.html
... | ... | @@ -19,16 +19,6 @@ |
19 | 19 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
20 | 20 | {% if field.auto_id == 'id_init_register_date' or field.auto_id == 'id_end_register_date' or field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%} |
21 | 21 | <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> |
22 | - {% elif field.auto_id == 'id_image' %} | |
23 | - {% render_field field class='form-control' %} | |
24 | - <div class="input-group"> | |
25 | - <input type="text" readonly="" class="form-control" placeholder="Choose your photo..."/> | |
26 | - <span class="input-group-btn input-group-sm"> | |
27 | - <button type="button" class="btn btn-fab btn-fab-mini"> | |
28 | - <i class="material-icons">{% trans 'attach_file' %}</i> | |
29 | - </button> | |
30 | - </span> | |
31 | - </div> | |
32 | 22 | {% else %} |
33 | 23 | {% render_field field class='form-control' %} |
34 | 24 | {% endif %} | ... | ... |