Ver a proveniência

Merge pull request #16171 from rmehta/footer-powered-config

feat(minor): added option to configure powered by in footer and max-height for text editors
version-14
Rushabh Mehta há 3 anos
committed by GitHub
ascendente
cometimento
4d96ece004
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: 4AEE18F83AFDEB23
4 ficheiros alterados com 21 adições e 5 eliminações
  1. +3
    -0
      frappe/public/js/frappe/form/controls/text_editor.js
  2. +5
    -1
      frappe/templates/includes/footer/footer_info.html
  3. +11
    -3
      frappe/website/doctype/website_settings/website_settings.json
  4. +2
    -1
      frappe/website/doctype/website_settings/website_settings.py

+ 3
- 0
frappe/public/js/frappe/form/controls/text_editor.js Ver ficheiro

@@ -88,6 +88,9 @@ frappe.ui.form.ControlTextEditor = class ControlTextEditor extends frappe.ui.for
make_quill_editor() { make_quill_editor() {
if (this.quill) return; if (this.quill) return;
this.quill_container = $('<div>').appendTo(this.input_area); this.quill_container = $('<div>').appendTo(this.input_area);
if (this.df.max_height) {
$(this.quill_container).css({'max-height': this.df.max_height, 'overflow': 'auto'});
}
this.quill = new Quill(this.quill_container[0], this.get_quill_options()); this.quill = new Quill(this.quill_container[0], this.get_quill_options());
this.bind_events(); this.bind_events();
} }


+ 5
- 1
frappe/templates/includes/footer/footer_info.html Ver ficheiro

@@ -12,7 +12,11 @@
{# powered #} {# powered #}
<div class="footer-col-right col-sm-6 col-12 footer-powered"> <div class="footer-col-right col-sm-6 col-12 footer-powered">
{% block powered %} {% block powered %}
{% include "templates/includes/footer/footer_powered.html" %}
{%- if footer_powered -%}
{{ footer_powered }}
{%- else -%}
{% include "templates/includes/footer/footer_powered.html" %}
{%- endif -%}
{% endblock %} {% endblock %}
</div> </div>
</div> </div>


+ 11
- 3
frappe/website/doctype/website_settings/website_settings.json Ver ficheiro

@@ -42,6 +42,7 @@
"copyright", "copyright",
"address", "address",
"footer_items", "footer_items",
"footer_powered",
"footer_template", "footer_template",
"footer_template_values", "footer_template_values",
"edit_footer_template_values", "edit_footer_template_values",
@@ -142,7 +143,6 @@
}, },
{ {
"collapsible": 1, "collapsible": 1,
"collapsible_depends_on": "top_bar_items",
"fieldname": "top_bar", "fieldname": "top_bar",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Navbar" "label": "Navbar"
@@ -189,7 +189,8 @@
"description": "Address and other legal information you may want to put in the footer.", "description": "Address and other legal information you may want to put in the footer.",
"fieldname": "address", "fieldname": "address",
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"label": "Address"
"label": "Address",
"max_height": "8rem"
}, },
{ {
"fieldname": "footer_items", "fieldname": "footer_items",
@@ -391,6 +392,7 @@
"label": "App Logo" "label": "App Logo"
}, },
{ {
"collapsible": 1,
"fieldname": "account_deletion_settings_section", "fieldname": "account_deletion_settings_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Account Deletion Settings" "label": "Account Deletion Settings"
@@ -406,6 +408,11 @@
"fieldname": "auto_account_deletion", "fieldname": "auto_account_deletion",
"fieldtype": "Int", "fieldtype": "Int",
"label": "Auto Account Deletion within (Days)" "label": "Auto Account Deletion within (Days)"
},
{
"fieldname": "footer_powered",
"fieldtype": "Small Text",
"label": "Footer \"Powered By\""
} }
], ],
"icon": "fa fa-cog", "icon": "fa fa-cog",
@@ -414,7 +421,7 @@
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"max_attachments": 10, "max_attachments": 10,
"modified": "2021-12-15 17:28:59.255184",
"modified": "2022-02-28 23:05:42.493192",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Website", "module": "Website",
"name": "Website Settings", "name": "Website Settings",
@@ -437,5 +444,6 @@
], ],
"sort_field": "modified", "sort_field": "modified",
"sort_order": "ASC", "sort_order": "ASC",
"states": [],
"track_changes": 1 "track_changes": 1
} }

+ 2
- 1
frappe/website/doctype/website_settings/website_settings.py Ver ficheiro

@@ -120,7 +120,8 @@ def get_website_settings(context=None):
"facebook_share", "google_plus_one", "twitter_share", "linked_in_share", "facebook_share", "google_plus_one", "twitter_share", "linked_in_share",
"disable_signup", "hide_footer_signup", "head_html", "title_prefix", "disable_signup", "hide_footer_signup", "head_html", "title_prefix",
"navbar_template", "footer_template", "navbar_search", "enable_view_tracking", "navbar_template", "footer_template", "navbar_search", "enable_view_tracking",
"footer_logo", "call_to_action", "call_to_action_url", "show_language_picker"]:
"footer_logo", "call_to_action", "call_to_action_url", "show_language_picker",
"footer_powered"]:
if hasattr(settings, k): if hasattr(settings, k):
context[k] = settings.get(k) context[k] = settings.get(k)




Carregando…
Cancelar
Guardar