Commit 5dd3299c83724bc30c0e2799aa6bc51c2c86f3fd
1 parent
f1e1b1d3
Exists in
master
and in
3 other branches
create category button is 100% functional and create form is handling errors and restrictions
Showing
4 changed files
with
31 additions
and
7 deletions
Show diff stats
amadeus/static/css/base/amadeus.css
... | ... | @@ -39,6 +39,16 @@ |
39 | 39 | margin-left: 2%; |
40 | 40 | } |
41 | 41 | |
42 | +#create-category{ | |
43 | + margin-left: 40%; | |
44 | + margin-bottom: 1%; | |
45 | + border: none; | |
46 | + background-color: #66BB6A; | |
47 | + color: #FFFFFF; | |
48 | + width: 200px; | |
49 | + height: 40px; | |
50 | + font-size: 15px; | |
51 | +} | |
42 | 52 | |
43 | 53 | /* category app ends */ |
44 | 54 | ... | ... |
amadeus/templates/base.html
... | ... | @@ -108,7 +108,7 @@ |
108 | 108 | <a href="" data-toggle="dropdown"><i class="fa fa-cog" aria-hidden="true"></i></a> |
109 | 109 | <ul class="dropdown-menu pull-right"> |
110 | 110 | <li><a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> |
111 | - <li><a href="#">{% trans 'Manage Courses' %}</a></li> | |
111 | + <li><a href="{% url 'categories:index' %}">{% trans 'Manage Courses' %}</a></li> | |
112 | 112 | </ul> |
113 | 113 | </li> |
114 | 114 | <li title data-original-title="{% trans 'account' %}"> | ... | ... |
categories/templates/categories/create.html
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 | </div> |
48 | 48 | {% endfor %} |
49 | 49 | <div class="row text-center"> |
50 | - <input type="submit" value="{% trans 'Create' %}" class="btn btn-primary btn-raised" /> | |
50 | + <input type="submit" value="{% trans 'Register' %}" class="btn btn-primary btn-raised" /> | |
51 | 51 | </div> |
52 | 52 | </form> |
53 | 53 | </div> | ... | ... |
categories/templates/categories/list.html
... | ... | @@ -23,6 +23,7 @@ |
23 | 23 | {% endfor %} |
24 | 24 | {% endif %} |
25 | 25 | |
26 | +<a href="{% url 'categories:create' %}"><button id="create-category"> {% trans "Create Category" %}</button></a> | |
26 | 27 | |
27 | 28 | <!-- Code for listing categories --> |
28 | 29 | <div class="col-md-12 cards-content"> |
... | ... | @@ -36,13 +37,26 @@ |
36 | 37 | <a class="category-course-link" data-toggle="collapse" href="#{{category.slug}}">{{category.name}}</a> |
37 | 38 | </h4> |
38 | 39 | |
39 | - | |
40 | - <a href=""><i class="fa fa-list" aria-hidden="true"></i></a> | |
41 | - <a href=""><i class="fa fa-envelope-o" aria-hidden="true"></i></a> | |
40 | + {% if user|has_role:'sys_admin' %} | |
41 | + <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | |
42 | + <li><a href="#"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i>{% trans 'Replicate' %}</a></li> | |
43 | + <li><a href="#"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i>{% trans 'Edit' %}</a></li> | |
44 | + <li><a href="#"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> | |
45 | + </ul> | |
46 | + | |
47 | + {% endif %} | |
42 | 48 | |
43 | - <a href=""><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></a> | |
49 | + {% if user|has_role:'student' %} | |
50 | + <a href=""><i class="fa fa-list" aria-hidden="true"></i></a> | |
51 | + <a href=""><i class="fa fa-envelope-o" aria-hidden="true"></i></a> | |
44 | 52 | |
45 | - <a href=""><i class="fa fa-bar-chart" aria-hidden="true"></i></a> | |
53 | + <a href=""><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></a> | |
54 | + | |
55 | + <a href=""><i class="fa fa-bar-chart" aria-hidden="true"></i></a> | |
56 | + {% endif %} | |
57 | + | |
58 | + | |
59 | + | |
46 | 60 | </div> |
47 | 61 | </div> |
48 | 62 | </div> | ... | ... |