Skip to content

Commit

Permalink
Merge pull request #45 from ppfeufer/development
Browse files Browse the repository at this point in the history
Release 2.5.1
  • Loading branch information
ppfeufer authored Jan 17, 2021
2 parents f88455e + 4b90edc commit ad7bf87
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 47 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [2.5.1] - 2021-01-17

### Changed

- Set input field for formup time to `autocomplete="off"` so you don't have to fiddle
around to use the datetime picker anymore

### Fixed

- An issue where additionally configured ping targets wouldn't show up in the
dropdown (#44)


## [2.5.0] - 2021-01-12

### Added
Expand Down
2 changes: 1 addition & 1 deletion fleetpings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

default_app_config: str = "fleetpings.apps.AaFleetpingsConfig"

__version__ = "2.5.0"
__version__ = "2.5.1"
__title__ = "Fleet Pings"
Binary file modified fleetpings/docs/aa-view.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions fleetpings/migrations/0008_auto_20210114_1733.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 3.1.5 on 2021-01-14 17:33

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("fleetpings", "0007_mysql8_default_value_fixes_20201003_1232"),
]

operations = [
migrations.AlterField(
model_name="webhook",
name="url",
field=models.CharField(
help_text=(
"URL of this webhook, e.g. "
"https://discord.com/api/webhooks/123456/abcdef or "
"https://hooks.slack.com/services/xxxx/xxxx"
),
max_length=255,
unique=True,
),
),
]
12 changes: 7 additions & 5 deletions fleetpings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,19 +252,21 @@ def clean(self):
# get the group id from Discord
try:
discord_group_info = DiscordUser.objects.group_to_role(self.name)
except HTTPError:
except HTTPError as http_error:
raise ValidationError(
_("Are you sure you have your Discord linked to your Alliance Auth?")
)
) from http_error
else:
if not discord_group_info:
raise ValidationError(
_("This group has not been synched to Discord yet.")
_("This group has not been synced to Discord yet.")
)

super().clean()

def save(self):
def save(
self, force_insert=False, force_update=False, using=None, update_fields=None
):
"""
Add the Discord group ID and save the whole thing
"""
Expand Down Expand Up @@ -390,7 +392,7 @@ class Webhook(models.Model):
help_text=(
_(
"URL of this webhook, e.g. "
"https://discordapp.com/api/webhooks/123456/abcdef "
"https://discord.com/api/webhooks/123456/abcdef "
"or https://hooks.slack.com/services/xxxx/xxxx"
)
),
Expand Down
7 changes: 0 additions & 7 deletions fleetpings/templates/fleetpings/bundles/clipboard-js.html

This file was deleted.

6 changes: 3 additions & 3 deletions fleetpings/templates/fleetpings/form/fleetComms.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<div class="col-md-9">
<input id="fleetComms" name="fleetComms" type="text" class="form-control input-md" list="fleetCommsList">

{% if fleetComms|length > 0 %}
{% if fleet_comms|length > 0 %}
<datalist id="fleetCommsList">
{% for fleetComm in fleetComms %}
<option value="{{ fleetComm }}">
{% for fleet_comm in fleet_comms %}
<option value="{{ fleet_comm }}">
{% endfor %}
</datalist>
{% endif %}
Expand Down
10 changes: 5 additions & 5 deletions fleetpings/templates/fleetpings/form/fleetDoctrine.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<div class="col-md-9">
<input id="fleetDoctrine" name="fleetDoctrine" type="text" class="form-control input-md" list="fleetDoctrineList">

