Commit 35b73722e2d3d6dc06a3fc7f50acc3b48dfbf8c9
Exists in
master
and in
3 other branches
resolved conflict and now, when a category is updated and it's not visibile, all…
… it's subjects become not visible
Showing
4 changed files
with
18 additions
and
14 deletions
Show diff stats
amadeus/static/css/base/amadeus.css
@@ -43,6 +43,7 @@ | @@ -43,6 +43,7 @@ | ||
43 | 43 | ||
44 | #sidebar-menu{ | 44 | #sidebar-menu{ |
45 | -webkit-padding-start: 0px; | 45 | -webkit-padding-start: 0px; |
46 | + padding-left: 0px; | ||
46 | } | 47 | } |
47 | 48 | ||
48 | #sidebar-menu .item{ | 49 | #sidebar-menu .item{ |
@@ -941,19 +942,21 @@ ul, li { | @@ -941,19 +942,21 @@ ul, li { | ||
941 | /* End Bottom Menu */ | 942 | /* End Bottom Menu */ |
942 | 943 | ||
943 | 944 | ||
945 | + | ||
944 | /* subjects app starts*/ | 946 | /* subjects app starts*/ |
945 | 947 | ||
946 | .access-subject{ | 948 | .access-subject{ |
947 | - background-color: #2eb82e; | 949 | + background-color: #2eb82e !important; |
948 | color: white; | 950 | color: white; |
949 | border: none; | 951 | border: none; |
950 | } | 952 | } |
951 | 953 | ||
952 | .subscribe-subject{ | 954 | .subscribe-subject{ |
953 | - background-color: #33cc33; | 955 | + background-color: #33cc33 !important; |
954 | color:white; | 956 | color:white; |
955 | border:none; | 957 | border:none; |
956 | } | 958 | } |
957 | 959 | ||
958 | 960 | ||
959 | -/* subjects app ends */ | ||
960 | \ No newline at end of file | 961 | \ No newline at end of file |
962 | +/* subjects app ends */ | ||
963 | + |
categories/views.py
@@ -194,6 +194,10 @@ class UpdateCategory(LogMixin, UpdateView): | @@ -194,6 +194,10 @@ class UpdateCategory(LogMixin, UpdateView): | ||
194 | super(UpdateCategory, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) | 194 | super(UpdateCategory, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context) |
195 | 195 | ||
196 | objeto = self.object.name | 196 | objeto = self.object.name |
197 | + | ||
198 | + if not self.object.visible: | ||
199 | + for subject in self.object.subjects: | ||
200 | + subject.visible = self.object.visible | ||
197 | messages.success(self.request, _('Category "%s" updated successfully!')%(objeto)) | 201 | messages.success(self.request, _('Category "%s" updated successfully!')%(objeto)) |
198 | 202 | ||
199 | if self.request.user.is_staff: | 203 | if self.request.user.is_staff: |
subjects/templates/subjects/list.html
@@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
93 | 93 | ||
94 | {{category.description|safe}} | 94 | {{category.description|safe}} |
95 | 95 | ||
96 | - {% if request.user in category.coordinators.all or request.user.is_staff %} | 96 | + {% if request.user in category.coordinators.all %} |
97 | <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "Create new subject" %} </button></a> | 97 | <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "Create new subject" %} </button></a> |
98 | {% endif %} | 98 | {% endif %} |
99 | 99 | ||
@@ -139,7 +139,6 @@ | @@ -139,7 +139,6 @@ | ||
139 | <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content"> | 139 | <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content"> |
140 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> | 140 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> |
141 | <input type="hidden" class="log_id" value="" /> | 141 | <input type="hidden" class="log_id" value="" /> |
142 | - | ||
143 | {% if category.coordinators.all|length > 0 %} | 142 | {% if category.coordinators.all|length > 0 %} |
144 | <h4><b>{% trans "Coordinator(s) " %}: </b> | 143 | <h4><b>{% trans "Coordinator(s) " %}: </b> |
145 | {{ category.coordinators.all|join:', ' }} | 144 | {{ category.coordinators.all|join:', ' }} |
@@ -149,8 +148,8 @@ | @@ -149,8 +148,8 @@ | ||
149 | {% endif %} | 148 | {% endif %} |
150 | 149 | ||
151 | {{category.description|safe}} | 150 | {{category.description|safe}} |
152 | - | ||
153 | - {% if request.user in category.coordinators.all or request.user.is_staff %} | 151 | + |
152 | + {% if request.user in category.coordinators.all %} | ||
154 | <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "Create new subject" %} </button></a> | 153 | <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "Create new subject" %} </button></a> |
155 | {% endif %} | 154 | {% endif %} |
156 | 155 | ||
@@ -169,9 +168,7 @@ | @@ -169,9 +168,7 @@ | ||
169 | <div id="modal_course"> | 168 | <div id="modal_course"> |
170 | </div> | 169 | </div> |
171 | 170 | ||
172 | - <div id="modal_subject"> | ||
173 | - | ||
174 | - </div> | 171 | + <div id="modal_subjct"></div> |
175 | 172 | ||
176 | <script type="text/javascript" src="{% static 'js/course.js' %}"></script> | 173 | <script type="text/javascript" src="{% static 'js/course.js' %}"></script> |
177 | {% endblock %} | 174 | {% endblock %} |
subjects/templates/subjects/subject_card.html
@@ -51,9 +51,9 @@ | @@ -51,9 +51,9 @@ | ||
51 | <p>{{subject.description_brief|safe}}</p> | 51 | <p>{{subject.description_brief|safe}}</p> |
52 | 52 | ||
53 | {% if request.user in subject.students.all or request.user in subject.professor.all or request.user.is_staff or request.user in category.coordinators.all %} | 53 | {% if request.user in subject.students.all or request.user in subject.professor.all or request.user.is_staff or request.user in category.coordinators.all %} |
54 | - <a href="#"><button class="access-subject"> {% trans "Access Subject" %}</button></a> | 54 | + <a href="#" class="access-subject btn btn-primary btn-raised"> {% trans "Access Subject" %}</a> |
55 | {% else %} | 55 | {% else %} |
56 | - <a href="#"><button class="subscribe-subject"> {% trans "Subscribe to Subject" %}</button></a> | 56 | + <a href="#" class="subscribe-subject btn btn-primary btn-raised"> {% trans "Subscribe to Subject" %}</a> |
57 | {% endif %} | 57 | {% endif %} |
58 | </div> | 58 | </div> |
59 | </div> | 59 | </div> |
@@ -109,9 +109,9 @@ | @@ -109,9 +109,9 @@ | ||
109 | <p>{{subject.description_brief|safe}}</p> | 109 | <p>{{subject.description_brief|safe}}</p> |
110 | 110 | ||
111 | {% if request.user in subject.students.all or request.user in subject.professor.all or request.user.is_staff or request.user in category.coordinators.all %} | 111 | {% if request.user in subject.students.all or request.user in subject.professor.all or request.user.is_staff or request.user in category.coordinators.all %} |
112 | - <a href="#"><button class="access-subject"> {% trans "Access Subject" %}</button></a> | 112 | + <a href="#" class="access-subject btn btn-primary btn-raised"> {% trans "Access Subject" %}</a> |
113 | {% else %} | 113 | {% else %} |
114 | - <a href="#"><button class="subscribe-subject"> {% trans "Subscribe to Subject" %}</button></a> | 114 | + <a href="#" class="subscribe-subject btn btn-primary btn-raised"> {% trans "Subscribe to Subject" %}</a> |
115 | {% endif %} | 115 | {% endif %} |
116 | </div> | 116 | </div> |
117 | </div> | 117 | </div> |