fix: Keep action button size consistent

This commit is contained in:
Shariq Ansari 2022-08-17 18:11:18 +05:30
parent 615b27b675
commit f7942a4a8b
3 changed files with 15 additions and 15 deletions

View file

@ -81,11 +81,11 @@ export default class WebForm extends frappe.ui.FieldGroup {
}
$(".web-form-footer .web-form-actions .left-area").prepend(`
<button class="btn btn-default btn-previous btn-md mr-2">${__("Previous")}</button>
<button class="btn btn-default btn-previous btn-sm mr-2">${__("Previous")}</button>
`);
$(".web-form-footer .web-form-actions .right-area").prepend(`
<button class="btn btn-default btn-next btn-md">${__("Next")}</button>
<button class="btn btn-default btn-next btn-sm">${__("Next")}</button>
`);
$(".btn-previous").on("click", function () {
@ -399,7 +399,7 @@ export default class WebForm extends frappe.ui.FieldGroup {
render_success_page(data) {
if (this.allow_edit && data.name) {
$(".success-page").append(`
<a href="/${this.route}/${data.name}/edit" class="edit-button btn btn-light btn-md ml-2">
<a href="/${this.route}/${data.name}/edit" class="edit-button btn btn-default btn-md ml-2">
${__("Edit your response", null, "Button in web form")}
</a>
`);
@ -407,7 +407,7 @@ export default class WebForm extends frappe.ui.FieldGroup {
if (this.login_required && !this.allow_multiple && !this.show_list && data.name) {
$(".success-page").append(`
<a href="/${this.route}/${data.name}" class="view-button btn btn-light btn-md ml-2">
<a href="/${this.route}/${data.name}" class="view-button btn btn-default btn-md ml-2">
${__("View your response", null, "Button in web form")}
</a>
`);

View file

@ -137,7 +137,7 @@
justify-content: space-between;
.btn {
font-size: var(--font-size-base);
font-size: var(--text-base);
}
.center-area {

View file

@ -3,25 +3,25 @@
{% block breadcrumbs %}{% endblock %}
{% macro header_buttons() %}
{% if allow_edit and doc_name and not is_form_editable %}
<!-- edit button -->
<a href="/{{ route }}/{{ doc_name }}/edit" class="edit-button btn btn-default btn-sm">{{ _("Edit Response", null, "Button in web form") }}</a>
{% endif %}
{% if allow_print and not is_new %}
{% set print_format_url = "/printview?doctype=" + doc_type + "&name=" + doc_name + "&format=" + print_format %}
<!-- print button -->
<a href="{{ print_format_url }}" target="_blank" class="print-btn btn btn-light btn-sm ml-2">
<a href="{{ print_format_url }}" target="_blank" class="print-btn btn btn-default btn-sm ml-2">
<svg class="icon icon-sm"><use href="#icon-printer"></use></svg>
</a>
{% endif %}
{% if allow_edit and doc_name and not is_form_editable %}
<!-- edit button -->
<a href="/{{ route }}/{{ doc_name }}/edit" class="edit-button btn btn-primary btn-sm ml-2">{{ _("Edit", null, "Button in web form") }}</a>
{% endif %}
{% endmacro %}
{% macro action_buttons() %}
{% if is_new or is_form_editable %}
<div class="left-area">
<!-- clear button -->
<a href="/{{ path }}" class="clear-btn btn btn-light btn-md">
<a href="/{{ path }}" class="clear-btn btn btn-default btn-sm">
{% if is_form_editable %}
{{ _("Reset Form", null, "Button in web form") }}
{% else %}
@ -32,7 +32,7 @@
<div class="center-area paging"></div>
<div class="right-area">
<!-- submit button -->
<button type="submit" class="submit-btn btn btn-primary btn-md ml-2">{{ button_label or _("Submit", null, "Button in web form") }}</button>
<button type="submit" class="submit-btn btn btn-primary btn-sm ml-2">{{ button_label or _("Submit", null, "Button in web form") }}</button>
</div>
{% endif %}
{% endmacro %}
@ -133,10 +133,10 @@
</div>
{% else %}
{% if show_list %}
<a href="/{{ route }}/list" class="show-list-button btn btn-light btn-md mr-2">{{ _("See previous responses", null, "Button in web form") }}</a>
<a href="/{{ route }}/list" class="show-list-button btn btn-default btn-md mr-2">{{ _("See previous responses", null, "Button in web form") }}</a>
{% endif %}
{% if not login_required or allow_multiple %}
<a href="/{{ route }}/new" class="new-btn btn btn-light btn-md">{{ _("Submit another response", null, "Button in web form") }}</a>
<a href="/{{ route }}/new" class="new-btn btn btn-default btn-md">{{ _("Submit another response", null, "Button in web form") }}</a>
{% endif %}
{% endif %}
</div>