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

responsive

parent 3e432bc2
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}AskIng{% endblock %}</title> <title>{% block title %}AskIng{% endblock %}</title>
{% block stylesheets %} {% block stylesheets %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
......
...@@ -2,24 +2,30 @@ ...@@ -2,24 +2,30 @@
{% block body %} {% block body %}
<center><h1>Evento {{ event.name }}</h1></center> <center><h1>Evento {{ event.name }}</h1></center>
{% if event.open or is_granted(['ROLE_PROFESSOR']) %}
<div id="questions"> <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>
</div> </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 %} {% endblock %}
{% block javascripts %} {% block javascripts %}
{{ parent() }} {{ parent() }}
<script type="text/javascript"> <script type="text/javascript">
{% if event.open or is_granted(['ROLE_PROFESSOR']) %}
window.onload = function() { window.onload = function() {
updateQuestions(); updateQuestions();
...@@ -32,7 +38,6 @@ ...@@ -32,7 +38,6 @@
function checkQuestionLength() function checkQuestionLength()
{ {
$('#new_question').val($.trim($('#new_question').val()));
var question = $('#new_question').val(); var question = $('#new_question').val();
if(question.length < 9) if(question.length < 9)
...@@ -61,11 +66,13 @@ ...@@ -61,11 +66,13 @@
'<div class="inline-ble">'+ '<div class="inline-ble">'+
'<div class="date-asked left-col"><small>'+value[4]+'</small></div>'+ '<div class="date-asked left-col"><small>'+value[4]+'</small></div>'+
'<div class="buttons right-col">'; '<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>'; 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 %} {% 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>'+ {% if event.open %}
'</div>'+ 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>'+ '</div>'+
'<h5>'+value[3]+'</h5>'+ '<h5>'+value[3]+'</h5>'+
'</div>' '</div>'
...@@ -89,13 +96,13 @@ ...@@ -89,13 +96,13 @@
{ {
$('#new_question').val($.trim($('#new_question').val())); $('#new_question').val($.trim($('#new_question').val()));
var question = $('#new_question').val(); var question = $('#new_question').val();
$('#new_question').val(null);
if(question.length < 9) if(question.length < 9)
{ {
checkQuestionLength(); checkQuestionLength();
return; return;
} }
$('#new_question').val(null);
$.post("{{ path('question_ask', { 'id': event.id }) }}", $.post("{{ path('question_ask', { 'id': event.id }) }}",
{question: question}, {question: question},
...@@ -140,7 +147,7 @@ ...@@ -140,7 +147,7 @@
}) })
.appendTo( $wrapper ); .appendTo( $wrapper );
} }
{% endif %}
</script> </script>
{% endblock %} {% 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