{% if fleetDoctrines|length > 0 %}
{% if fleet_doctrines|length > 0 %}
<datalist id="fleetDoctrineList">
{% for fleetDoctrine in fleetDoctrines %}
{% if useFleetDoctrines %}
<option value="{{ fleetDoctrine.name }}" data-doctrine-url="{{ request.scheme }}://{{ request.get_host }}{% url 'fittings:view_doctrine' fleetDoctrine.pk %}">
{% for fleet_doctrine in fleet_doctrines %}
{% if use_fleet_doctrines %}
<option value="{{ fleet_doctrine.name }}" data-doctrine-url="{{ request.scheme }}://{{ request.get_host }}{% url 'fittings:view_doctrine' fleet_doctrine.pk %}">
{% else %}
<option value="{{ fleetDoctrine.name }}" data-doctrine-url="{{ fleetDoctrine.link }}">
<option value="{{ fleet_doctrine.name }}" data-doctrine-url="{{ fleet_doctrine.link }}">
{% endif %}
{% endfor %}
</datalist>
Expand Down
10 changes: 5 additions & 5 deletions fleetpings/templates/fleetpings/form/fleetType.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<option value="StratOP" data-embed-color="#E67E22">{% translate "StratOP" %}</option>
<option value="CTA" data-embed-color="#E91E63">{% translate "CTA" %}</option>

{% if additionalFleetTypes|length > 0 %}
{% if additional_fleet_types|length > 0 %}
<option value="" disabled></option>
<optgroup label="{% translate 'Additionally configured fleet types' %}">
{% for fleetType in additionalFleetTypes %}
{% if fleetType.embed_color %}
<option value="{{ fleetType.name }}" data-embed-color="{{ fleetType.embed_color }}">{{ fleetType.name }}</option>
{% for fleet_type in additional_fleet_types %}
{% if fleet_type.embed_color %}
<option value="{{ fleet_type.name }}" data-embed-color="{{ fleet_type.embed_color }}">{{ fleet_type.name }}</option>
{% else %}
<option value="{{ fleetType.name }}" data-embed-color="#FAA61A">{{ fleetType.name }}</option>
<option value="{{ fleet_type.name }}" data-embed-color="#FAA61A">{{ fleet_type.name }}</option>
{% endif %}
{% endfor %}
</optgroup>
Expand Down
6 changes: 3 additions & 3 deletions fleetpings/templates/fleetpings/form/formupLocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<div class="col-md-9">
<input id="formupLocation" name="formupLocation" type="text" class="form-control input-md" list="formupLocationList">

{% if fleetFormupLocations|length > 0 %}
{% if fleet_formup_locations|length > 0 %}
<datalist id="formupLocationList">
{% for formupLocation in fleetFormupLocations %}
<option value="{{ formupLocation }}">
{% for formup_location in fleet_formup_locations %}
<option value="{{ formup_location }}">
{% endfor %}
</datalist>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion fleetpings/templates/fleetpings/form/formupTime.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="form-group clearfix">
<label class="col-md-3 control-label" for="formupTime">{% translate "Formup Time" %}<br><span class="small">{% translate "This is Eve Time" %}</span></label>
<div class="col-md-9">
<input id="formupTime" name="formupTime" type="text" class="form-control input-md" disabled>
<input id="formupTime" name="formupTime" type="text" class="form-control input-md" disabled autocomplete="off">
<span class="small">{% translate "To enable this field, either make it a Pre-Ping (checkbox above) or uncheck &quot;Formup NOW&quot; (checkbox below)." %}</span>
{% if timezones_installed %}
<span class="small">{% translate "Timezones module is installed. Link to time zone conversion will be added automatically if you set a date and time here." %}</span>
Expand Down
6 changes: 3 additions & 3 deletions fleetpings/templates/fleetpings/form/pingChannel.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load i18n %}

{% if additionalPingWebhooks|length > 0 %}
{% if additional_ping_webhooks|length > 0 %}
<div class="form-group clearfix">
<label class="col-md-3 control-label" for="pingChannel">{% translate "Ping Channel" %}<br><span class="small">{% translate "Select a channel to ping it automatically" %}</span></label>
<div class="col-md-9">
Expand All @@ -9,8 +9,8 @@
<option value="" disabled></option>

<optgroup label="Configured ping channels">
{% for pingWebhook in additionalPingWebhooks %}
<option value="{{ pingWebhook.url }}" data-webhook-type="{{ pingWebhook.type }}" data-webhook-embed="{{ pingWebhook.is_embedded }}">{{ pingWebhook.name }}</option>
{% for ping_webhook in additional_ping_webhooks %}
<option value="{{ ping_webhook.url }}" data-webhook-type="{{ ping_webhook.type }}" data-webhook-embed="{{ ping_webhook.is_embedded }}">{{ ping_webhook.name }}</option>
{% endfor %}
</optgroup>
</select>
Expand Down
8 changes: 4 additions & 4 deletions fleetpings/templates/fleetpings/form/pingTargets.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<select id="pingTarget" name="pingTarget" class="form-control">
<option value="">{% translate "Don't Ping" %}</option>

