Skip to content

Commit

Permalink
Merge pull request #66 from didita91/gmarin
Browse files Browse the repository at this point in the history
Gmarin
  • Loading branch information
didita91 committed May 2, 2015
2 parents 873ea68 + 84633a6 commit ca9ce0d
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 13 deletions.
3 changes: 2 additions & 1 deletion Proyecto/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
url(r'^configuracion/equipo&id=(?P<proyecto_id>\d+)/$', admin_equipo),
url(r'^configuracion/equipo&id=(?P<proyecto_id>\d+)/nuevo/$',add_miembro_equipo),
url(r'^configuracion/equipo&id=(?P<proyecto_id>\d+)/responsable&id=(?P<us_id>\d+)/$',responsable_us),

url(r'^configuracion&id=(?P<proyecto_id>\d+)/flujo&id=(?P<us_id>\d+)/$',asignar_flujoUS),
url(r'^configuracion&id=(?P<proyecto_id>\d+)/sprint/$',iniciarsprint)


)
Expand Down
43 changes: 42 additions & 1 deletion Proyecto/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,4 +1119,45 @@ def responsable_us(request, proyecto_id, us_id):
print i.usuario
dict[i.usuario.id] = False
form = RespUserStoryForm(1,initial = {'usuario': dict})
return render_to_response("conf/asignar_us.html", {'form':form,'proyecto':us.proyecto}, context_instance=RequestContext(request))
return render_to_response("conf/asignar_us.html", {'form':form,'proyecto':us.proyecto}, context_instance=RequestContext(request))

@login_required
def asignar_flujoUS(request, proyecto_id, us_id):
"""
Asigna flujos a user story
:param request:
:param proyecto_id:
:return:us_id
"""
user = User.objects.get(username=request.user.username)
p = get_object_or_404(Proyecto, id=proyecto_id)
permisos = get_permisos_sistema(user)
proyecto = Proyecto.objects.get(id=proyecto_id)
perm = get_permisos_proyecto(user,proyecto)
lista_flujos = Flujo.objects.filter(proyecto=proyecto_id)
us= UserStory.objects.get(id=us_id)
if request.method == 'POST':
form = UserStoryFlujoForm(1,request.POST)
if form.is_valid():

nuevo = flujoUS()
nuevo.flujo = form.cleaned_data['flujo']
nuevo.us= us
nuevo.save()
return HttpResponseRedirect("/configuracion&id=" + str(proyecto_id))

#flujoID= flujoUS();
#flujoID.flujo= lista_flujos.id
#flujoID.us=us
#flujoID.save()
else:
return render_to_response("conf/asignar_flujoaUS.html", {'form':form}, context_instance=RequestContext(request))
dict = {}
for i in lista_flujos:
print i.nombre
dict[i.proyecto] = False
form = UserStoryFlujoForm(1,initial = {'flujo': dict})
return render_to_response("conf/asignar_flujoaUS.html", {'form':form}, context_instance=RequestContext(request))

def iniciarsprint(request, proyecto_id):
return render_to_response("conf/sprint.html", context_instance=RequestContext(request))
13 changes: 12 additions & 1 deletion app/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,15 @@ def clean_usuario(self):
if(i.usuario == self.cleaned_data['usuario']):
print "jajajajaaj"
raise forms.ValidationError('Ya existe este usuario')
return self.cleaned_data['usuario']
return self.cleaned_data['usuario']

class UserStoryFlujoForm(forms.Form):
flujo = forms.ModelChoiceField(queryset = Flujo.objects.all())
proyecto = Proyecto()

def __init__(self, proyecto, *args, **kwargs):
super(UserStoryFlujoForm, self).__init__(*args, **kwargs)
def clean_flujo(self):
if 'flujo' in self.cleaned_data:
flujos_existentes = Flujo.objects.filter(id =self.proyecto.id)
return self.cleaned_data['flujo']
6 changes: 6 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,9 @@ class ResponsableUS(models.Model):
def __unicode__(self):
return unicode(self.usuario)

