Skip to content

Commit

Permalink
Merge pull request #11 from AthenaCES29/ftuyama_branch
Browse files Browse the repository at this point in the history
Criação FrontEnd e BD das restrições de submissão
  • Loading branch information
ftuyama committed May 22, 2016
2 parents a6100f3 + 63f3af6 commit d995e56
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 100 deletions.
21 changes: 21 additions & 0 deletions Athena/migrations/0004_atividade_restricoes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-22 14:43
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('Athena', '0003_auto_20160508_0121'),
]

operations = [
migrations.AddField(
model_name='atividade',
name='restricoes',
field=models.CharField(default=1, max_length=1000),
preserve_default=False,
),
]
3 changes: 3 additions & 0 deletions Athena/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def prof_json_data(self):
descricao = models.CharField(
max_length=1000,
)
restricoes = models.CharField(
max_length=1000,
)
arquivo_roteiro = models.FileField(upload_to=atividade_path)
arquivo_entrada = models.FileField(upload_to=atividade_path)
arquivo_saida = models.FileField(upload_to=atividade_path)
Expand Down
2 changes: 1 addition & 1 deletion Cerberus/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import uuid
import re


class UserRegistrationForm(UserCreationForm):
travis1 = "Esse valor deve conter apenas letras"
travis2 = ", números e os caracteres @/./+/-/_."
Expand Down Expand Up @@ -153,6 +152,7 @@ def AtividadeRegistration(request):
arquivo_roteiro=request.FILES[prefixo + 'arquivo_roteiro'],
arquivo_entrada=request.FILES[prefixo + 'arquivo_entrada'],
arquivo_saida=request.FILES[prefixo + 'arquivo_saida'],
restricoes=request.POST['restricoes'],
turma=turma,
)
atividade.save()
Expand Down
22 changes: 15 additions & 7 deletions Promachos/templates/aluno_ativ.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
cursor: pointer;
}
.thumbnail_work {
height: 310px;
text-align: center;
height: 350px;
text-align: left;
}
.tab-pane {
padding-top: 20px;
Expand All @@ -59,6 +59,8 @@
</style>
</head>
<body>
<link rel="stylesheet" href="/static/css/bootstrap-tagsinput.css" />
<script src="/static/js/bootstrap-tagsinput.min.js"></script>
<div class="container-fluid">
<div class="row">
<div class="col-xs-6">
Expand Down Expand Up @@ -89,20 +91,23 @@
<p><h2> {{ atividade.nome }} </h2></p>
<p><h4>{{atividade.turma.nome}} - Prof. {{atividade.turma.professor.nome}} </h4></p>
{% if atividade.estaFechada %}
<h4>Status: fechada (em {{atividade.data_limite}})</h4>
<h4 style="color:red">Status: fechada (em {{atividade.data_limite}})</h4>
{% else %}
<h5>Status: aberta (até {{atividade.data_limite}})</h5>
<h4 style="color:green">Status: aberta (até {{atividade.data_limite}})</h5>
{% endif %}
</div>
<div class="row">
<div class="col-xs-12 col-sm-4">
<div class="thumbnail thumbnail_work">
<div class="caption">
<div class="form-group">
<h4><b>Submissão:</b></h4>
<h4 align="center"><b>Submissão:</b></h4>
<hr>
<p><b>Descrição: </b>{{ atividade.descricao }}</p>
<p><b>Atividade:</b> <a href="{{ atividade.arquivo_roteiro.url }}" target="_blank">{{ atividade.nome_roteiro }}</a></p>
<p><b>Restrições: </b>
<input type="text" value={{atividade.restricoes}} data-role="tagsinput"/>
</p>
</div>
{% if prazo_valido %}
<form method="POST" enctype="multipart/form-data">
Expand All @@ -111,7 +116,7 @@ <h4><b>Submissão:</b></h4>
<label for>Enviar solução:</label>
<input id="id_arquivo_codigo" name="arquivo_codigo" required="True" type="file">
</div>
<div class="form-group">
<div class="form-group" align="center">
<button class="btn btn-primary" type="submit" value="Submit"><span class="glyphicon glyphicon-open"></span> Submit</button>
</div>
</form>
Expand All @@ -124,6 +129,8 @@ <h4><b>Submissão:</b></h4>
<div class="col-xs-12 col-sm-3">
<div class="thumbnail thumbnail_work">
<div class="caption" >
<h4 align="center"><b>Status:</b></h4>
<hr>
{% if submissao and relAlunoAtividade %}
{% if relAlunoAtividade.foiEntregue %}
<div class="form-group">
Expand All @@ -142,7 +149,8 @@ <h4><b>Status de Submissão:</b></h4>
<div class="thumbnail thumbnail_work">
<div class="caption">
<div class="form-group">
<h4><b>Erros:</b> {{ compilation_error|safe }}</h4>
<h4 align="center"><b>Erros:</b> {{ compilation_error|safe }}</h4>
<hr>
<!-- TABELA COMECA AQUI!!! -->
<table class="table">
<tr>
Expand Down
8 changes: 8 additions & 0 deletions Promachos/templates/pane_professor.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<link rel="stylesheet" href="/static/css/bootstrap-tagsinput.css" />
<script src="/static/js/bootstrap-tagsinput.min.js"></script>
</style>
<div role="tabpanel" class="tab-pane fade" id={{turma.id}}>
<div class="row content">
<div class="col-xs-12 col-md-3">
Expand Down Expand Up @@ -37,6 +40,11 @@ <h3 align="center">Abrir nova atividade</h3>
{{field}}
</div>
{% endfor %}
<div class="form-group">
<div align="left"><label>Restrições</label></div>
<input type="text" name="restricoes" class="form-control"
value="goto" data-role="tagsinput" id="restricoes"/>
</div>
<p><button class="btn btn-lg btn-success btn-block" type="submit">Criar</button></p>
</form>
<br>
Expand Down
7 changes: 7 additions & 0 deletions Promachos/templates/prof_ativ.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
</script>
</head>
<body>
<link rel="stylesheet" href="/static/css/bootstrap-tagsinput.css" />
<script src="/static/js/bootstrap-tagsinput.min.js"></script>
<div class="container-fluid">
<div class="row">
<div class="col-xs-6">
Expand All @@ -79,6 +81,11 @@
{{field}}
</div>
{% endfor %}
<div class="form-group">
<div align="left"><label>Restrições</label></div>
<input type="text" name="restricoes" class="form-control"
value={{atividade.restricoes}} data-role="tagsinput" id="restricoes"/>
</div>
<p><button class="btn btn-lg btn-success btn-block" type="submit">Concluir</button></p>
</form>
<br>
Expand Down
182 changes: 90 additions & 92 deletions Promachos/templates/professor.html
Original file line number Diff line number Diff line change
@@ -1,108 +1,106 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Athena | Professor</title>
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
$(document).ready(function() {
$('input').filter('.date_picker').datepicker({dateFormat: 'yy-mm-dd'});
});
</script>
<script src="/static/js/bootstrap.min.js"></script>
<style type="text/css">
* {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Athena | Professor</title>
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
$(document).ready(function() {
$('input').filter('.date_picker').datepicker({dateFormat: 'yy-mm-dd'});
});
</script>
<script src="/static/js/bootstrap.min.js"></script>
<style type="text/css">
* {
margin: 0;
padding: 0;
}

.content {
}
.content {
padding-top: 20px;
}

.thumbnail_ws h3,p {
}
.thumbnail_ws h3,p {
text-align: center;
}

input {
}
input {
width: 100%;
}

textarea {
}
textarea {
width: 100%;
height: 5em;
resize: none;
}

#ano {
}
#ano {
width: 4em;
}
</style>
</head>

