Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide save and add another button from edit.html if can_create is False #742

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions sqladmin/templates/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ <h3 class="card-title">Edit {{ model_view.name }}</h3>
<div class="btn-group flex-wrap" data-toggle="buttons">
<input type="submit" name="save" value="Save" class="btn">
<input type="submit" name="save" value="Save and continue editing" class="btn">
{% if model_view.save_as %}
<input type="submit" name="save" value="Save as new" class="btn">
{% else %}
<input type="submit" name="save" value="Save and add another" class="btn">
{% if model_view.can_create %}
{% if model_view.save_as %}
<input type="submit" name="save" value="Save as new" class="btn">
{% else %}
<input type="submit" name="save" value="Save and add another" class="btn">
{% endif %}
{% endif %}
</div>
</div>
Expand All @@ -55,4 +57,4 @@ <h3 class="card-title">Edit {{ model_view.name }}</h3>
</div>
</div>
</div>
{% endblock %}
{% endblock %}
Loading