Rename ITU "coordination" to "notification"
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>spacecruft
parent
b563760219
commit
94b2594ee7
|
@ -199,7 +199,7 @@ class TransmitterEntrySerializer(serializers.ModelSerializer):
|
|||
'uuid', 'description', 'status', 'type', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'downlink_low', 'downlink_high', 'downlink_drift', 'downlink_mode', 'uplink_mode',
|
||||
'invert', 'baud', 'satellite', 'citation', 'service', 'iaru_coordination',
|
||||
'iaru_coordination_url', 'itu_coordination', 'created_by'
|
||||
'iaru_coordination_url', 'itu_notification', 'created_by'
|
||||
)
|
||||
|
||||
|
||||
|
@ -231,7 +231,7 @@ class TransmitterEntrySerializer(serializers.ModelSerializer):
|
|||
'service': 'Amateur',
|
||||
'iaru_coordination': '',
|
||||
'iaru_coordination_url': '',
|
||||
'itu_coordination': ''
|
||||
'itu_notification': ''
|
||||
},
|
||||
response_only=True, # signal that example only applies to responses
|
||||
),
|
||||
|
@ -253,7 +253,7 @@ class TransmitterSerializer(serializers.ModelSerializer):
|
|||
'uuid', 'description', 'alive', 'type', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'downlink_low', 'downlink_high', 'downlink_drift', 'mode', 'mode_id', 'uplink_mode',
|
||||
'invert', 'baud', 'sat_id', 'norad_cat_id', 'status', 'updated', 'citation', 'service',
|
||||
'iaru_coordination', 'iaru_coordination_url', 'itu_coordination'
|
||||
'iaru_coordination', 'iaru_coordination_url', 'itu_notification'
|
||||
)
|
||||
|
||||
# Keeping alive field for compatibility issues
|
||||
|
|
|
@ -27,7 +27,7 @@ class TransmitterCreateForm(BSModalModelForm): # pylint: disable=too-many-ances
|
|||
'description', 'type', 'status', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'uplink_mode', 'downlink_low', 'downlink_high', 'downlink_drift', 'downlink_mode',
|
||||
'invert', 'baud', 'citation', 'service', 'iaru_coordination', 'iaru_coordination_url',
|
||||
'itu_coordination'
|
||||
'itu_notification'
|
||||
]
|
||||
labels = {
|
||||
'downlink_low': _('Downlink freq.'),
|
||||
|
@ -35,7 +35,7 @@ class TransmitterCreateForm(BSModalModelForm): # pylint: disable=too-many-ances
|
|||
'invert': _('Inverted Transponder?'),
|
||||
'iaru_coordination': _('IARU Coordination'),
|
||||
'iaru_coordination_url': _('IARU Coordination URL'),
|
||||
'itu_coordination': _('ITU Coordinations URLs'),
|
||||
'itu_notification': _('ITU Notifications URLs'),
|
||||
}
|
||||
widgets = {
|
||||
'description': TextInput(),
|
||||
|
@ -50,7 +50,7 @@ class TransmitterUpdateForm(BSModalModelForm): # pylint: disable=too-many-ances
|
|||
'description', 'type', 'status', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'uplink_mode', 'downlink_low', 'downlink_high', 'downlink_drift', 'downlink_mode',
|
||||
'invert', 'baud', 'citation', 'service', 'iaru_coordination', 'iaru_coordination_url',
|
||||
'itu_coordination'
|
||||
'itu_notification'
|
||||
]
|
||||
labels = {
|
||||
'downlink_low': _('Downlink freq.'),
|
||||
|
@ -58,7 +58,7 @@ class TransmitterUpdateForm(BSModalModelForm): # pylint: disable=too-many-ances
|
|||
'invert': _('Inverted Transponder?'),
|
||||
'iaru_coordination': _('IARU Coordination'),
|
||||
'iaru_coordination_url': _('IARU Coordination URL'),
|
||||
'itu_coordination': _('ITU Coordination URLs'),
|
||||
'itu_notification': _('ITU Notifications URLs'),
|
||||
}
|
||||
widgets = {
|
||||
'description': TextInput(),
|
||||
|
|
|
@ -14,6 +14,6 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name='transmitterentry',
|
||||
name='itu_coordination',
|
||||
field=models.JSONField(default=db.base.models.get_default_itu_coordination_field),
|
||||
field=models.JSONField(default=db.base.models.get_default_itu_notification_field),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 4.0.4 on 2022-05-24 07:55
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('base', '0053_remove_old_coordination_fields'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='transmitterentry',
|
||||
old_name='itu_coordination',
|
||||
new_name='itu_notification',
|
||||
),
|
||||
]
|
|
@ -102,8 +102,8 @@ def generate_sat_id():
|
|||
)
|
||||
|
||||
|
||||
def get_default_itu_coordination_field():
|
||||
"""Generate default value for itu_coordination field of TransmitterEntry model"""
|
||||
def get_default_itu_notification_field():
|
||||
"""Generate default value for itu_notification field of TransmitterEntry model"""
|
||||
return {'urls': []}
|
||||
|
||||
|
||||
|
@ -502,7 +502,7 @@ class TransmitterEntry(models.Model):
|
|||
help_text='URL for more details on this frequency coordination',
|
||||
validators=[URLValidator(schemes=['http', 'https'], regex=URL_REGEX)]
|
||||
)
|
||||
itu_coordination = models.JSONField(default=get_default_itu_coordination_field)
|
||||
itu_notification = models.JSONField(default=get_default_itu_notification_field)
|
||||
reviewer = models.ForeignKey(
|
||||
get_user_model(),
|
||||
related_name='reviewed_transmitters',
|
||||
|
|
|
@ -417,7 +417,7 @@ CSP_SCRIPT_SRC = config(
|
|||
'https://*.google-analytics.com,'
|
||||
'https://kit-free.fontawesome.com,'
|
||||
'https://kit.fontawesome.com,'
|
||||
"'sha256-hNUUO5rlLTL2RGoi1tx0HAeOoB/Zc30JmlfQDwIq358='," # transmitter_modal.js
|
||||
"'sha256-yCeVaKZLAqmSVRds/nIjWRwzlJK+K3lQOWM1wc5VP/M='," # transmitter_modal.js
|
||||
)
|
||||
CSP_IMG_SRC = config(
|
||||
'CSP_IMG_SRC',
|
||||
|
|
|
@ -69,17 +69,17 @@ function transmitter_suggestion_type(selection) {
|
|||
}
|
||||
|
||||
$(function () {
|
||||
// Initialize ITU Coordination URLs textarea and hide the JSON one
|
||||
$('textarea[name=\'itu_coordination\']').prop('readonly', true);
|
||||
// Initialize ITU Notifications URLs textarea and hide the JSON one
|
||||
$('textarea[name=\'itu_notification\']').prop('readonly', true);
|
||||
$('#itu-coordination-input-group').hide();
|
||||
var itu_urls = $.parseJSON($('textarea[name=\'itu_coordination\']').val())['urls'];
|
||||
$('textarea[name=\'itu_coordination_per_line\']').val(itu_urls.join('\n'));
|
||||
// Add event for changing JSON textarea when ITU Coordination URLs changes
|
||||
$('textarea[name=\'itu_coordination_per_line\']').on('change click', function(){
|
||||
var itu_coordination_json = $.parseJSON($('textarea[name=\'itu_coordination\']').val());
|
||||
var new_itu_urls = $('textarea[name=\'itu_coordination_per_line\']').val().split('\n');
|
||||
itu_coordination_json['urls'] = new_itu_urls;
|
||||
$('textarea[name=\'itu_coordination\']').val(JSON.stringify(itu_coordination_json));
|
||||
var itu_urls = $.parseJSON($('textarea[name=\'itu_notification\']').val())['urls'];
|
||||
$('textarea[name=\'itu_notification_per_line\']').val(itu_urls.join('\n'));
|
||||
// Add event for changing JSON textarea when ITU Notifications URLs changes
|
||||
$('textarea[name=\'itu_notification_per_line\']').on('change click', function(){
|
||||
var itu_notification_json = $.parseJSON($('textarea[name=\'itu_notification\']').val());
|
||||
var new_itu_urls = $('textarea[name=\'itu_notification_per_line\']').val().split('\n');
|
||||
itu_notification_json['urls'] = new_itu_urls;
|
||||
$('textarea[name=\'itu_notification\']').val(JSON.stringify(itu_notification_json));
|
||||
});
|
||||
// Initialize frequency drift fields and their events
|
||||
$('input[name=\'uplink_drift\']').prop('readonly', true);
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
</div>
|
||||
|
||||
{% for field in form %}
|
||||
{% if 'itu_coordination' in field.id_for_label %}
|
||||
{% if 'itu_notification' in field.id_for_label %}
|
||||
<div class="input-group my-1" data-toggle="tooltip" data-placement="bottom"
|
||||
title="ITU Coordination URLs each per line">
|
||||
title="ITU Notifications URLs, add one per line">
|
||||
<label class="input-group-prepend input-group-text" for="{{ field.id_for_label }}_per_line">{{ field.label }}</label>
|
||||
<textarea name="{{ field.name }}_per_line" placeholder="ITU Coordination URLs each per line" rows="3" wrap="off"
|
||||
<textarea name="{{ field.name }}_per_line" placeholder="ITU Notification URLs, add one per line" rows="3" wrap="off"
|
||||
class="form-control" id="{{ field.id_for_label }}_per_line"></textarea>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -42,7 +42,7 @@
|
|||
{% if field.help_text %}
|
||||
data-toggle="tooltip" data-placement="bottom" title="{{ field.help_text }}"
|
||||
{% endif %}
|
||||
{% if 'itu_coordination' in field.id_for_label %}
|
||||
{% if 'itu_notification' in field.id_for_label %}
|
||||
id="itu-coordination-input-group"
|
||||
{% endif %}
|
||||
>
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
</div>
|
||||
|
||||
{% for field in form %}
|
||||
{% if 'itu_coordination' in field.id_for_label %}
|
||||
{% if 'itu_notification' in field.id_for_label %}
|
||||
<div class="input-group my-1" data-toggle="tooltip" data-placement="bottom"
|
||||
title="ITU Coordination URLs each per line">
|
||||
title="ITU Notifications URLs, add one per line">
|
||||
<label class="input-group-prepend input-group-text" for="{{ field.id_for_label }}_per_line">{{ field.label }}</label>
|
||||
<textarea name="{{ field.name }}_per_line" placeholder="ITU Coordination URLs each per line" rows="3" wrap="off"
|
||||
<textarea name="{{ field.name }}_per_line" placeholder="ITU Notification URLs, add one per line" rows="3" wrap="off"
|
||||
class="form-control" id="{{ field.id_for_label }}_per_line"></textarea>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -42,7 +42,7 @@
|
|||
{% if field.help_text %}
|
||||
data-toggle="tooltip" data-placement="bottom" title="{{ field.help_text }}"
|
||||
{% endif %}
|
||||
{% if 'itu_coordination' in field.id_for_label %}
|
||||
{% if 'itu_notification' in field.id_for_label %}
|
||||
id="itu-coordination-input-group"
|
||||
{% endif %}
|
||||
>
|
||||
|
|
|
@ -126,10 +126,10 @@
|
|||
<dd class="col-sm-6">{{ transmitter.iaru_coordination }}</dd>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if transmitter.itu_coordination.urls %}
|
||||
<dt class="col-sm-6">ITU Coordination</dt>
|
||||
<dd class="col-sm-6"> ITU Coordinated
|
||||
{%for itu_url in transmitter.itu_coordination.urls %}
|
||||
{% if transmitter.itu_notification.urls %}
|
||||
<dt class="col-sm-6">ITU Notifications</dt>
|
||||
<dd class="col-sm-6"> ITU Notified
|
||||
{%for itu_url in transmitter.itu_notification.urls %}
|
||||
[<a href="{{ itu_url }}" target="_blank">Link {{ forloop.counter }}</a>]
|
||||
{% endfor %}
|
||||
</dd>
|
||||
|
|
Loading…
Reference in New Issue