Skip to content

Commit

Permalink
fix: Jamf Instances capitalization/breadcrumbs/tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mazzi authored and np5 committed Oct 23, 2023
1 parent 016b54d commit bb1aabb
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 17 deletions.
8 changes: 4 additions & 4 deletions tests/jamf/test_jamf_setup_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_jamf_instances_view(self):
response = self.client.get(reverse("jamf:jamf_instances"))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "jamf/jamfinstance_list.html")
self.assertContains(response, "Jamf instances (0)")
self.assertContains(response, "Instances (0)")

# create jamf instance

Expand All @@ -119,7 +119,7 @@ def test_create_jamf_instance_get(self):
response = self.client.get(reverse("jamf:create_jamf_instance"))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "jamf/jamfinstance_form.html")
self.assertContains(response, "Create jamf instance")
self.assertContains(response, "Create Instance")

def test_create_jamf_instance_post(self):
self._login("jamf.add_jamfinstance", "jamf.view_jamfinstance", "jamf.view_tagconfig")
Expand Down Expand Up @@ -189,7 +189,7 @@ def test_delete_jamf_instance_get(self):
jamf_instance = self._force_jamf_instance()
self._login("jamf.delete_jamfinstance")
response = self.client.get(reverse("jamf:delete_jamf_instance", args=(jamf_instance.pk,)))
self.assertContains(response, "Delete jamf instance")
self.assertContains(response, "Delete Instance")

@patch("zentral.contrib.jamf.api_client.APIClient.cleanup")
def test_delete_jamf_instance_post_cleanup_ok(self, cleanup):
Expand Down Expand Up @@ -245,7 +245,7 @@ def test_update_jamf_instance_get(self):
jamf_instance = self._force_jamf_instance()
self._login("jamf.change_jamfinstance")
response = self.client.get(reverse("jamf:update_jamf_instance", args=(jamf_instance.pk,)))
self.assertContains(response, "Update jamf instance")
self.assertContains(response, "Update Instance")
self.assertContains(response, jamf_instance.get_password())

def test_update_jamf_instance_post(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
{% block content %}
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Jamf instances</a></li>
<li class="breadcrumb-item"><a href="{% url "jamf:index" %}">Jamf</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Instances</a></li>
<li class="breadcrumb-item"><a href="{{ object.get_absolute_url }}">{{ object }}</a></li>
<li class="breadcrumb-item active">Delete</li>
</ol>

<h2>{{ title }}</h2>

<form method="POST">{% csrf_token %}
<p>Do you really want to delete this jamf instance ?</p>
<p>Do you really want to delete this instance ?</p>
<p>
<a href="{{ object.get_absolute_url }}" class="btn btn-outline-secondary">Cancel</a>
<button class="btn btn-danger">Delete</button>
Expand Down
5 changes: 3 additions & 2 deletions zentral/contrib/jamf/templates/jamf/jamfinstance_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
{% block content %}
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Jamf instances</a></li>
<li class="breadcrumb-item"><a href="{% url "jamf:index" %}">Jamf</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Instances</a></li>
<li class="breadcrumb-item active">{{ object }}</li>
</ol>

Expand All @@ -14,7 +15,7 @@
<h2 class="m-0">{{ title }}</h2>
</div>
<div class="d-flex align-items-center mb-3">
<h3 class="m-0 fs-5 text-secondary">Jamf Instance</h3>
<h3 class="m-0 fs-5 text-secondary">Instance</h3>
<div class="ms-auto">
{% url 'jamf:delete_jamf_instance' object.pk as url %}
{% button 'LINK' object.api_doc_url "API resource documentation" %}
Expand Down
3 changes: 2 additions & 1 deletion zentral/contrib/jamf/templates/jamf/jamfinstance_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{% block content %}
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Jamf instances</a></li>
<li class="breadcrumb-item"><a href="{% url "jamf:index" %}">Jamf</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Instances</a></li>
{% if object %}
<li class="breadcrumb-item"><a href="{{ object.get_absolute_url }}">{{ object }}</a></li>
<li class="breadcrumb-item active">Update</li>
Expand Down
5 changes: 3 additions & 2 deletions zentral/contrib/jamf/templates/jamf/jamfinstance_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
{% block content %}
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item active">Jamf instances</li>
<li class="breadcrumb-item"><a href="{% url "jamf:index" %}">Jamf</a></li>
<li class="breadcrumb-item active">Instances</li>
</ol>

<div class="d-flex align-items-center mb-1">
<h2 class="m-0">Jamf instance{{ jamf_instances_count|pluralize }} ({{ jamf_instances_count }})</h2>
<h2 class="m-0">Instance{{ jamf_instances_count|pluralize }} ({{ jamf_instances_count }})</h2>
<div class="ms-auto">
{% if perms.jamf.add_jamfinstance %}
{% url 'jamf:create_jamf_instance' as url %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{% block content %}
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Jamf instances</a></li>
<li class="breadcrumb-item"><a href="{% url "jamf:index" %}">Jamf</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Instances</a></li>
<li class="breadcrumb-item"><a href="{{ jamf_instance.get_absolute_url }}">{{ jamf_instance }}</a></li>
<li class="breadcrumb-item active">{{ title }}</li>
</ol>
Expand Down
3 changes: 2 additions & 1 deletion zentral/contrib/jamf/templates/jamf/tagconfig_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{% block content %}
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Jamf instances</a></li>
<li class="breadcrumb-item"><a href="{% url "jamf:index" %}">Jamf</a></li>
<li class="breadcrumb-item"><a href="{% url 'jamf:jamf_instances' %}">Instances</a></li>
<li class="breadcrumb-item"><a href="{{ jamf_instance.get_absolute_url }}">{{ jamf_instance }}</a></li>
<li class="breadcrumb-item active">{{ title }}</li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion zentral/contrib/jamf/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
modules_menu_cfg = {
'items': (
('index', 'Overview', False, ('jamf',)),
('jamf_instances', 'jamf instances', False, ('jamf.view_jamfinstance',)),
('jamf_instances', 'Instances', False, ('jamf.view_jamfinstance',)),
),
'weight': 60,
}
6 changes: 3 additions & 3 deletions zentral/contrib/jamf/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CreateJamfInstanceView(PermissionRequiredMixin, CreateView):

def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
ctx["title"] = "Create jamf instance"
ctx["title"] = "Create Instance"
return ctx


Expand Down Expand Up @@ -91,7 +91,7 @@ class UpdateJamfInstanceView(PermissionRequiredMixin, UpdateView):

def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
ctx["title"] = "Update jamf instance"
ctx["title"] = "Update Instance"
return ctx


Expand All @@ -102,7 +102,7 @@ class DeleteJamfInstanceView(PermissionRequiredMixin, DeleteView):

def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
ctx["title"] = "Delete jamf instance"
ctx["title"] = "Delete Instance"
return ctx

def form_valid(self, form):
Expand Down

0 comments on commit bb1aabb

Please sign in to comment.