diff options
Diffstat (limited to 'askbot/skins/default/templates/embed/ask_by_widget.html')
-rw-r--r-- | askbot/skins/default/templates/embed/ask_by_widget.html | 95 |
1 files changed, 80 insertions, 15 deletions
diff --git a/askbot/skins/default/templates/embed/ask_by_widget.html b/askbot/skins/default/templates/embed/ask_by_widget.html index dddb4aa6..8b5fc5e2 100644 --- a/askbot/skins/default/templates/embed/ask_by_widget.html +++ b/askbot/skins/default/templates/embed/ask_by_widget.html @@ -27,20 +27,50 @@ margin-bottom: 10px; } - .related-questions{ - margin-bottom: 10px; + #question-list { + height: auto; + } + + #question-list h2{ + text-decoration: none; + margin: 0px; + font-size: 13px; + color: #005580; + padding: 3px 0 3px 5px; + margin-left: 15px; + padding-bottom: 0; + border-top: #F0F0EC 1px solid; + border-left: #F0F0EC 1px solid; + min-height: 30px; + line-height: 30px; + font-weight: normal } - .related-questions p, a{ - font-size: 110%; - margin:0; + #question-list a:hover{ + color: #005580; + text-decoration: underline; } - .related-questions a{ + #question-list a:visited{ + color: #005580; text-decoration: none; - font-size: 80%; - color: #000; - margin-left: 15px; + } + + #question-list span{ + width: 28px; + height: 26px; + line-height: 26px; + text-align: center; + margin-right: 10px; + float: left; + display: block; + color: white; + background: #B8D0D5; + border-radius: 3px; + -ms-border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -khtml-border-radius: 3px; } {{widget.inner_style}} </style> @@ -51,13 +81,9 @@ <form action="." method="POST" accept-charset="utf-8"> {% csrf_token %} <label>{%trans%}Please enter a descriptive title for your question{%endtrans%}</label> - {{form.title}} + <input autocomplete="off" id="id_title" type="text" name="title" size="70" class='questionTitleInput'> {% if related_questions %} - <div class='related-questions'> - <p>{%trans%}Related questions: {%endtrans%} - {%for question in related_questions %} - <div class='question'><a href="{{question.get_absolute_url()}}">{{question.title}}</a></div> - {%endfor%} + <div id='question-list'> </div> {%endif%} {{form.text}} @@ -69,5 +95,44 @@ {{form.errors}} {%endblock%} {% block endjs %} + <script type='text/javascript' src='{{"/js/live_search_new_thread.js"|media}}'></script> + <script type="text/javascript" charset="utf-8"> + var minSearchWordLength = {{settings.MIN_SEARCH_WORD_LENGTH}}; + askbot['urls']['api_get_questions'] = '{% url api_get_questions %}'; + liveSearchNewThreadInit(); +/* + var createRelatedDOM = function(data){ + element = $('<div></div>'); + element.attr({class:"question"}); + link = $("<a></a>"); + //link.attr({href:}) + link.text(data.title); + element.append(link); + $('.related-questions').append(element); + }; + + $(document).ready(function(){ + $('.related-questions').hide(); + $("#id_title").change(function(){ + data = {query: this.value, _: new Date().getTime()}; + console.log(data); + $.getJSON("{% url api_get_questions %}", data, function(data){ + + console.log('entro'); + if (data.length != 0){ + $('.related-questions').show(); + } else{ + $('.related-questions').hide(); + } + + $.each(data, function(key, value){ + createRelatedDOM(value); + }); + }); + }); + + }); + */ + </script> {% endblock %} |