Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
manhattan
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
InnovacionDocente
manhattan
Commits
e3877f30
Commit
e3877f30
authored
Jun 07, 2019
by
Enrique Matías Sánchez (Quique)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enh Anualizar el listado de proyectos del usuario
parent
691cc511
Pipeline
#368
passed with stage
in 7 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
10 deletions
+21
-10
urls.py
indo/urls.py
+5
-1
views.py
indo/views.py
+7
-3
settings-sample.py
manhattan_project/settings-sample.py
+3
-1
base.html
templates/base.html
+4
-3
detail.html
templates/proyecto/detail.html
+1
-1
new.html
templates/proyecto/new.html
+1
-1
No files found.
indo/urls.py
View file @
e3877f30
...
...
@@ -58,7 +58,11 @@ urlpatterns = [
ProyectoPresentarView
.
as_view
(),
name
=
"proyecto_presentar"
,
),
path
(
"proyecto/"
,
ProyectosUsuarioView
.
as_view
(),
name
=
"proyectos_usuario_list"
),
path
(
"proyecto/mis-proyectos/<int:anyo>"
,
ProyectosUsuarioView
.
as_view
(),
name
=
"mis_proyectos"
,
),
]
if
settings
.
DEBUG
:
...
...
indo/views.py
View file @
e3877f30
...
...
@@ -136,7 +136,7 @@ class ParticipanteAceptarView(LoginRequiredMixin, RedirectView):
"""Aceptar la invitación a participar en un proyecto."""
def
get_redirect_url
(
self
,
*
args
,
**
kwargs
):
return
reverse_lazy
(
"
proyectos_usuario_list"
)
return
reverse_lazy
(
"
mis_proyectos"
,
kwargs
=
{
"anyo"
:
date
.
today
()
.
year
}
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
usuario_actual
=
self
.
request
.
user
...
...
@@ -177,7 +177,7 @@ class ParticipanteDeclinarView(LoginRequiredMixin, RedirectView):
"""Declinar la invitación a participar en un proyecto."""
def
get_redirect_url
(
self
,
*
args
,
**
kwargs
):
return
reverse_lazy
(
"
proyectos_usuario_list"
)
return
reverse_lazy
(
"
mis_proyectos"
,
kwargs
=
{
"anyo"
:
date
.
today
()
.
year
}
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
proyecto_id
=
request
.
POST
.
get
(
"proyecto_id"
)
...
...
@@ -203,7 +203,7 @@ class ParticipanteRenunciarView(LoginRequiredMixin, RedirectView):
"""Renunciar a participar en un proyecto."""
def
get_redirect_url
(
self
,
*
args
,
**
kwargs
):
return
reverse_lazy
(
"
proyectos_usuario_list"
)
return
reverse_lazy
(
"
mis_proyectos"
,
kwargs
=
{
"anyo"
:
date
.
today
()
.
year
}
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
proyecto_id
=
request
.
POST
.
get
(
"proyecto_id"
)
...
...
@@ -523,9 +523,11 @@ class ProyectosUsuarioView(LoginRequiredMixin, TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
usuario
=
self
.
request
.
user
anyo
=
self
.
kwargs
[
"anyo"
]
context
=
super
()
.
get_context_data
(
**
kwargs
)
context
[
"proyectos_coordinados"
]
=
(
Proyecto
.
objects
.
filter
(
convocatoria__id
=
anyo
,
participantes__usuario
=
usuario
,
participantes__tipo_participacion_id__in
=
[
"coordinador"
,
...
...
@@ -537,6 +539,7 @@ class ProyectosUsuarioView(LoginRequiredMixin, TemplateView):
)
context
[
"proyectos_participados"
]
=
(
Proyecto
.
objects
.
filter
(
convocatoria__id
=
anyo
,
participantes__usuario
=
usuario
,
participantes__tipo_participacion_id
=
"participante"
,
)
...
...
@@ -545,6 +548,7 @@ class ProyectosUsuarioView(LoginRequiredMixin, TemplateView):
)
context
[
"proyectos_invitado"
]
=
(
Proyecto
.
objects
.
filter
(
convocatoria__id
=
anyo
,
participantes__usuario
=
usuario
,
participantes__tipo_participacion_id
=
"invitado"
,
)
...
...
manhattan_project/settings-sample.py
View file @
e3877f30
...
...
@@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import
os
from
datetime
import
date
from
django.urls
import
reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
...
...
@@ -163,7 +165,7 @@ STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesSto
AUTH_USER_MODEL
=
"accounts.CustomUser"
LOGIN_URL
=
f
"{SITE_URL}login/saml/?idp=lord"
LOGIN_REDIRECT_URL
=
"proyectos_usuario_list"
LOGIN_REDIRECT_URL
=
reverse_lazy
(
"mis_proyectos"
,
args
=
[
date
.
today
()
.
year
])
LOGOUT_REDIRECT_URL
=
"home"
...
...
templates/base.html
View file @
e3877f30
...
...
@@ -67,7 +67,8 @@
<ul
class=
"navbar-nav ml-auto"
>
{% if user.is_authenticated %}
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{% url 'proyectos_usuario_list' %}"
>
{% now "Y" as anyo_actual %}
<a
class=
"nav-link"
href=
"{% url 'mis_proyectos' anyo_actual %}"
>
<span
class=
"fas fa-project-diagram"
></span>
{% trans "Mis proyectos" %}
</a>
</li>
...
...
@@ -117,8 +118,8 @@
<div
class=
"container-fluid p-3 p-md-5"
>
<div
class=
"row"
>
<div
class=
"col-lg-8"
>
©
2019
{% trans "Universidad de Zaragoza" %}
<br
/>
©
2019
{% trans "Servicio de Informática y Comunicaciones de la Universidad de Zaragoza" %} (
<a
©
{{ anyo_actual }}
{% trans "Universidad de Zaragoza" %}
<br
/>
©
{{ anyo_actual }}
{% trans "Servicio de Informática y Comunicaciones de la Universidad de Zaragoza" %} (
<a
href=
"http://sicuz.unizar.es"
>
SICUZ
</a
>
)
...
...
templates/proyecto/detail.html
View file @
e3877f30
...
...
@@ -142,7 +142,7 @@
<br
style=
"clear: both;"
/>
<div
class=
"btn-group"
role=
"group"
aria-label=
"Botones"
>
<a
href=
"{% url '
proyectos_usuario_list'
%}"
class=
"btn btn-info"
>
<a
href=
"{% url '
mis_proyectos' proyecto.convocatoria_id
%}"
class=
"btn btn-info"
>
<span
class=
"fas fa-step-backward"
></span>
{% trans 'Retroceder' %}
</a>
{% if permitir_edicion %}
...
...
templates/proyecto/new.html
View file @
e3877f30
...
...
@@ -22,7 +22,7 @@
{% csrf_token %}
{{ form | crispy }}
<div
class=
"btn-group"
role=
"group"
aria-label=
"Botones"
>
<a
href=
"{% url '
proyectos_usuario_list'
%}"
class=
"btn btn-info"
<a
href=
"{% url '
mis_proyectos' anyo_actual
%}"
class=
"btn btn-info"
><span
class=
"fas fa-step-backward"
></span>
{% trans 'Retroceder' %}
</a
>
<button
class=
"btn btn-warning"
type=
"submit"
title=
"{% trans 'Crear borrador de solicitud' %}"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment