Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into dev-gino
Browse files Browse the repository at this point in the history
  • Loading branch information
ginokok1996 committed Dec 23, 2020
2 parents 63a3c3b + 634252d commit 6abe375
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 74 deletions.
18 changes: 18 additions & 0 deletions api/src/Controller/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,24 @@ public function dossiersAction(Session $session, Request $request, CommonGroundS
} else {
return $this->redirect($this->generateUrl('app_dashboard_dossiers'));
}
} elseif ($request->isMethod('POST') && ($request->get('dossierObjection'))) {
$dossier = $commonGroundService->getResource(['component' => 'wac', 'type' => 'dossiers', 'id' => $request->get('dossierID')]);

// Create vrc request
// $vrcRequest['status'] = 'submitted';
// $vrcRequest['organization'] = 'url org';
// $vrcRequest['requestType'] = 'url request type';
// $vrcRequest['processType'] = 'url process type';
// $vrcRequest['properties'] = [
// 'dossier' => $commonGroundService->cleanUrl(['component' => 'wac', 'type' => 'dossiers', 'id' => $dossier['id']]),
// 'explanation' => $request->get('explanation'),
// ];
// $vrcRequest = $commonGroundService->createResource($vrcRequest, ['component' => 'vrc', 'type' => 'requests']);

// $this->flash->add('success', 'Objection submitted for: '.$dossier['name']);
$this->flash->add('error', 'No objection submitted for: '.$dossier['name']);

return $this->redirect($this->generateUrl('app_dashboard_dossiers'));
}

return $variables;
Expand Down
11 changes: 5 additions & 6 deletions api/templates/dashboard/authorization.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
{% block pageContent %}
<div class="container-md">
<div class="row">
{# <div class="col-12 col-md-3">#}
<div class="col-12 col-md-3">

{# {% set activeItem = 'claims' %}#}
{# {% include 'dashboard/sidenavbar.html.twig' %}#}
{% set activeItem = 'authorizations' %}
{% include 'dashboard/sidenavbar.html.twig' %}

{# </div>#}

{# TODO:Include the sidenavbar and have a back button? #}
</div>

<div class="col-12 col-md-9">

Expand Down Expand Up @@ -149,6 +147,7 @@
<!-- Modals -->
{% if resource.dossiers is defined and resource.dossiers is not empty %}
{% for dossier in resource.dossiers %}
{% include 'dashboard/modals/object_dossier_modal.html.twig' %}
{% include 'dashboard/modals/delete_dossier_modal.html.twig' %}
{% endfor %}
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions api/templates/dashboard/authorizations.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

{% if authorization.dossiers is defined and authorization.dossiers is not empty %}
{% for dossier in authorization.dossiers %}
{% include 'dashboard/modals/object_dossier_modal.html.twig' %}
{% include 'dashboard/modals/delete_dossier_modal.html.twig' %}
{% endfor %}
{% endif %}
Expand Down
71 changes: 24 additions & 47 deletions api/templates/dashboard/claim.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -27,60 +27,36 @@

<div class="col-10 text-center">

<!-- Heading -->
<h4 class="mb-0">{{ 'claim'|trans|capitalize }}</h4>
<h4 class="mb-0">
{{ resource.property }}
</h4>

</div>
</div>
</div>
<div class="card-body">
{% if resource|default %}

<div class="list-group-item" style="padding-bottom: 0rem; border: none;">
<!-- Header -->
<div class="row mb-5">
<div class="col">

<!-- Heading -->
<div class="list-group list-group-flush">
<!-- Property of this claim -->
<div style="border: none" class="list-group-item pb-0">
<div class="row align-items-center">
<div class="col-auto">
</div>
<div class="col-11 ml-n5">
<!-- Heading -->
<p class="mb-0 font-weight-bold">
{{ 'scope' }}
</p>
<!-- Text -->
<p class="text-gray-700">
{{ resource.property }}
</p>
</div>
</div>
</div>
{% if resource.data is defined and resource.data is not empty %}
{% for key, value in resource.data %}
<div style="border: none" class="list-group-item pb-0">
<div class="row align-items-center">
<div class="col-auto">
</div>
<div class="col-11 ml-n5">
<!-- Heading -->
<p class="mb-0 font-weight-bold">
{{ key }}
</p>
<!-- Text -->
<p class="text-gray-700">
{{ value }}
</p>
</div>
</div>
</div>
{% endfor %}
{% endif %}
</div>

</div>
<!-- Claim data -->
<h3>{{ 'data'|trans|capitalize }}:</h3>
<div class="mb-4">
<p class="mb-0 font-weight-bold">{{ 'scope' }}</p>
<small class="text-gray-700">
{{ resource.property }}
</small>
</div>
{% if resource.data is defined and resource.data is not empty %}
{% for key, value in resource.data %}
<div class="mb-4">
<p class="mb-0 font-weight-bold">{{ key }}</p>
<small class="text-gray-700">
{{ value }}
</small>
</div>
{% endfor %}
{% endif %}

{% endif %}
</div>
Expand Down Expand Up @@ -122,6 +98,7 @@

{% if authorization.dossiers is defined and authorization.dossiers is not empty %}
{% for dossier in authorization.dossiers %}
{% include 'dashboard/modals/object_dossier_modal.html.twig' %}
{% include 'dashboard/modals/delete_dossier_modal.html.twig' %}
{% endfor %}
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions api/templates/dashboard/claims.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

{% if authorization.dossiers is defined and authorization.dossiers is not empty %}
{% for dossier in authorization.dossiers %}
{% include 'dashboard/modals/object_dossier_modal.html.twig' %}
{% include 'dashboard/modals/delete_dossier_modal.html.twig' %}
{% endfor %}
{% endif %}
Expand Down
18 changes: 8 additions & 10 deletions api/templates/dashboard/dossier.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
{% block pageContent %}
<div class="container-md">
<div class="row">
{# <div class="col-12 col-md-3">#}
<div class="col-12 col-md-3">

{# {% set activeItem = 'claims' %}#}
{# {% include 'dashboard/sidenavbar.html.twig' %}#}
{% set activeItem = 'dossiers' %}
{% include 'dashboard/sidenavbar.html.twig' %}

{# </div>#}

{# TODO:Include the sidenavbar and have a back button? #}
</div>

<div class="col-12 col-md-9">

Expand All @@ -32,7 +30,7 @@
<!-- Heading -->
<h4 class="mb-0">{{ 'dossier'|trans|capitalize }}</h4>
<h4 class="mb-0">
{{ resource.basis }}
{{ resource.name }}
</h4>

</div>
Expand All @@ -41,11 +39,11 @@
<div class="card-body">
{% if resource|default %}

{% if resource.endDate is defined and resource.endDate is not empty %}
{% if resource.expiryDate is defined and resource.expiryDate is not empty %}
<!-- Dossier endDate -->
<h4>{{ 'end date'|trans|capitalize }}:</h4>
<h4>{{ 'expiry date'|trans|capitalize }}:</h4>
<small class="text-gray-700">
{{ resource.endDate|date("d-m-Y", "Europe/Paris") }}
{{ resource.expiryDate|date("d-m-Y", "Europe/Paris") }}
</small>
{% endif %}

Expand Down
1 change: 1 addition & 0 deletions api/templates/dashboard/dossiers.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<!-- modals -->
{% if dossiers is defined and dossiers is not empty %}
{% for dossier in dossiers %}
{% include 'dashboard/modals/object_dossier_modal.html.twig' %}
{% include 'dashboard/modals/delete_dossier_modal.html.twig' %}
{% endfor %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<!-- list of dossiers for this authorization -->
<h3 class="text-center">{{ 'dossiers'|trans|capitalize }}</h3>
{% set dossiers = authorization.dossiers %}
{% set authorizationDeleteModal = true %}
{% include 'dashboard/widgets/dossier_list.html.twig' %}
{% else %}
<!-- Heading -->
Expand Down
22 changes: 11 additions & 11 deletions api/templates/dashboard/modals/delete_dossier_modal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</h2>
<br>
<h3 class="text-center">
{{ dossier.basis }}
{{ dossier.name }}
</h3>
<br>

Expand All @@ -39,16 +39,16 @@

<!-- Yes -->
<button
{% if claim is defined %}
name="deleteClaimAuthorizationDossier"
{% elseif authorization is defined %}
name="deleteAuthorizationDossier"
{% else %}
name="deleteDossier"
{% endif %}
style="background-color: red"
value="true"
class="btn btn-block btn-primary mt-3 lift">
{% if claim is defined %}
name="deleteClaimAuthorizationDossier"
{% elseif authorization is defined %}
name="deleteAuthorizationDossier"
{% else %}
name="deleteDossier"
{% endif %}
style="background-color: red"
value="true"
class="btn btn-block btn-primary mt-3 lift">
{{ 'yes'|trans|capitalize }}
</button>

Expand Down
48 changes: 48 additions & 0 deletions api/templates/dashboard/modals/object_dossier_modal.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<div class="modal fade" id="modalObjectDossier{{ dossier.id }}" tabindex="-1" role="dialog" aria-labelledby="modalObjectDossierTitle{{ dossier.id }}" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">

<!-- Close -->
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>

<!-- Heading -->
<h2 class="font-weight-bold text-center mb-1" id="modalObjectDossierTitle{{ dossier.id }}">
{{ 'object to this dossier'|trans|capitalize }}
</h2>
<h3 class="text-center">
{{ dossier.name }}
</h3>

<!-- Divider -->
<hr class="border-gray-300 my-6">

<!-- Form -->
<form method="post" action="{{ path('app_dashboard_dossiers') }}" enctype="multipart/form-data">
<input type="hidden" name="dossierID" value="{{ dossier.id }}">

<!-- Explanation -->
<div class="form-group">
<label for="explanation">{{ 'please explain your objection'|trans|capitalize }} <span class="text-danger">*</span></label>
<textarea class="form-control" name="explanation" id="explanation"
cols="2" rows="3" style="max-height: 20rem; min-height: 3.5rem"
placeholder="{{ 'explanation'|trans|capitalize }}"
required
></textarea>
</div>

<!-- Submit -->
<button
name="dossierObjection"
value="true"
class="btn btn-block btn-primary mt-3 lift">
{{ 'submit'|trans|capitalize }}
</button>

</form>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<!-- list of dossiers for this authorization -->
<h3 class="text-center">{{ 'dossiers'|trans|capitalize }}</h3>
{% set dossiers = claim.dossiers %}
{% set viewDossiersModal = true %}
{% include 'dashboard/widgets/dossier_list.html.twig' %}
{% else %}
<!-- Heading -->
Expand Down
12 changes: 12 additions & 0 deletions api/templates/dashboard/widgets/dossier_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@
{% endif %}

</div>
{% if authorizationDeleteModal is not defined and viewDossiersModal is not defined %}
<div class="col-auto mr-n5">
{# TODO:disable button if request already exists? / view objection button? #}
<!-- Button -->
<a class="btn btn-xs btn-primary" data-toggle="modal" data-target="#modalObjectDossier{{ dossier.id }}">
{{ 'object to this dossier'|trans|capitalize }}
</a>

</div>
{% endif %}
<div class="col-auto">

<!-- Dropdown -->
Expand All @@ -28,6 +37,9 @@
<i class="fe fe-more-vertical"></i>
</a>
<div class="dropdown-menu" style="">
{% if authorizationDeleteModal is defined or viewDossiersModal is defined%}
<button class="dropdown-item" data-toggle="modal" data-target="#modalObjectDossier{{ dossier.id }}">{{ 'object to this dossier'|trans|capitalize }}</button>
{% endif %}
<a class="dropdown-item" href="{{ path('app_dashboard_dossier',{'id': dossier.id}) }}">{{ 'view dossier'|trans|capitalize }}</a>
<button class="dropdown-item" data-toggle="modal" data-target="#modalDeleteDossier{{ dossier.id }}" style="color: red">{{ 'delete dossier'|trans|capitalize }}</button>
</div>
Expand Down

0 comments on commit 6abe375

Please sign in to comment.