Skip to content

Commit

Permalink
added block submit-row to allow extending the submit line, #1044
Browse files Browse the repository at this point in the history
  • Loading branch information
parsch committed Jan 16, 2024
1 parent ef0f5a4 commit ab39bed
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
3 changes: 2 additions & 1 deletion grappelli/sass/partials/layout/_changelist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ li.grp-changelist-actions {
}
}

.grp-submit-row.grp-fixed-footer>ul>li.grp-changelist-actions {
.grp-submit-row.grp-fixed-footer>ul>li.grp-changelist-actions,
.grp-submit-row.grp-fixed-footer>ul>div.grp-changelist-actions {
padding: 5px 0 !important;
}

Expand Down
6 changes: 4 additions & 2 deletions grappelli/sass/rtl.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ body.rtl {


// SUBMIT-ROW
.grp-submit-row>ul>li {
.grp-submit-row>ul>li,
.grp-submit-row>div>div {
float: left;
margin-left: 0;
margin-right: 10px;
Expand All @@ -129,7 +130,8 @@ body.rtl {
}
}

&.grp-login .grp-module.grp-submit-row ul li {
&.grp-login .grp-module.grp-submit-row ul li,
&.grp-login .grp-module.grp-submit-row>div>div {
float: left;
}

Expand Down
13 changes: 9 additions & 4 deletions grappelli/sass/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,14 @@ body.grp-change-form #grp-content-container>form>div {
border-radius: 0;
background: transparent;

>ul {
>ul,
>div {
margin-top: 10px;
overflow: visible;
@include clearfix;

>li {
>li,
>div {
@include horizontal-list-item(0, right);
margin-left: 10px;
border-radius: $grp-form-button-border-radius + 2px;
Expand Down Expand Up @@ -611,10 +613,13 @@ body.grp-change-form #grp-content-container>form>div {
min-width: auto;

&.grp-fixed-footer {
>ul {

>ul,
>div {
margin-top: 0;

>li {
>li,
>div {
margin-bottom: 5px;
padding: 5px !important;
background: #444;
Expand Down
2 changes: 1 addition & 1 deletion grappelli/static/grappelli/stylesheets/rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion grappelli/static/grappelli/stylesheets/screen.css

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions grappelli/templates/admin/submit_line.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
{% load i18n admin_urls %}
<footer class="grp-module grp-submit-row grp-fixed-footer">
<header style="display:none"><h1>Submit Options</h1></header>
<ul>
<div>
{% block submit-row %}
{% if show_delete_link %}
{% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
<li class="grp-float-left"><a href="{% add_preserved_filters delete_url %}" class="grp-button grp-delete-link">{% trans "Delete" %}</a></li>
<div class="grp-float-left"><a href="{% add_preserved_filters delete_url %}" class="grp-button grp-delete-link">{% trans "Delete" %}</a></div>
{% endif %}
{% if show_save %}
<li><input type="submit" value="{% trans 'Save' %}" class="grp-button grp-default" name="_save" /></li>
<div><input type="submit" value="{% trans 'Save' %}" class="grp-button grp-default" name="_save" /></div>
{% endif %}
{% if show_save_as_new %}
<li><input type="submit" value="{% trans 'Save as new' %}" class="grp-button" name="_saveasnew" /></li>
<div><input type="submit" value="{% trans 'Save as new' %}" class="grp-button" name="_saveasnew" /></div>
{% endif %}
{% if show_save_and_add_another %}
<li><input type="submit" value="{% trans 'Save and add another' %}" class="grp-button" name="_addanother" /></li>
<div><input type="submit" value="{% trans 'Save and add another' %}" class="grp-button" name="_addanother" /></div>
{% endif %}
{% if show_save_and_continue %}
<li><input type="submit" value="{% trans 'Save and continue editing' %}" class="grp-button" name="_continue" /></li>
<div><input type="submit" value="{% trans 'Save and continue editing' %}" class="grp-button" name="_continue" /></div>
{% endif %}
</ul>
{% endblock %}
</div>
</footer>

0 comments on commit ab39bed

Please sign in to comment.