Revision f3342849 snf-astakos-app/astakos/im/views.py

b/snf-astakos-app/astakos/im/views.py
56 56
from django.views.generic.create_update import (
57 57
    create_object, delete_object, get_model_and_form_class
58 58
)
59
from django.views.generic.list_detail import object_list
59
from django.views.generic.list_detail import object_list, object_detail
60 60
from django.core.xheaders import populate_xheaders
61 61
from django.core.exceptions import ValidationError, PermissionDenied
62 62
from django.template.loader import render_to_string
......
82 82
    AstakosGroupCreationSummaryForm,
83 83
    ProjectApplicationForm
84 84
)
85
from astakos.im.functions import (send_feedback, SendMailError,
86
                                  logout as auth_logout,
87
                                  activate as activate_func,
88
                                  send_activation as send_activation_func,
89
#                                   send_group_creation_notification,
90
                                  SendNotificationError)
85
from astakos.im.functions import (
86
    send_feedback, SendMailError,
87
    logout as auth_logout,
88
    activate as activate_func,
89
    send_activation as send_activation_func,
90
    send_group_creation_notification,
91
    SendNotificationError)
91 92
from astakos.im.endpoints.qh import timeline_charge
92
from astakos.im.settings import (COOKIE_DOMAIN, LOGOUT_NEXT,
93
                                 LOGGING_LEVEL, PAGINATE_BY, RESOURCES_PRESENTATION_DATA, PAGINATE_BY_ALL)
93
from astakos.im.settings import (
94
    COOKIE_DOMAIN, LOGOUT_NEXT,
95
    LOGGING_LEVEL, PAGINATE_BY,
96
    RESOURCES_PRESENTATION_DATA, PAGINATE_BY_ALL
97
)
94 98
#from astakos.im.tasks import request_billing
95 99
from astakos.im.api.callpoint import AstakosCallpoint
96 100
# from .generic_views import create_object
......
1466 1470
    )
1467 1471
    extra_context = {'resource_catalog':resource_catalog}
1468 1472
    return create_object(request, template_name='im/projects/projectapplication_form.html',
1469
        extra_context=extra_context, post_save_redirect=request.path,
1473
        extra_context=extra_context, post_save_redirect='/im/project/list/',
1470 1474
        form_class=ProjectApplicationForm)
1471 1475

  
1472 1476
@require_http_methods(["GET"])
1473 1477
@signed_terms_required
1474 1478
@login_required
1475
def project_application_list(request):
1476
    queryset = ProjectApplication.objects.all()
1479
def project_list(request):
1477 1480
    return object_list(
1478 1481
        request,
1479
        queryset,
1482
        Project.objects.all(),
1480 1483
        paginate_by=PAGINATE_BY_ALL,
1481 1484
        page=request.GET.get('page') or 1,
1482
        template_name='im/projects/projectapplication_list.html')
1485
        template_name='im/projects/project_list.html')
1483 1486

  
1484 1487

  
1485
@require_http_methods(["GET"])
1488
@require_http_methods(["GET", "POST"])
1486 1489
@signed_terms_required
1487 1490
@login_required
1488
def project_list(request):
1489
    pass
1491
def project_application_detail(request, serial):
1492
    return object_detail(
1493
        request,
1494
        queryset=ProjectApplication.objects.select_related(), 
1495
        slug=serial,
1496
        slug_field='serial',
1497
        template_name='im/projects/projectapplication_detail.html'
1498
    )
1490 1499

  
1491 1500
@require_http_methods(["GET", "POST"])
1492 1501
@signed_terms_required
1493 1502
@login_required
1494 1503
def project_detail(request, serial):
1495
    pass
1504
    return object_detail(
1505
        request,
1506
        queryset=Project.objects.select_related(), 
1507
        slug=serial,
1508
        slug_field='serial',
1509
        template_name='im/projects/project_detail.html'
1510
    )
1496 1511

  
1497 1512
@require_http_methods(["GET", "POST"])
1498 1513
@signed_terms_required

Also available in: Unified diff