Commit d2a34b57 authored by David Haynes's avatar David Haynes 🙆

HOTFIX: Add Shopmason requested features

- optional URL on alerts
- redo OpenTimeInlineAdmin
parent 7ac9c750
Pipeline #3955 passed with stage
in 1 minute and 8 seconds
......@@ -145,19 +145,24 @@ class FacilityAdmin(admin.ModelAdmin):
return initial_data
class OpenTimeInline(admin.StackedInline):
class OpenTimeInline(admin.TabularInline):
"""
A table of time periods that represent an "open time" for a Facility.
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.TabularInline
"""
# Columns correspond to each attribute in the OpenTime table
model = OpenTime
extra = 1
# 7 days of the week, so only have 7 rows
extra = 7
# We are basically reordering things to look nicer to the user here
fieldsets = (
(None, {"fields": (("start_day", "start_time"), ("end_day", "end_time"))}),
(None, {
'fields': (
('start_day', 'start_time'),
('end_day', 'end_time')
),
}),
)
......
# Generated by Django 2.0.10 on 2019-02-19 22:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0005_auto_20190129_1215'),
]
operations = [
migrations.AlterField(
model_name='alert',
name='url',
field=models.URLField(blank=True, verbose_name='Reference URL'),
),
]
......@@ -423,7 +423,7 @@ class Alert(TimeStampedModel):
# The text that is displayed that describes the Alert
subject = models.CharField(max_length=130)
body = models.TextField()
url = models.URLField("Reference URL", max_length=200)
url = models.URLField("Reference URL", max_length=200, blank=True)
# The date + time that the alert will be start being served
start_datetime = models.DateTimeField()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment