Commit 810b75fe authored by ericksho-ipre's avatar ericksho-ipre

responsive

parent 3e432bc2
......@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}AskIng{% endblock %}</title>
{% block stylesheets %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
......
......@@ -2,24 +2,30 @@
{% block body %}
<center><h1>Evento {{ event.name }}</h1></center>
<div id="questions">
</div>
<form>
<div class="form-group">
<label for="exampleInputEmail1">Nueva pregunta</label>
<textarea class="form-control" rows="3" onkeypress="checkQuestionLength()" id="new_question"></textarea>
<div id="question-alert"><kbd> La pregunta debe tener al menos 10 caracteres</kbd></div>
{% if event.open or is_granted(['ROLE_PROFESSOR']) %}
<div id="questions">
</div>
<input type="button" class="btn btn-primary" disabled id="preguntar" value="Preguntar" onclick="submitQuestion()">
</form>
{% if event.open %}
<form>
<div class="form-group">
<label for="exampleInputEmail1">Nueva pregunta</label>
<textarea class="form-control" rows="3" onkeypress="checkQuestionLength()" id="new_question"></textarea>
<div id="question-alert"><kbd> La pregunta debe tener al menos 10 caracteres</kbd></div>
</div>
<input type="button" class="btn btn-primary" disabled id="preguntar" value="Preguntar" onclick="submitQuestion()">
</form>
{% endif %}
{% else %}
<center><h3>Este evento está cerrado.</h3></center>
{% endif %}
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript">
{% if event.open or is_granted(['ROLE_PROFESSOR']) %}
window.onload = function() {
updateQuestions();
......@@ -32,7 +38,6 @@
function checkQuestionLength()
{
$('#new_question').val($.trim($('#new_question').val()));
var question = $('#new_question').val();
if(question.length < 9)
......@@ -61,11 +66,13 @@
'<div class="inline-ble">'+
'<div class="date-asked left-col"><small>'+value[4]+'</small></div>'+
'<div class="buttons right-col">';
{% if is_granted('ROLE_PROFESSOR') %}
{% if is_granted('ROLE_ADMIN') %}
newQuestion += '<a class="btn btn-xs btn-default likes-button" target="_blank" href="/question/'+index+'" role="button"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></a>';
{% endif %}
newQuestion += '<button type="button" class="btn btn-default btn-xs likes-button" qid="'+index+'" onclick="upvote(this)"><div class="n-lovers">'+value[0]+'</div><span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span></button>'+
'</div>'+
{% if event.open %}
newQuestion += '<button type="button" class="btn btn-default btn-xs likes-button" qid="'+index+'" onclick="upvote(this)"><div class="n-lovers">'+value[0]+'</div><span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span></button>';
{% endif %}
newQuestion += '</div>'+
'</div>'+
'<h5>'+value[3]+'</h5>'+
'</div>'
......@@ -89,13 +96,13 @@
{
$('#new_question').val($.trim($('#new_question').val()));
var question = $('#new_question').val();
$('#new_question').val(null);
if(question.length < 9)
{
checkQuestionLength();
return;
}
$('#new_question').val(null);
$.post("{{ path('question_ask', { 'id': event.id }) }}",
{question: question},
......@@ -140,7 +147,7 @@
})
.appendTo( $wrapper );
}
{% endif %}
</script>
{% endblock %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment