Commit 35b73722e2d3d6dc06a3fc7f50acc3b48dfbf8c9

Authored by Felipe Henrique de Almeida Bormann
2 parents 48f3afbe 44348aa1

resolved conflict and now, when a category is updated and it's not visibile, all…

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