class flujoUS(models.Model):
flujo=models.ForeignKey(Flujo)
us = models.ForeignKey(UserStory)
def __unicode__(self):
return unicode(self.flujo)

7 changes: 3 additions & 4 deletions gdt_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
DEBUG = True
TEMPLATE_DEBUG = DEBUG
from unipath import Path

RUTA_PROYECTO= Path(__file__).ancestor(2)

PATH=RUTA_PROYECTO

ALLOWED_HOSTS = []

WSGI_APPLICATION = 'gdt_project.wsgi.application'
Expand Down Expand Up @@ -121,5 +121,4 @@



LOGIN_URL = '/login/'

LOGIN_URL = '/login/'
Empty file modified site_media/images/principal.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion templates/admin/proyectos/proyectos.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

<div class="col-sm-8">
<ul class="nav nav-list-tools">
<li class="nav-header-tools">Usuarios </li>
<li class="nav-header-tools">Proyecto </li>
<li class="alert alert-danger">
<form action="." method="POST">
{% csrf_token %}
Expand Down
26 changes: 26 additions & 0 deletions templates/conf/asignar_flujoaUS.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% extends "base.html" %}
{% block title %}Flujos{% endblock %}
{% block content %}

<center><h2><b> Asignar Flujo a User Story </b></h2></center><br>


{% if mensaje %}
<center><p>SE HA PRODUCIDO EL SIGUIENTE INCONVENIENTE:</p>
<p>{{mensaje}}</p></center>
{% else %}
<center><table class="abm">
<form id="form_id" action="." method="POST">
{% csrf_token %}
{{ form.as_p }}
<tr>
<td colspan="2" class="buttonlist">
<br><center><input type="submit" class= "btn btn-default" value="GUARDAR" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class= "btn btn-default" value="CANCELAR" onClick = "location.href='/principal' "/></center>
</td>
</tr>
</form>
</table></center>
{% endif %}

{% endblock%}
2 changes: 1 addition & 1 deletion templates/conf/asignar_us.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block title %}User Stories{% endblock %}
{% block content %}

<center><h2><b> Asginar Responsable de User Story </b></h2></center><br>
<center><h2><b> Asignar Responsable de User Story </b></h2></center><br>
holaa{{ proyecto.id }}

{% if mensaje %}
Expand Down
2 changes: 2 additions & 0 deletions templates/conf/config_inicial.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@

<td><font color="gray"><strong><em><u>{{i.nombre}}</u></em></strong></font></td>
<td><a class="btn btn-default btn-xs" href="/configuracion/equipo&id={{proyecto.id}}/responsable&id={{i.id }}/"><strong>RESPONSABLE</strong></a></td>
<td><a class="btn btn-default btn-xs" href="/configuracion&id={{proyecto.id}}/flujo&id={{i.id }}/"><strong>ASIGNAR FLUJO</strong></a></td>
</tr>
{% endfor %}
</tbody>
</table>
<center><a class="btn btn-default" href="/configuracion&id={{proyecto.id}}/sprint/"><strong>INICIAR SPRINT</strong></a></td></center>
</form>
</li>
</ul>
Expand Down
98 changes: 98 additions & 0 deletions templates/conf/sprint.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{% extends "base.html" %}
{% block title %}Proyectos{% endblock %}
{% block content %}