{% if platformUsed == 'Slack' %}
{% if platform_used == 'Slack' %}
<option value="@here">@here</option>
<option value="@channel">@channel</option>
{% else %}
<option value="@here">@here</option>
<option value="@everyone">@everyone</option>
{% endif %}

{% if additionalPingTargets|length > 0 and platformUsed == 'Discord' %}
{% if additional_discord_ping_targets|length > 0 and platform_used == 'Discord' %}
<option value="" disabled></option>
<optgroup label="{% translate 'Additionally configured ping targets' %}">
{% for pingTarget in additionalPingTargets %}
<option value="{{ pingTarget.discord_id }}">@{{ pingTarget.name }}</option>
{% for ping_target in additional_discord_ping_targets %}
<option value="{{ ping_target.discord_id }}">@{{ ping_target.name }}</option>
{% endfor %}
</optgroup>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions fleetpings/templates/fleetpings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<script type="application/javascript">
var fleetpingsTranslations = {
ping: {
success: '{% blocktrans context "%(usedPlatform)s is a variable that holds the current used platform. It can be either Slack or Discord. Do not translate it, just use it as it is." %}Success! Your ping has been sent to your {{ platformUsed }}.{% endblocktrans %}'
success: '{% blocktrans context "%(platform_used)s is a variable that holds the current used platform. It can be either Slack or Discord. Do not translate it, just use it as it is." %}Success! Your ping has been sent to your {{ platform_used }}.{% endblocktrans %}'
},
optimer: {
created: '{% translate 'Fleet operations timer has been created ...' %}'
Expand All @@ -40,7 +40,7 @@
},
copyToClipboard: {
error: '{% translate "Error! Your ping was not copied to your clipboard. Maybe your browser doesn&apos;t support this feature." %}',
success: '{% blocktrans context "%(usedPlatform)s is a variable that holds the current used platform. It can be either Slack or Discord. Do not translate it, just use it as it is." %}Success! Your ping text has been copied to your clipboard. Now be a good FC and throw it in your {{ platformUsed }} so you actually get some people in fleet.{% endblocktrans %}'
success: '{% blocktrans context "%(platform_used)s is a variable that holds the current used platform. It can be either Slack or Discord. Do not translate it, just use it as it is." %}Success! Your ping text has been copied to your clipboard. Now be a good FC and throw it in your {{ platform_used }} so you actually get some people in fleet.{% endblocktrans %}'
}
};
</script>
Expand Down
16 changes: 8 additions & 8 deletions fleetpings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,21 @@ def index(request: WSGIRequest) -> HttpResponse:

context = {
"title": __title__,
"additionalPingTargets": additional_discord_ping_targets,
"additionalFleetTypes": fleet_types,
"additionalPingWebhooks": webhooks,
"fleetComms": fleet_comms,
"fleetDoctrines": doctrines,
"fleetFormupLocations": formup_locations,
"additional_discord_ping_targets": additional_discord_ping_targets,
"additional_fleet_types": fleet_types,
"additional_ping_webhooks": webhooks,
"fleet_comms": fleet_comms,
"fleet_doctrines": doctrines,
"fleet_formup_locations": formup_locations,
"site_url": get_site_url(),
"timezones_installed": timezones_installed(),
"optimer_installed": optimer_installed(),
"use_new_timezone_links": use_new_timezone_links(),
"fittings_installed": fittings_installed(),
"main_character": request.user.profile.main_character,
"platform_used": platform_used,
"useFleetDoctrines": use_fleet_doctrines,
"avoidCdn": avoid_cdn(),
"use_fleet_doctrines": use_fleet_doctrines,
"avoid_cdn": avoid_cdn(),
"srp_module_installed": srp_module_installed(),
"srp_code": srp_code,
}
Expand Down

0 comments on commit ad7bf87

Please sign in to comment.