Skip to content

Commit

Permalink
Add 'Generate QR codes for selected' button to SeedDB
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed May 7, 2024
1 parent 54f3703 commit f121110
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions python/nav/web/seeddb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class SeeddbInfo(object):

hide_move = False
hide_delete = False
hide_qr_code = True
copy_url_name = None
delete_url = None
delete_url_name = None
Expand Down Expand Up @@ -79,6 +80,7 @@ def template_context(self):
'tab_template': self.tab_template,
'hide_move': self.hide_move,
'hide_delete': self.hide_delete,
'hide_qr_code': self.hide_qr_code,
'delete_url': self.delete_url,
'delete_url_name': self.delete_url_name,
'back_url': self.back_url,
Expand Down
1 change: 1 addition & 0 deletions python/nav/web/seeddb/page/netbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class NetboxInfo(SeeddbInfo):
add_url = reverse_lazy('seeddb-netbox-edit')
bulk_url = reverse_lazy('seeddb-netbox-bulk')
copy_url_name = 'seeddb-netbox-copy'
hide_qr_code = False


def netbox(request):
Expand Down
1 change: 1 addition & 0 deletions python/nav/web/seeddb/page/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class RoomInfo(SeeddbInfo):
add_url = reverse_lazy('seeddb-room-edit')
bulk_url = reverse_lazy('seeddb-room-bulk')
copy_url_name = 'seeddb-room-copy'
hide_qr_code = False


def room(request):
Expand Down
5 changes: 4 additions & 1 deletion python/nav/web/templates/seeddb/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
{% endif %}

<form action="{{ request.path }}" method="post">
{% if not hide_move or not hide_delete %}
{% if not hide_move or not hide_delete or not hide_qr_code%}
<div>
{% if not hide_move %}
<input type="submit" name="move" value="Move selected" class="button small secondary" />
{% endif %}
{% if not hide_delete %}
<input type="submit" name="delete" value="Delete selected" class="button small secondary"/>
{% endif %}
{% if not hide_qr_code %}
<input type="submit" name="qr_code" value="Generate QR codes for selected" class="button small secondary"/>
{% endif %}
</div>
{% endif %}

Expand Down

0 comments on commit f121110

Please sign in to comment.