<body>
<div class="container-fluid">
<div class="row">
<div class="col-xs-6">
<img src="/static/img/ita_logo.jpg" style="height: 50px;">
</div>
<div class="col-xs-6" style="text-align: right;">
<p style="line-height: 40px;"><a href="/logout/" class="btn btn-danger" role="button"><span class="glyphicon glyphicon-off"></span> Log Out</a></p>
</div>
</div>
<div class="row">
<div class="col-xs-12">
&nbsp;
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#workspace" aria-controls="workspace" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-home"></span> Workspace</a>
</li>
{% for turma in turmas %}
<li role="presentation">
<a href=#{{turma.id}} aria-controls={{turma.id}} role="tab" data-toggle="tab">{{turma.nome}}</a>
</li>
{% endfor %}
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="workspace">
<div class="row content">
<div class="col-xs-12 col-md-3">
<div class="thumbnail thumbnail_ws">
<div class="caption">
<p><h3>Abrir nova turma</h3></p>
<br>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="post_turma" value="True">
{% csrf_token %}
{{form}}
<p><button class="btn btn-lg btn-success btn-block" type="submit">Concluir</button></p>
</form>
</div>
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-xs-6">
<img src="/static/img/ita_logo.jpg" style="height: 50px;">
</div>
<div class="col-xs-6" style="text-align: right;">
<p style="line-height: 40px;"><a href="/logout/" class="btn btn-danger" role="button"><span class="glyphicon glyphicon-off"></span> Log Out</a></p>
</div>
</div>
<div class="row">
<div class="col-xs-12">
&nbsp;
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#workspace" aria-controls="workspace" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-home"></span> Workspace</a>
</li>
{% for turma in turmas %}
<li role="presentation">
<a href=#{{turma.id}} aria-controls={{turma.id}} role="tab" data-toggle="tab">{{turma.nome}}</a>
</li>
{% endfor %}
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="workspace">
<div class="row content">
<div class="col-xs-12 col-md-3">
<div class="thumbnail thumbnail_ws">
<div class="caption">
<p>
<h3>Abrir nova turma</h3>
</p>
<br>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="post_turma" value="True">
{% csrf_token %}
{{form}}
<p><button class="btn btn-lg btn-success btn-block" type="submit">Concluir</button></p>
</form>
</div>
</div>
</div>
</div>
<!-- end of row -->
</div>
</div> <!-- end of row -->
</div> <!-- end of workspace tab -->
<!-- pane aqui -->
{% for pane in panes %}
{{pane |safe}}
{% endfor %}
<!-- end of workspace tab -->
<!-- pane aqui -->
{% for pane in panes %}
{{pane |safe}}
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
</body>
</html>
1 change: 1 addition & 0 deletions arquivos/atividades/1/8/LabMaisSugaDeTodos/entrada
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2 3
1 change: 1 addition & 0 deletions arquivos/atividades/1/8/LabMaisSugaDeTodos/roteiro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
roteiro da atividade
1 change: 1 addition & 0 deletions arquivos/atividades/1/8/LabMaisSugaDeTodos/saida
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2 3
Loading

0 comments on commit d995e56

Please sign in to comment.