Commit 93032820b4e92715ac87a182f6402513acdef795

Authored by Matheus Lins
1 parent 289bd78f

improvemented course's and subject's template

courses/templates/course/index.html
... ... @@ -53,10 +53,20 @@
53 53 {% endfor %}
54 54 {% endif %}
55 55  
  56 +<div class="col-md-12">
  57 + <div class="input-group">
  58 + <div class="form-group is-empty"><input type="search" class="form-control" placeholder="Search Courses"></div>
  59 + <span class="input-group-btn input-group-sm">
  60 + <button type="button" class="btn btn-fab btn-fab-mini">
  61 + <i class="material-icons">search</i>
  62 + </button>
  63 + </span>
  64 + </div>
  65 + </div>
56 66 {% if user|has_role:'professor, system_admin' %}
57 67  
58 68 <div class="col-md-12">
59   - {% if courses_teacher|length > 0 %}
  69 + {% if courses|length > 0 %}
60 70 {% for course in courses_teacher %}
61 71 <!-- Put your content here! -->
62 72 <div class="panel-group ui-accordion ui-widget ui-helper-reset ui-sortable" id="accordion" role="tablist" aria-multiselectable="false">
... ... @@ -130,21 +140,11 @@
130 140 </div>
131 141 </div>
132 142 </div>
  143 +{% endif %}
133 144  
134   -{% else %}
  145 +{% if user|has_role:'students' %}
135 146  
136   - <div class="col-md-12">
137   - <div class="input-group">
138   - <div class="form-group is-empty"><input type="search" class="form-control" placeholder="Search Courses"></div>
139   - <span class="input-group-btn input-group-sm">
140   - <button type="button" class="btn btn-fab btn-fab-mini">
141   - <i class="material-icons">search</i>
142   - </button>
143   - </span>
144   - </div>
145   - </div>
146   -
147   - {% if subjects_student|length > 0 %}
  147 + {% if courses|length > 0 %}
148 148 {% for course in courses_student %}
149 149 <div class="col-md-12">
150 150 <div class="panel panel-info">
... ... @@ -154,9 +154,15 @@
154 154 <img src="" class="img-responsive" />
155 155 {% endif %} -->
156 156 <div class="panel-heading">
157   - <h3 class="panel-title">Course</h3>
158   - <span class="label label-info">{{ course.category }}</span>
159   - <span class="label label-warning">{{ course.max_students }} {% trans 'students tops' %}</span>
  157 + <div class="row">
  158 + <div class="col-md-9">
  159 + <h3 class="panel-title">{{course.name}}</h3>
  160 + </div>
  161 + <div class="col-md-3">
  162 + <span class="label label-info">{{ course.category }}</span>
  163 + <span class="label label-warning">{{ course.max_students }} {% trans 'students tops' %}</span>
  164 + </div>
  165 + </div>
160 166 </div>
161 167 <div class="panel-body">
162 168 <p><b>Course Name: </b>{{ course.name }}</p>
... ... @@ -165,18 +171,22 @@
165 171 <p>
166 172 <b>Description:</b>
167 173 <i>
168   - "Lorem ipsum dolor sit amet, consecctetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
  174 + {% if couse.description %}
  175 + {{course.description|linebreaks}}
  176 + {% else %}
  177 + {% trans 'No description' %}
  178 + {% endif %}
169 179 </i>
170 180 </p>
171 181  
172   - {% if user|has_role:'professor, system_admin' %}
  182 + <!--{% if user|has_role:'professor, system_admin' %}
173 183 <a href="{% url 'course:update' course.slug %}" class="btn btn-sm btn-primary">
174 184 <span class="glyphicon glyphicon-edit"></span>
175 185 </a>
176 186 <a href="{% url 'course:delete' course.slug %}" class="btn btn-sm btn-danger">
177 187 <span class="glyphicon glyphicon-trash"></span>
178 188 </a>
179   - {% endif %}
  189 + {% endif %}-->
180 190  
181 191 <a href="{% url 'course:view' course.slug %}" class="btn btn-raised btn-default center-block">View Course</a>
182 192 </div>
... ... @@ -185,7 +195,6 @@
185 195  
186 196 {% endfor %}
187 197  
188   -
189 198 <nav aria-label="Page navigation">
190 199 <ul class="pagination">
191 200 {% for page_number in paginator.page_range %}
... ... @@ -199,4 +208,5 @@
199 208 {% trans 'No courses found' %}
200 209 {% endif %}
201 210 {% endif %}
  211 +
202 212 {% endblock %}
... ...
courses/templates/course/view.html
... ... @@ -99,7 +99,7 @@
99 99 </div>
100 100 <div class="modal-body">
101 101 <div>
102   - <form class="form-horizontal">
  102 + <!--<form class="form-horizontal">
103 103 <div class="form-group is-empty">
104 104 <label class="control-label col-md-2 col-md-offset-1 col-xs-2 col-xs-offset-1">Name</label>
105 105 <div class="col-md-8 col-xs-8">
... ... @@ -148,7 +148,7 @@
148 148 </div>
149 149 </div>
150 150 </div>
151   - </form>
  151 + </form>-->
152 152 </div>
153 153 <div class="modal-footer">
154 154 <button type="button" data-dismiss="modal" class="btn btn-default">Cancel</button>
... ... @@ -233,6 +233,10 @@
233 233 <a href="{% url 'course:view_subject' subject.slug %}" class="btn btn-raised btn-default center-block">{% trans 'View Subject' %}<div class="ripple-container"></div></a>
234 234 </div>
235 235 </div>
  236 +<div class="form-group">
  237 + <a href="{% url 'course:create_subject' subject.slug %}" data-toggle="modal" data-target="" class="btn btn-primary btn-lg btn-block btn-raised">{% trans 'Create Subject' %}<div class="ripple-container"></div></a>
  238 +</div>
  239 +
236 240 {% endfor %}
237 241  
238 242  
... ...
courses/templates/subject/index.html
... ... @@ -67,7 +67,9 @@
67 67 {% endfor %}
68 68  
69 69 {% if user|has_role:'system_admin' or topic.owner == user%}
70   - <a name="create_topic" class="btn btn-primary btn-md btn-block" href="{% url 'course:create_topic' subject.slug %}">{% trans "Create Topic" %}</a>
  70 + <div class="form-group">
  71 + <a href="{% url 'course:create_topic' subject.slug %}" data-toggle="modal" data-target="" class="btn btn-primary btn-lg btn-block btn-raised" name="create_topic">{% trans "Create Topic" %}<div class="ripple-container"></div></a>
  72 + </div>
71 73 {% endif %}
72 74  
73 75 {% endblock %}
... ...