1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

net-mgmt/py-phonebox-plugin: Update to 0.0.5b1

* Remove upstreamed patch.

Changelog:

https://github.com/iDebugAll/phonebox_plugin/releases/tag/v0.0.5-beta.1

Reported by:	Mike Geiger (via e-mail)
MFH:		2023Q2
This commit is contained in:
Kai Knoblich 2023-04-29 20:21:17 +02:00
parent 3b357fa057
commit 3d5e6aa16f
3 changed files with 4 additions and 192 deletions

View File

@ -1,6 +1,5 @@
PORTNAME= phonebox-plugin
DISTVERSION= 0.0.4b1
PORTREVISION= 1
DISTVERSION= 0.0.5b1
CATEGORIES= net-mgmt python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1654793403
SHA256 (phonebox_plugin-0.0.4b1.tar.gz) = 73a6cac57df8af9f69782e720b7c7336645464fe96af60d340b0854f05ec4bbb
SIZE (phonebox_plugin-0.0.4b1.tar.gz) = 19295
TIMESTAMP = 1682785060
SHA256 (phonebox_plugin-0.0.5b1.tar.gz) = 10e3e92cd7d44a800ce3705adaf26ee011b5b7857cdcfae1a1aa3f9b6daa3a4d
SIZE (phonebox_plugin-0.0.5b1.tar.gz) = 19037

View File

@ -1,187 +0,0 @@
Fix runtime issues with NetBox 3.3+
See also:
https://github.com/iDebugAll/phonebox_plugin/issues/27
https://github.com/iDebugAll/phonebox_plugin/pull/28
--- MANIFEST.in.orig 2023-02-21 21:36:03 UTC
+++ MANIFEST.in
@@ -1,4 +1,5 @@ recursive-include phonebox_plugin/templates *
include README.md
include LICENSE
recursive-include phonebox_plugin/templates *
+recursive-exclude phonebox_plugin/templates *.orig .DS_Store
recursive-include phonebox_plugin/static *
--- phonebox_plugin/api/nested_serializers.py.orig 2021-09-21 14:31:12 UTC
+++ phonebox_plugin/api/nested_serializers.py
@@ -1,6 +1,12 @@ from phonebox_plugin import models
from rest_framework import serializers
from phonebox_plugin import models
-from netbox.api import WritableNestedSerializer
+
+try:
+ from netbox.api import ChoiceField, WritableNestedSerializer
+except ImportError:
+ from netbox.api.fields import ChoiceField
+ from netbox.api.serializers.nested import WritableNestedSerializer
+
from tenancy.api.nested_serializers import NestedTenantSerializer
__all__ = ["NestedNumberSerializer", ]
--- phonebox_plugin/templates/phonebox_plugin/list_view_3.4.html.orig 2023-02-21 21:32:23 UTC
+++ phonebox_plugin/templates/phonebox_plugin/list_view_3.4.html
@@ -0,0 +1,62 @@
+{% extends 'base/layout.html' %}
+{% load buttons %}
+{% load static %}
+{% load plugins %}
+{% load helpers %}
+
+
+{% block controls %}
+
+<div class="pull-right noprint">
+ {% if perms.phonebox_plugin.add_number %}
+ <a href="/plugins/phonebox/add_number/" type="button" class="btn btn-sm btn-success">
+ <i class="mdi mdi-plus-thick"></i> Add
+ </a>
+ {% endif %}
+ {% if perms.phonebox_plugin.add_number %}
+ <a href="/plugins/phonebox/import_numbers/" type="button" class="btn btn-sm btn-info">
+ <i class="mdi mdi-upload"></i> Import
+ </a>
+ {% endif %}
+</div>
+
+{% endblock %}
+
+
+{% block content %}
+
+<ul class="nav nav-tabs px-3">
+ <li class="nav-item" role="presentation">
+ <button class="nav-link active" id="numbers-tab" data-bs-toggle="tab" data-bs-target="#numbers" type="button" role="tab" aria-controls="numbers" aria-selected="true">
+ Numbers
+ </button>
+ </li>
+ <li class="nav-item" role="presentation">
+ <button class="nav-link" id="filters-form-tab" data-bs-toggle="tab" data-bs-target="#filters-form" type="button" role="tab" aria-controls="filters-form" aria-selected="false">
+ Filters
+ {% if filter_form %}{% badge filter_form.changed_data|length %}{% endif %}
+ </button>
+ </li>
+</ul>
+
+<div class="tab-content">
+ <div class="tab-pane active" id="numbers" role="tabpanel" aria-labelledby="numbers-tab">
+
+ {# Applied filters #}
+ {% if filter_form %}
+ {% applied_filters model filter_form request.GET %}
+ {% endif %}
+
+ <h2>{% block title %}Numbers{% endblock %}</h2>
+ <div class="row">
+ <div class="col-md-12">
+ {% include 'phonebox_plugin/obj_table.html' with bulk_delete_url="plugins:phonebox_plugin:number_bulk_delete" bulk_edit_url="plugins:phonebox_plugin:number_bulk_edit" %}
+ </div>
+ </div>
+ </div>
+ <div class="tab-pane" id="filters-form" role="tabpanel" aria-labelledby="filters-form-tab">
+ {% include 'inc/filter_list.html' %}
+ </div>
+</div>
+
+{% endblock %}
--- phonebox_plugin/templates/phonebox_plugin/voice_circuit_list_view_3.4.html.orig 2023-02-21 21:32:23 UTC
+++ phonebox_plugin/templates/phonebox_plugin/voice_circuit_list_view_3.4.html
@@ -0,0 +1,62 @@
+{% extends 'base/layout.html' %}
+{% load buttons %}
+{% load static %}
+{% load plugins %}
+{% load helpers %}
+
+
+{% block controls %}
+
+<div class="pull-right noprint">
+ {% if perms.phonebox_plugin.add_voice_circuit %}
+ <a href="{% url 'plugins:phonebox_plugin:add_voice_circuit' %}" type="button" class="btn btn-sm btn-success">
+ <i class="mdi mdi-plus-thick"></i> Add
+ </a>
+ {% endif %}
+ {% if perms.phonebox_plugin.add_voice_circuit %}
+ <a href="{% url 'plugins:phonebox_plugin:import_voice_circuits' %}" type="button" class="btn btn-sm btn-info">
+ <i class="mdi mdi-upload"></i> Import
+ </a>
+ {% endif %}
+</div>
+
+{% endblock %}
+
+
+{% block content %}
+
+<ul class="nav nav-tabs px-3">
+ <li class="nav-item" role="presentation">
+ <button class="nav-link active" id="voice_circuits-tab" data-bs-toggle="tab" data-bs-target="#voice_circuits" type="button" role="tab" aria-controls="voice_circuits" aria-selected="true">
+ Voice Circuits
+ </button>
+ </li>
+ <li class="nav-item" role="presentation">
+ <button class="nav-link" id="filters-form-tab" data-bs-toggle="tab" data-bs-target="#filters-form" type="button" role="tab" aria-controls="filters-form" aria-selected="false">
+ Filters
+ {% if filter_form %}{% badge filter_form.changed_data|length %}{% endif %}
+ </button>
+ </li>
+</ul>
+
+<div class="tab-content">
+ <div class="tab-pane active" id="voice_circuits" role="tabpanel" aria-labelledby="voice_circuits-tab">
+
+ {# Applied filters #}
+ {% if filter_form %}
+ {% applied_filters model filter_form request.GET %}
+ {% endif %}
+
+ <h2>{% block title %}Voice Circuits{% endblock %}</h2>
+ <div class="row">
+ <div class="col-md-12">
+ {% include 'phonebox_plugin/obj_table.html' with bulk_delete_url="plugins:phonebox_plugin:voice_circuit_bulk_delete" bulk_edit_url="plugins:phonebox_plugin:voice_circuit_bulk_edit" %}
+ </div>
+ </div>
+ </div>
+ <div class="tab-pane" id="filters-form" role="tabpanel" aria-labelledby="filters-form-tab">
+ {% include 'inc/filter_list.html' %}
+ </div>
+</div>
+
+{% endblock %}
--- phonebox_plugin/views.py.orig 2022-06-09 10:46:13 UTC
+++ phonebox_plugin/views.py
@@ -18,8 +18,10 @@ class NumberListView(generic.ObjectListView):
filterset = filters.NumberFilterSet
filterset_form = forms.NumberFilterForm
table = tables.NumberTable
- if NETBOX_CURRENT_VERSION >= version.parse("3.0"):
+ if NETBOX_CURRENT_VERSION >= version.parse("3.0") and NETBOX_CURRENT_VERSION < version.parse("3.4"):
template_name = "phonebox_plugin/list_view_3.x.html"
+ elif NETBOX_CURRENT_VERSION >= version.parse("3.4"):
+ template_name = "phonebox_plugin/list_view_3.4.html"
else:
template_name = "phonebox_plugin/list_view.html"
@@ -76,8 +78,10 @@ class VoiceCircuitListView(generic.ObjectListView):
filterset = filters.VoiceCircuitFilterSet
filterset_form = forms.VoiceCircuitFilterForm
table = tables.VoiceCircuitTable
- if NETBOX_CURRENT_VERSION >= version.parse("3.0"):
+ if NETBOX_CURRENT_VERSION >= version.parse("3.0") and NETBOX_CURRENT_VERSION < version.parse("3.4"):
template_name = "phonebox_plugin/voice_circuit_list_view_3.x.html"
+ elif NETBOX_CURRENT_VERSION >= version.parse("3.4"):
+ template_name = "phonebox_plugin/voice_circuit_list_view_3.4.html"
else:
template_name = "phonebox_plugin/voice_circuit_list_view.html"