diff options
author | Sanmugasundaram K | 2015-05-07 15:24:25 +0530 |
---|---|---|
committer | Sanmugasundaram K | 2015-05-07 15:24:25 +0530 |
commit | 30d80e37ee5604196f465c2b2c73b1d1a4f11f79 (patch) | |
tree | fc4f4d803fd177fb17927cd94d6ffd08f46e38fe /static/website/templates | |
parent | 8f29c847f23aef4b21a803766064d59289603196 (diff) | |
download | spoken-tutorial-forums-30d80e37ee5604196f465c2b2c73b1d1a4f11f79.tar.gz spoken-tutorial-forums-30d80e37ee5604196f465c2b2c73b1d1a4f11f79.tar.bz2 spoken-tutorial-forums-30d80e37ee5604196f465c2b2c73b1d1a4f11f79.zip |
question delete, hide, show feature
Diffstat (limited to 'static/website/templates')
-rw-r--r-- | static/website/templates/base.html | 9 | ||||
-rw-r--r-- | static/website/templates/get-question.html | 35 | ||||
-rw-r--r-- | static/website/templates/search.html | 4 |
3 files changed, 43 insertions, 5 deletions
diff --git a/static/website/templates/base.html b/static/website/templates/base.html index 86ca41a..506cf24 100644 --- a/static/website/templates/base.html +++ b/static/website/templates/base.html @@ -1,5 +1,6 @@ {% load compress %} {% load static %} +{% load permission_tags %} <html> <head> <title> @@ -37,6 +38,14 @@ <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> + {% if user|isadministrator %} + <li> + <a href="{% url 'website:hidden_questions' %}"> + <span class="glyphicon glyphicon-eye-close"></span> + Hidden Questions + </a> + </li> + {% endif %} <li> <a href="{% url 'website:search' %}"> <span class="glyphicon glyphicon-search"></span> diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html index 2983412..cce6469 100644 --- a/static/website/templates/get-question.html +++ b/static/website/templates/get-question.html @@ -7,10 +7,11 @@ {% block title %} {{ question.category }} - {{ question.title }} - Spoken Tutorial Forums {% endblock %} - {% block content %} <span class="saving hideme">saving . . .</span> <span class="saved hideme">saved</span> +<span class="deleted hideme">{{ question.title }} has been deleted.</span> +<span class="hide-qmsg hideme">{{ question.title }} has been {% if question.status == 1 %} hidden {% else %} Shown {% endif %}.</span> <div class="row"> <div class="question-wrapper col-lg-12 col-md-12 col-sm-12 col-xs-12"> @@ -67,13 +68,42 @@ <span class="glyphicon glyphicon-edit"></span> </a> - <span class="modify"> + <span class="modify question-midify"> {% if user|can_edit:question %} + <a class="hide-question btn btn-xs btn-info" data-qid="{{ question.id }}" data-status="{{ question.status }} href="#">{% if question.status == 1 %} Hide {% else %} Show {% endif %}</a> + <a class="delete-question btn btn-xs btn-info" data-qid="{{ question.id }}" href="#">Delete</a> <a class="edit btn btn-xs btn-info" href="#">Edit</a> <a class="save btn btn-xs btn-success" data-qid="{{ question.id }}" href="#">Save</a> {% endif %} </span> + + <div id="confirm-delete" class="modal fade"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-body"> + Are you sure want to delete this question? + </div> + <div class="modal-footer"> + <button type="button" data-dismiss="modal" class="btn btn-primary btn-sm" id="delete">Delete</button> + <button type="button" data-dismiss="modal" class="btn btn-primary btn-sm">Cancel</button> + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> + </div><!-- /.modal --> + <div id="confirm-hide" class="modal fade"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-body"> + Are you sure want to {% if question.status %} Hide {% else %} Show {% endif %} this question? + </div> + <div class="modal-footer"> + <button type="button" data-dismiss="modal" class="btn btn-primary btn-sm" id="chide">Yes</button> + <button type="button" data-dismiss="modal" class="btn btn-primary btn-sm">Cancel</button> + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> + </div><!-- /.modal --> <span class="meta"> <small> <i> @@ -320,7 +350,6 @@ }); </script> {% endblock %} - {% block javascript %} <script src="{% static 'website/js/thread-user.js' %}"></script> <script src="{% static 'website/js/custom.js' %}"></script> diff --git a/static/website/templates/search.html b/static/website/templates/search.html index 3ffc871..a2dc483 100644 --- a/static/website/templates/search.html +++ b/static/website/templates/search.html @@ -45,13 +45,13 @@ <div class="col-lg-2 col-md-2 col-sm-2"> <select id="search-minute-range" class="form-control" disabled="disabled"> - <option value="None">min</option> + <option value="">min</option> </select> </div> <div class="col-lg-2 col-md-2 col-sm-2"> <select id="search-second-range" class="form-control" disabled="disabled"> - <option value="None">sec</option> + <option value="">sec</option> </select> </div> |