diff options
Diffstat (limited to 'static/website/templates')
-rw-r--r-- | static/website/templates/index.html | 4 | ||||
-rw-r--r-- | static/website/templates/new-question.html | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/static/website/templates/index.html b/static/website/templates/index.html index fcdf8cb..f7c3f37 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -22,7 +22,9 @@ {{ category }} </small> {% latest_question category %} - <a class="btn btn-xs btn-block btn-success" href="{% url 'website:new_question' %}?category={{ category|urlencode }}">Ask new question</a> + + + <a class="btn btn-xs btn-block btn-success" href="{% url 'website:new_question' %}?category={{ category.id|urlencode }}">Ask new question</a> </div> </div> </div> diff --git a/static/website/templates/new-question.html b/static/website/templates/new-question.html index 85900f7..ed2c541 100644 --- a/static/website/templates/new-question.html +++ b/static/website/templates/new-question.html @@ -18,6 +18,7 @@ <div class="col-lg-3 col-md-3 col-sm-3"> {% render_field form.category class+="form-control category"%} </div> + <!--<div class="col-lg-3 col-md-3 col-sm-3"> {% if category %} {% render_field form.tutorial class+="form-control" %} @@ -79,6 +80,19 @@ bkLib.onDomLoaded(function() { }).panelInstance('id_body'); }); </script> + +<script> + + window.onload = function() { + /* your code */ + var c2= "{{ category }}"; + + $("#id_category").val(c2); + +} + +</script> + {% endblock %} {% block javascript %} |