diff --git a/templates/moderation/partials/submission_list.html b/templates/moderation/partials/submission_list.html index 4bce0e9b..baf6d609 100644 --- a/templates/moderation/partials/submission_list.html +++ b/templates/moderation/partials/submission_list.html @@ -1,145 +1,444 @@ +{% load moderation_tags %} {% for submission in submissions %}
{ + this.status = value; + }); + this.$watch('category', value => { + this.category = value; + this.showCoasterFields = value === 'RC'; + }); + } + }" @htmx:afterOnLoad="showSuccess = true; setTimeout(() => showSuccess = false, 3000)"> -
-
-

- - - {{ submission.get_status_display }} - - {{ submission.get_content_type_display }} - - {% if submission.submission_type == 'CREATE' %}New{% else %}Edit{% endif %} -

-
- - - {{ submission.user.username }} - - - - - {{ submission.created_at|date:"M d, Y H:i" }} - - {% if submission.handled_by %} - - - - Handled by {{ submission.handled_by.username }} - + +
+ +
+
+

+ + + {{ submission.get_status_display }} + +

+
+
+ + {{ submission.get_content_type_display }} - + {% if submission.submission_type == 'CREATE' %}New{% else %}Edit{% endif %} +
+
+ + {{ submission.user.username }} +
+
+ + {{ submission.created_at|date:"M d, Y H:i" }} +
+ {% if submission.handled_by %} +
+ + {{ submission.handled_by.username }} +
+ {% endif %} +
+
+
+ + +
+ {% if submission.content_object %} +
+
Current Object:
+
+ {{ submission.content_object }} + {% if submission.content_type.model == 'park' or submission.content_type.model == 'company' or submission.content_type.model == 'designer' %} +
+ {{ submission.content_object.address }} +
+ {% endif %} +
+
+ {% endif %} + + {% if submission.reason %} +
+
Reason:
+
{{ submission.reason }}
+
+ {% endif %} + + {% if submission.source %} + + {% endif %} + + +
+ {% for field, value in submission.changes.items %} + {% if field != 'model_name' %} +
+
+ {{ field|title }}: +
+
+ {% if field == 'opening_date' or field == 'closing_date' or field == 'status_since' %} + {{ value|date:"Y-m-d" }} + {% elif field == 'size_acres' %} + {{ value }} acres + {% elif field == 'website' %} + + {{ value }} + + {% elif field == 'park' %} + {% with park_name=value|get_object_name:'parks.Park' %} + {{ park_name }} + {% endwith %} + {% elif field == 'designer' %} + {% with designer_name=value|get_object_name:'designers.Designer' %} + {{ designer_name|default:'None' }} + {% endwith %} + {% elif field == 'manufacturer' %} + {% with manufacturer_name=value|get_object_name:'companies.Manufacturer' %} + {{ manufacturer_name|default:'None' }} + {% endwith %} + {% elif field == 'ride_model' %} + {% with model_name=value|get_object_name:'rides.RideModel' %} + {{ model_name|default:'None' }} + {% endwith %} + {% elif field == 'park_area' %} + {% with park_id=submission.changes.park %} + {{ value|get_park_area_name:park_id|default:'None' }} + {% endwith %} + {% elif field == 'category' %} + {{ value|get_category_display }} + {% elif field == 'stats' %} +
+ {% if value.height_ft %}
Height: {{ value.height_ft }} ft
{% endif %} + {% if value.length_ft %}
Length: {{ value.length_ft }} ft
{% endif %} + {% if value.speed_mph %}
Speed: {{ value.speed_mph }} mph
{% endif %} + {% if value.inversions %}
Inversions: {{ value.inversions }}
{% endif %} + {% if value.launch_type %}
Launch Type: {{ value.launch_type }}
{% endif %} + {% if value.track_material %}
Track Material: {{ value.track_material }}
{% endif %} + {% if value.roller_coaster_type %}
Type: {{ value.roller_coaster_type }}
{% endif %} + {% if value.trains_count %}
Number of Trains: {{ value.trains_count }}
{% endif %} + {% if value.cars_per_train %}
Cars per Train: {{ value.cars_per_train }}
{% endif %} + {% if value.seats_per_car %}
Seats per Car: {{ value.seats_per_car }}
{% endif %} +
+ {% else %} + {{ value }} + {% endif %} +
+
{% endif %} + {% endfor %}
-
-
- {% if submission.reason %} -
-
Reason:
-
{{ submission.reason }}
-
- {% endif %} + +
+ {% for field, value in submission.changes.items %} + {% if field != 'model_name' %} +
+ - {% if submission.source %} - - {% endif %} + {% if field == 'category' %} + +
+ {% if value == 'RC' %} + {% include 'moderation/partials/coaster_fields.html' with stats=submission.changes.stats %} + {% endif %} +
+ {% elif field == 'status' %} + + {% elif field == 'post_closing_status' %} + + {% elif field == 'opening_date' or field == 'closing_date' or field == 'status_since' %} + + {% else %} + + {% if field == 'park' %} +
+ +
+ +
+ {% elif field == 'manufacturer' %} +
+ +
+ +
+ {% elif field == 'designer' %} +
+ +
+ +
+ {% elif field == 'ride_model' %} +
+ +
+ +
+ {% elif field == 'description' %} + + {% elif field == 'min_height_in' or field == 'max_height_in' %} + + {% elif field == 'capacity_per_hour' %} + + {% elif field == 'ride_duration_seconds' %} + + {% else %} + + {% endif %} + {% endif %} +
+ {% endif %} + {% endfor %} -
- {% for field, value in submission.changes.items %} -
-
- {{ field|title }}: +
+ + +
+ +
+ + +
+ + + + {% if submission.notes %} +
+
Review Notes:
+
{{ submission.notes }}
-
- {{ value }} -
-
- {% endfor %} -
- - {% if submission.notes %} -
-
Review Notes:
-
{{ submission.notes }}
-
- {% endif %} - - {% if submission.status == 'NEW' or submission.status == 'ESCALATED' and user.role in 'ADMIN,SUPERUSER' %} -
-
- -
- -
- - - {% if submission.status != 'ESCALATED' or user.role in 'ADMIN,SUPERUSER' %} - - - {% endif %} - - {% if user.role == 'MODERATOR' and submission.status != 'ESCALATED' %} - + + {% if submission.status == 'PENDING' or submission.status == 'ESCALATED' and user.role in 'ADMIN,SUPERUSER' %} +
+
+ +
+ +
+ + + + + {% if submission.status != 'ESCALATED' or user.role in 'ADMIN,SUPERUSER' %} + + + + {% endif %} + + {% if user.role == 'MODERATOR' and submission.status != 'ESCALATED' %} + + {% endif %} +
+
{% endif %}
- {% endif %}
{% empty %}