Commit 88102736c92883ebeadb349939b5cc9ae301eeea

Authored by juliotoscano
1 parent 993d6cda

remove img course #229

courses/forms.py
@@ -51,7 +51,7 @@ class CourseForm(forms.ModelForm): @@ -51,7 +51,7 @@ class CourseForm(forms.ModelForm):
51 class Meta: 51 class Meta:
52 model = Course 52 model = Course
53 fields = ('name', 'objectivies', 'content', 'max_students', 'init_register_date', 'end_register_date', 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 labels = { 55 labels = {
56 'name': _('Name'), 56 'name': _('Name'),
57 'objectivies': _('Objectives'), 57 'objectivies': _('Objectives'),
@@ -61,7 +61,6 @@ class CourseForm(forms.ModelForm): @@ -61,7 +61,6 @@ class CourseForm(forms.ModelForm):
61 'end_register_date': _('Course registration end date'), 61 'end_register_date': _('Course registration end date'),
62 'init_date': _('Course start date'), 62 'init_date': _('Course start date'),
63 'end_date': _('Course end date'), 63 'end_date': _('Course end date'),
64 - 'image': _('Image'),  
65 'category': _('CourseCategory'), 64 'category': _('CourseCategory'),
66 } 65 }
67 help_texts = { 66 help_texts = {
@@ -73,7 +72,6 @@ class CourseForm(forms.ModelForm): @@ -73,7 +72,6 @@ class CourseForm(forms.ModelForm):
73 'end_register_date': _('Date that ends the registration period of the course (dd/mm/yyyy)'), 72 'end_register_date': _('Date that ends the registration period of the course (dd/mm/yyyy)'),
74 'init_date': _('Date that the course starts (dd/mm/yyyy)'), 73 'init_date': _('Date that the course starts (dd/mm/yyyy)'),
75 'end_date': _('Date that the course ends (dd/mm/yyyy)'), 74 'end_date': _('Date that the course ends (dd/mm/yyyy)'),
76 - 'image': _('Representative image of the course'),  
77 'category': _('CourseCategory which the course belongs'), 75 'category': _('CourseCategory which the course belongs'),
78 } 76 }
79 77
@@ -91,7 +89,7 @@ class UpdateCourseForm(CourseForm): @@ -91,7 +89,7 @@ class UpdateCourseForm(CourseForm):
91 class Meta: 89 class Meta:
92 model = Course 90 model = Course
93 fields = ('name', 'objectivies', 'content', 'max_students', 'init_register_date', 'end_register_date', 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 labels = { 93 labels = {
96 'name': _('Name'), 94 'name': _('Name'),
97 'objectivies': _('Objectives'), 95 'objectivies': _('Objectives'),
@@ -101,7 +99,6 @@ class UpdateCourseForm(CourseForm): @@ -101,7 +99,6 @@ class UpdateCourseForm(CourseForm):
101 'end_register_date': _('Course registration end date'), 99 'end_register_date': _('Course registration end date'),
102 'init_date': _('Course start date'), 100 'init_date': _('Course start date'),
103 'end_date': _('Course end date'), 101 'end_date': _('Course end date'),
104 - 'image': _('Image'),  
105 'category': _('CourseCategory'), 102 'category': _('CourseCategory'),
106 'students': _('Student'), 103 'students': _('Student'),
107 } 104 }
@@ -114,7 +111,6 @@ class UpdateCourseForm(CourseForm): @@ -114,7 +111,6 @@ class UpdateCourseForm(CourseForm):
114 'end_register_date': _('Date that ends the registration period of the course (dd/mm/yyyy)'), 111 'end_register_date': _('Date that ends the registration period of the course (dd/mm/yyyy)'),
115 'init_date': _('Date that the course starts (dd/mm/yyyy)'), 112 'init_date': _('Date that the course starts (dd/mm/yyyy)'),
116 'end_date': _('Date that the course ends (dd/mm/yyyy)'), 113 'end_date': _('Date that the course ends (dd/mm/yyyy)'),
117 - 'image': _('Representative image of the course'),  
118 'category': _('CourseCategory which the course belongs'), 114 'category': _('CourseCategory which the course belongs'),
119 'students': _("Course's Students"), 115 'students': _("Course's Students"),
120 } 116 }
courses/models.py
@@ -46,7 +46,6 @@ class Course(models.Model): @@ -46,7 +46,6 @@ class Course(models.Model):
46 end_register_date = models.DateField(_('Register Date (End)')) 46 end_register_date = models.DateField(_('Register Date (End)'))
47 init_date = models.DateField(_('Begin of Course Date')) 47 init_date = models.DateField(_('Begin of Course Date'))
48 end_date = models.DateField(_('End of Course Date')) 48 end_date = models.DateField(_('End of Course Date'))
49 - image = models.ImageField(verbose_name = _('Image'), blank = True, upload_to = 'courses/')  
50 category = models.ForeignKey(CourseCategory, verbose_name = _('Category'), related_name='course_category') 49 category = models.ForeignKey(CourseCategory, verbose_name = _('Category'), related_name='course_category')
51 professors = models.ManyToManyField(User,verbose_name=_('Professors'), related_name='courses_professors') 50 professors = models.ManyToManyField(User,verbose_name=_('Professors'), related_name='courses_professors')
52 students = models.ManyToManyField(User,verbose_name=_('Students'), related_name='courses_student', blank = True) 51 students = models.ManyToManyField(User,verbose_name=_('Students'), related_name='courses_student', blank = True)
@@ -146,7 +145,7 @@ class Material(Resource): @@ -146,7 +145,7 @@ class Material(Resource):
146 topic = models.ForeignKey(Topic, verbose_name = _('Topic'), related_name='materials') 145 topic = models.ForeignKey(Topic, verbose_name = _('Topic'), related_name='materials')
147 students = models.ManyToManyField(User, verbose_name = _('Students'), related_name='materials') 146 students = models.ManyToManyField(User, verbose_name = _('Students'), related_name='materials')
148 all_students = models.BooleanField(_('All Students'), default=False) 147 all_students = models.BooleanField(_('All Students'), default=False)
149 - 148 +
150 class FileMaterial(models.Model): 149 class FileMaterial(models.Model):
151 material = models.ForeignKey(Material, verbose_name = _('Material'), related_name='material_file') 150 material = models.ForeignKey(Material, verbose_name = _('Material'), related_name='material_file')
152 file = models.FileField(upload_to='uploads/%Y/%m/%d') 151 file = models.FileField(upload_to='uploads/%Y/%m/%d')
@@ -156,7 +155,7 @@ class LinkMaterial(models.Model): @@ -156,7 +155,7 @@ class LinkMaterial(models.Model):
156 material = models.ForeignKey(Material, verbose_name = _('Material'), related_name='material_link') 155 material = models.ForeignKey(Material, verbose_name = _('Material'), related_name='material_link')
157 name = models.CharField(max_length=100) 156 name = models.CharField(max_length=100)
158 description = models.TextField() 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 It is a category for each subject. 161 It is a category for each subject.
courses/templates/course/course_card.html
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 </div> 26 </div>
27 {% elif user|has_role:'student' %} 27 {% elif user|has_role:'student' %}
28 {% if not request.user in course.students.all %} 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 {% endif %} 30 {% endif %}
31 {% endif %} 31 {% endif %}
32 </div> 32 </div>
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 <div class="panel-collapse collapseOne-{{course.slug}} collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true" aria-hidden="false" tabindex="0"> 34 <div class="panel-collapse collapseOne-{{course.slug}} collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true" aria-hidden="false" tabindex="0">
35 <div class="panel-body"> 35 <div class="panel-body">
36 <p><b>{% trans 'Course Name' %}: </b>{{course.name}}</p> 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 <p> 38 <p>
39 <b>{% trans 'Description' %}:</b> 39 <b>{% trans 'Description' %}:</b>
40 <i> 40 <i>
courses/templates/course/create.html
@@ -20,16 +20,7 @@ @@ -20,16 +20,7 @@
20 <label for="{{ field.auto_id }}">{{ field.label }}</label> 20 <label for="{{ field.auto_id }}">{{ field.label }}</label>
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'%} 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 <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 <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 {% else %} 24 {% else %}
34 {% render_field field class='form-control' %} 25 {% render_field field class='form-control' %}
35 {% endif %} 26 {% endif %}
courses/templates/course/update.html
@@ -19,16 +19,6 @@ @@ -19,16 +19,6 @@
19 <label for="{{ field.auto_id }}">{{ field.label }}</label> 19 <label for="{{ field.auto_id }}">{{ field.label }}</label>
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'%} 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 <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> 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 {% else %} 22 {% else %}
33 {% render_field field class='form-control' %} 23 {% render_field field class='form-control' %}
34 {% endif %} 24 {% endif %}