<style type="text/css">
.alert-danger {
background: rgba(196,196,196,1);
background: -moz-linear-gradient(left, rgba(196,196,196,1) 0%, rgba(191,191,191,1) 0%, rgba(181,181,181,1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(196,196,196,1)), color-stop(0%, rgba(191,191,191,1)), color-stop(100%, rgba(181,181,181,1)));
background: -webkit-linear-gradient(left, rgba(196,196,196,1) 0%, rgba(191,191,191,1) 0%, rgba(181,181,181,1) 100%);
background: -o-linear-gradient(left, rgba(196,196,196,1) 0%, rgba(191,191,191,1) 0%, rgba(181,181,181,1) 100%);
background: -ms-linear-gradient(left, rgba(196,196,196,1) 0%, rgba(191,191,191,1) 0%, rgba(181,181,181,1) 100%);
background: linear-gradient(to right, rgba(196,196,196,1) 0%, rgba(191,191,191,1) 0%, rgba(181,181,181,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c4c4c4', endColorstr='#b5b5b5', GradientType=1 );
border-color: #808080;
border-radius: 0px 0px 10px 0px;

display: block;
font-size: 15px;
font-weight: bold;
color: white;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
margin-left: -5px;

}


.nav-list-tools>li.nav-header-tools {
background-color: #8B0000;
background-position: 8px 5px !important;
color: #FFF;
-webkit-border-radius: 10px 0px 0px;
-moz-border-radius: 10px 0px 0px;
border-radius: 10px 0px 0px ;
padding-top: 15px;
padding-bottom: 15px;
/* padding-left: 40px; */
display: block;
padding: 8px 15px;
font-size: 18px;
font-weight: bold;
line-height: 18px;
color: white;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
text-transform: uppercase;
margin-left: -5px;


}

.btn-default{
font-weight: bold;

}

select{
color: black;
}

</style>


<ol class="breadcrumb">
<li><a class="text-danger" href="/principal"><strong>PÁGINA PRINCIPAL</strong></a></li>
<li class="active"><strong>ADMINISTRACIÓN DE PROYECTOS</strong></li>
</ol>
<center><h2 class="text-danger"><strong> ADMINISTRACIÓN DE SPRINT </strong></h2></center><br><br>


<div class="row">


<div class="col-sm-3">
<ul class="nav nav-list-tools">
<li class="nav-header-tools">Barra de Herramientas</li>
<li class="alert alert-danger">
<a class="btn btn-default" href="/principal"><strong> VOLVER A LA PÁGINA PRINCIPAL</strong> </a>&nbsp;&nbsp;
</li>
</ul>
</div>

<div class="col-sm-8">
<ul class="nav nav-list-tools">
<li class="nav-header-tools">Sprint 1 </li>
<li class="alert alert-danger">
<form action="." method="POST">

<img src="/site_media/images/construccion.png">

</table>
</form>
</li>
</ul>
</div>
</div>
<br><br>

{% endblock %}
17 changes: 13 additions & 4 deletions templates/main_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,29 @@ <h3 class="text-danger"><strong> ADMINISTRACIÓN DEL SISTEMA </strong></h3>
<li class="nav-header-tools">Administración</li>
<li class="alert alert-danger">
{% if user.id == 1 %}
<a type="button" class="btn btn-default btn-lg btn-block" onClick ="location.href='/usuarios/'"><strong>U S U A R I O S</strong></a>
<a type="button" class="btn btn-default btn-lg btn-block" onClick ="location.href='/usuarios/'">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
<strong>U S U A R I O S</strong></a>
{% endif %}

{% if roles %}
<a type="button" class="btn btn-default btn-lg btn-block" onClick ="location.href='/roles/'"><strong>R O L E S</strong></a>
<a type="button" class="btn btn-default btn-lg btn-block" onClick ="location.href='/roles/'">
<span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
<strong>R O L E S</strong></a>
{% endif %}


{% if proyectos %}
<a type="button" class="btn btn-default btn-lg btn-block" onClick ="location.href='/proyectos/'"><strong>P R O Y E C T O S</strong></a>
<a type="button" class="btn btn-default btn-lg btn-block" onClick ="location.href='/proyectos/'">
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
<strong>P R O Y E C T O S</strong></a>
{% endif %}

{% if flujos %}
<a type="button" class="btn btn-default btn-lg btn-block" onClick ="location.href='/flujos/'"><strong>F L U J O S</strong></a>
<a type="button" class="btn btn-default btn-lg btn-block" onClick ="location.href='/flujos/'">
<span class="glyphicon glyphicon-indent-left" aria-hidden="true"></span>

<strong>F L U J O S</strong></a>
{% endif %}
</li>
</ul>
Expand Down

0 comments on commit ca9ce0d

Please sign in to comment.