SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 50fb6886 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

improve responsivity stream action buttons

parent ad8bb54c
No related branches found
No related tags found
1 merge request!43Polish up new production page
{% comment %} Only show something if the option is about to change {% endcomment %} {% comment %} Only show something if the option is about to change {% endcomment %}
{% if not current_option == new_option %} {% if not current_option == new_option %}
{% comment %} If selected option is None, it is being removed {% endcomment %} <div class="row m-0 d-none-empty">
{% if new_option == "None" %} {% comment %} If selected option is None, it is being removed {% endcomment %}
<button type="submit" class="btn btn-danger"> {% if new_option == "None" %}
Remove <button type="submit" class="btn btn-danger">Remove</button>
</button> {% comment %} Otherwise differentiate between changing or adding based on current option {% endcomment %}
{% comment %} Otherwise differentiate between changing or adding based on current option {% endcomment %}
{% else %}
<button type="submit" class="btn btn-primary">
{% if current_option == "None" %}
Add
{% else %} {% else %}
Change <button type="submit" class="btn btn-primary">
{% if current_option == "None" %}
Add
{% else %}
Change
{% endif %}
</button>
{% endif %} {% endif %}
</button> </div>
{% endif %}
{% endif %} {% endif %}
{% load bootstrap %} {% load bootstrap %}
{% if perms.scipost.can_take_decisions_related_to_proofs and form.fields.invitations_officer.choices|length > 0 %} {% if form.fields.invitations_officer.choices|length > 0 %}
<div id="productionstream-update-invitations_officer"> <div id="productionstream-{{ stream.id }}-update-invitations_officer">
<form hx-post="{% url 'production:update_invitations_officer' stream.id %}" <form hx-post="{% url 'production:update_invitations_officer' stream.id %}"
hx-target="#productionstream-update-invitations_officer" hx-target="#productionstream-{{ stream.id }}-update-invitations_officer"
hx-swap="outerHTML" hx-swap="outerHTML"
class="row"> class="row">
{% csrf_token %} {% csrf_token %}
<div class="col">{{ form|bootstrap_purely_inline }}</div> <div class="col">{{ form|bootstrap_purely_inline }}</div>
<div class="col-auto h-100" <div class="col-12 col-sm-auto col-md-12 col-lg-auto h-100 d-none-empty"
hx-post="{% url 'production:render_action_buttons' stream.id 'invitations_officer' %}" hx-post="{% url 'production:render_action_buttons' stream.id 'invitations_officer' %}"
hx-swap="innerHTML" hx-swap="innerHTML"
class="col-auto"
hx-trigger="change from:select#productionstream_{{ stream.id }}_id_invitations_officer" hx-trigger="change from:select#productionstream_{{ stream.id }}_id_invitations_officer"
hx-target="this"></div> hx-target="this"></div>
<div class="text-primary">{{ message }}</div> <div class="text-primary">{{ message }}</div>
......
{% load bootstrap %} {% load bootstrap %}
{% if perms.scipost.can_take_decisions_related_to_proofs and form.fields.officer.choices|length > 0 %} {% if form.fields.officer.choices|length > 0 %}
<div id="productionstream-update-officer"> <div id="productionstream-{{ stream.id }}-update-officer">
<form hx-post="{% url 'production:update_officer' stream.id %}" <form hx-post="{% url 'production:update_officer' stream.id %}"
hx-target="#productionstream-update-officer" hx-target="#productionstream-{{ stream.id }}-update-officer"
hx-swap="outerHTML" hx-swap="outerHTML"
class="row"> class="row">
{% csrf_token %} {% csrf_token %}
<div class="col">{{ form|bootstrap_purely_inline }}</div> <div class="col">{{ form|bootstrap_purely_inline }}</div>
<div class="col-auto h-100" <div class="col-12 col-sm-auto col-md-12 col-lg-auto h-100 d-none-empty"
hx-post="{% url 'production:render_action_buttons' stream.id 'officer' %}" hx-post="{% url 'production:render_action_buttons' stream.id 'officer' %}"
hx-swap="innerHTML" hx-swap="innerHTML"
class="col-auto"
hx-trigger="change from:select#productionstream_{{ stream.id }}_id_officer" hx-trigger="change from:select#productionstream_{{ stream.id }}_id_officer"
hx-target="this"></div> hx-target="this"></div>
<div class="text-primary">{{ message }}</div> <div class="text-primary">{{ message }}</div>
......
{% load bootstrap %} {% load bootstrap %}
{% if perms.scipost.can_take_decisions_related_to_proofs and form.fields.status.choices|length > 0 %} {% if form.fields.status.choices|length > 0 %}
<form id="productionstream-update-status" <form id="productionstream-{{ stream.id }}-update-status"
hx-post="{% url 'production:update_status' stream.id %}" hx-post="{% url 'production:update_status' stream.id %}"
hx-target="this" hx-target="this"
hx-swap="outerHTML" hx-swap="outerHTML"
class="row"> hx-trigger="submit, submit from:#productionstream-{{ productionstream.id }}-details target:form delay:500">
{% csrf_token %} {% csrf_token %}
<div class="col">{{ form|bootstrap_purely_inline }}</div> <div class="row">
<div class="col-auto h-100" <div class="col">{{ form|bootstrap_purely_inline }}</div>
hx-post="{% url 'production:render_action_buttons' stream.id 'status' %}" <div class="col-12 col-sm-auto col-md-12 col-lg-auto h-100 d-none-empty"
hx-swap="innerHTML" hx-post="{% url 'production:render_action_buttons' stream.id 'status' %}"
class="col-auto" hx-swap="innerHTML"
hx-trigger="load, change from:select#productionstream_{{ stream.id }}_id_status" hx-trigger="load, change from:select#productionstream_{{ stream.id }}_id_status"
hx-target="this"></div> hx-target="this"></div>
<div class="text-primary">{{ message }}</div> <div class="text-primary">{{ message }}</div>
</div>
</form> </form>
{% endif %} {% endif %}
{% load bootstrap %} {% load bootstrap %}
{% if perms.scipost.can_take_decisions_related_to_proofs and form.fields.supervisor.choices|length > 0 %} {% if form.fields.supervisor.choices|length > 0 %}
<div id="productionstream-update-supervisor"> <div id="productionstream-{{ stream.id }}-update-supervisor">
<form hx-post="{% url 'production:update_supervisor' stream.id %}" <form hx-post="{% url 'production:update_supervisor' stream.id %}"
hx-target="#productionstream-update-supervisor" hx-target="#productionstream-{{ stream.id }}-update-supervisor"
hx-swap="outerHTML" hx-swap="outerHTML"
class="row"> class="row">
{% csrf_token %} {% csrf_token %}
<div class="col">{{ form|bootstrap_purely_inline }}</div> <div class="col">{{ form|bootstrap_purely_inline }}</div>
<div class="col-auto h-100" <div class="col-12 col-sm-auto col-md-12 col-lg-auto h-100 d-none-empty"
hx-post="{% url 'production:render_action_buttons' stream.id 'supervisor' %}" hx-post="{% url 'production:render_action_buttons' stream.id 'supervisor' %}"
hx-swap="innerHTML" hx-swap="innerHTML"
class="col-auto"
hx-trigger="load, change from:select#productionstream_{{ stream.id }}_id_supervisor" hx-trigger="load, change from:select#productionstream_{{ stream.id }}_id_supervisor"
hx-target="this"></div> hx-target="this"></div>
<div class="text-primary">{{ message }}</div> <div class="text-primary">{{ message }}</div>
......
...@@ -209,4 +209,10 @@ $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value"); ...@@ -209,4 +209,10 @@ $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value");
&::-webkit-details-marker { &::-webkit-details-marker {
display: none; display: none;
} }
}
// Utilities for common display issues
// Hide div
.d-none-empty:empty {
display: none;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment