Skip to content

Commit

Permalink
Merge pull request #205 from antoinehq/ahq/submit-row-sticky
Browse files Browse the repository at this point in the history
Add stickyness to the submit button in the staffing tab
  • Loading branch information
digitalfox authored Jan 19, 2025
2 parents 4426666 + 1cb1a58 commit 82c6e7a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
15 changes: 11 additions & 4 deletions media/css/pydici.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,20 @@ h5 { font-size:1rem; }
font-weight: bold;
}


.submit-row.sticky {
position: sticky;
bottom: 0;
padding:0.5rem;
border-top: 1px solid #DDDDDD;
background-color: white;
}

/* submit form button sticky for mobile devices */
@media (max-width: 767px) {
.submit-row.sticky {
position: sticky;
bottom: 0;
padding:0.2rem 0 0.4rem 0;
background-color: white;
padding:0.2rem 0.2rem 0.4rem 0.2rem;
border-right: 1px solid #DDDDDD;
}
.submit-row.sticky > button[type=submit] {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion templates/core/pydici.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="description" content="pydici">
<meta name="author" content="Sebastien Renard">
<link rel="icon" type="image/png" href="{{ MEDIA_URL }}favicon-16x16.png" sizes="16x16">
Expand Down
4 changes: 2 additions & 2 deletions templates/staffing/consultant_staffing.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
{% endfor %}
</table>
</div>
<br />
<div class="submit-row">

<div class="submit-row sticky">
<button type='submit' class="btn btn-primary"><i class="bi bi-save"></i> {% trans 'Save' %}</button>
<a role="button" class="btn btn-primary button-link"
href="{% url 'staffing:optimise_pdc' %}?consultant_missions={{ consultant.id }}">
Expand Down
2 changes: 2 additions & 0 deletions templates/staffing/mission_staffing.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
{% if read_only %}
<em>{% trans "Note: you are not allowed to change mission staffing" %}</em>
{% else %}
<div class="submit-row sticky">
<button type='submit' class="btn btn-primary"><i class="bi-save"></i> {% trans 'Save' %}</button>
<a role="button" class="btn btn-primary button-link" href="{% url 'staffing:optimise_pdc' %}?missions={{ mission.id|unlocalize }}">
<i class="bi bi-gear"></i> {% trans "Optimize workload for this mission" %}
Expand All @@ -84,6 +85,7 @@
<a role="button" class="btn btn-primary button-link" href="{% url 'staffing:mission_staffing_shift' mission_id=mission.id shift=1 %}">
<i class="bi bi-box-arrow-right"></i> {% trans "Shift staffing one month" %}
</a>
</div>
{% endif %}
</form>
</div>
Expand Down

0 comments on commit 82c6e7a

Please sign in to comment.