Skip to content

Commit

Permalink
refacto org and team left details
Browse files Browse the repository at this point in the history
  • Loading branch information
Sispheor committed Sep 18, 2023
1 parent 3f1f503 commit 48078f4
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 29 deletions.
4 changes: 2 additions & 2 deletions service_catalog/filters/request_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
class RequestFilter(SquestFilter):
class Meta:
model = Request
fields = ['instance__name', 'user__id', 'instance__service__id', 'operation', 'operation__type',
'state']
fields = ['instance__name', 'user__id', 'instance__service__id', 'operation', 'instance__quota_scope',
'operation__type', 'state']

instance__service__id = MultipleChoiceFilter(
label="Service",
Expand Down
13 changes: 9 additions & 4 deletions templates/profiles/organization_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

{% block main %}
{% has_perm request.user "profiles.delete_users_organization" object as can_delete_user %}
{# For UserRoleTable actions #}
<div class="container-fluid">
<div class="row">
<section class="col-lg-3">
Expand All @@ -49,11 +48,17 @@ <h3 class="card-title"><b>{{ object.name }}</b></h3>
<div class="card-body pt-0 pb-0">
<ul class="list-group list-group-unbordered">
{% if object.description %}
<li class="list-group-item">
Description
<p class="float-right">{{ object.description }}</p>
<li class="list-group-item border-top-0 border-bottom-0" >
<strong>Description</strong><br>
{{ object.description }}
</li>
{% endif %}
<li class="list-group-item border-top-0 border-bottom-0">
<a href="{% url 'service_catalog:instance_list' %}?quota_scope={{ object.id }}">View instances</a>
</li>
<li class="list-group-item border-top-0 border-bottom-0">
<a href="{% url 'service_catalog:request_list' %}?instance__quota_scope={{ object.id }}">View requests</a>
</li>
</ul>
</div>

Expand Down
21 changes: 13 additions & 8 deletions templates/profiles/team_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,29 @@
<div class="container-fluid">
<div class="row">
<section class="col-lg-3">
<div class="card card-sucess">
<div class="card">
<div class="card-header">
<h3 class="card-title"><b>{{ object.name }}</b></h3>
</div>
<div class="card-body pt-0 pb-0">

<ul class="list-group list-group-unbordered">
<li class="list-group-item border-top-0">
Organization
<a class="float-right"
href="{{ object.org.get_absolute_url }}">{{ object.org }}</a>
<li class="list-group-item border-top-0 border-bottom-0">
<strong>Organization</strong><br>
<a href="{{ object.org.get_absolute_url }}">{{ object.org }}</a>
</li>
{% if object.description %}
<li class="list-group-item border-bottom-0">
Description
<p class="float-right">{{ object.description }}</p>
<li class="list-group-item border-top-0 border-bottom-0">
<strong>Description</strong><br>
{{ object.description }}
</li>
{% endif %}
<li class="list-group-item border-top-0 border-bottom-0">
<a href="{% url 'service_catalog:instance_list' %}?quota_scope={{ object.id }}">View instances</a>
</li>
<li class="list-group-item border-top-0 border-bottom-0">
<a href="{% url 'service_catalog:request_list' %}?instance__quota_scope={{ object.id }}">View requests</a>
</li>
</ul>
</div>
</div>
Expand Down
11 changes: 7 additions & 4 deletions templates/service_catalog/request_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{% load render_table from django_tables2 %}
{% load static %}
{% block header_button %}
{% include 'service_catalog/buttons/request_state_machine.html' %}
{% include 'generics/buttons/edit_button.html' %}
{% include 'generics/buttons/delete_button.html' %}
{% include 'service_catalog/buttons/request_state_machine.html' %}
{% include 'generics/buttons/edit_button.html' %}
{% include 'generics/buttons/delete_button.html' %}
{% endblock %}
{% block main %}
<div class="container-fluid">
Expand All @@ -19,7 +19,10 @@
{% include 'service_catalog/request_details/approval.html' %}
</div>
<div class="col-lg-4">
{% include 'service_catalog/request_details/request-messages.html' %}
{% has_perm request.user "service_catalog.view_requestmessage" object as can_view_requestmessage %}
{% if can_view_requestmessage %}
{% include 'service_catalog/request_details/request-messages.html' %}
{% endif %}
</div>
</div>
</div><!-- end container fluid -->
Expand Down
21 changes: 10 additions & 11 deletions templates/service_catalog/request_details/approval.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h3 class="timeline-header text-success">{{ step.approval_step.name }}</h3>
{% with args_filter="re_submit,"|addstr:object.id %}
{% if args_filter|can_proceed_request_action and can_re_submit_request %}
<div class="timeline-footer">
<a class="btn btn-default"
<a class="btn btn-info"
title="Re-submit"
href="{% url 'service_catalog:request_re_submit' object.id %}">
<i class="fas fa-redo"></i> Re-submit
Expand Down Expand Up @@ -188,17 +188,16 @@ <h3 class="timeline-header">Admin review</h3>
</a>
{% endif %}
{% endwith %}
{% else %}
{% with args_filter="re_submit,"|addstr:object.id %}
{% if args_filter|can_proceed_request_action and can_re_submit_request %}
<a class="btn btn-info"
title="Re-submit"
href="{% url 'service_catalog:request_re_submit' object.id %}">
<i class="fas fa-undo"></i> Re-submit
</a>
{% endif %}
{% endwith %}
{% endif %}
{% with args_filter="re_submit,"|addstr:object.id %}
{% if args_filter|can_proceed_request_action and can_re_submit_request %}
<a class="btn btn-info"
title="Re-submit"
href="{% url 'service_catalog:request_re_submit' object.id %}">
<i class="fas fa-undo"></i> Re-submit
</a>
{% endif %}
{% endwith %}
{% with args_filter="accept,"|addstr:object.id %}
{% if args_filter|can_proceed_request_action and can_accept_request %}
<a class="btn btn-primary"
Expand Down

0 comments on commit 48078f4

Please sign in to comment.