feat: update layout and doctype for about us settings
This commit is contained in:
parent
e5b3a503bd
commit
c7a9d44899
5 changed files with 150 additions and 337 deletions
|
|
@ -2,7 +2,9 @@
|
|||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('About Us Settings', {
|
||||
refresh: function(frm) {
|
||||
|
||||
refresh: function (frm) {
|
||||
frm.set_intro(
|
||||
__(`Link for About Us Page is "/about".`),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,309 +1,104 @@
|
|||
{
|
||||
"allow_copy": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
"creation": "2013-03-19 12:02:15",
|
||||
"custom": 0,
|
||||
"description": "Settings for the About Us Page",
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "Other",
|
||||
"editable_grid": 0,
|
||||
"actions": [],
|
||||
"creation": "2013-03-19 12:02:15",
|
||||
"description": "Settings for the About Us Page",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Other",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"page_title",
|
||||
"company_introduction",
|
||||
"sb0",
|
||||
"company_history_heading",
|
||||
"company_history",
|
||||
"sb1",
|
||||
"team_members_heading",
|
||||
"team_members_subtitle",
|
||||
"team_members",
|
||||
"footer"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "help",
|
||||
"fieldtype": "HTML",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Help",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "<div class=\"alert\">Link for About Us Page is \"/about\"</div>",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"description": "Introduce your company to the website visitor.",
|
||||
"fieldname": "company_introduction",
|
||||
"fieldtype": "Text Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Company Introduction"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Introduce your company to the website visitor.",
|
||||
"fieldname": "company_introduction",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Company Introduction",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "sb0",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Org History"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "sb0",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Org History",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"description": "\"Company History\"",
|
||||
"fieldname": "company_history_heading",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Org History Heading"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "\"Company History\"",
|
||||
"fieldname": "company_history_heading",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Org History Heading",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "company_history",
|
||||
"fieldtype": "Table",
|
||||
"label": "Org History",
|
||||
"options": "Company History"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "company_history",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Org History",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company History",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "sb1",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Team Members"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "sb1",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Team Members",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"description": "\"Team Members\" or \"Management\"",
|
||||
"fieldname": "team_members_heading",
|
||||
"fieldtype": "Data",
|
||||
"label": "Team Members Heading"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "\"Team Members\" or \"Management\"",
|
||||
"fieldname": "team_members_heading",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Team Members Heading",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "team_members",
|
||||
"fieldtype": "Table",
|
||||
"label": "Team Members",
|
||||
"options": "About Us Team Member"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "team_members",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Team Members",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "About Us Team Member",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"description": "More content for the bottom of the page.",
|
||||
"fieldname": "footer",
|
||||
"fieldtype": "Text Editor",
|
||||
"label": "Footer"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "More content for the bottom of the page.",
|
||||
"fieldname": "footer",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Footer",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
"fieldname": "page_title",
|
||||
"fieldtype": "Data",
|
||||
"label": "Page Title"
|
||||
},
|
||||
{
|
||||
"fieldname": "team_members_subtitle",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Team Members Subtitle"
|
||||
}
|
||||
],
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"icon": "fa fa-group",
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-29 14:40:41.692119",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Website",
|
||||
"name": "About Us Settings",
|
||||
"owner": "Administrator",
|
||||
],
|
||||
"icon": "fa fa-group",
|
||||
"idx": 1,
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2020-10-12 13:26:20.277859",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Website",
|
||||
"name": "About Us Settings",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 0,
|
||||
"email": 1,
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 0,
|
||||
"role": "Website Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"create": 1,
|
||||
"email": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"role": "Website Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2020, Frappe Technologies and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestAboutUsSettings(unittest.TestCase):
|
||||
pass
|
||||
|
|
@ -1,52 +1,62 @@
|
|||
{% extends "templates/web.html" %}
|
||||
|
||||
{% set title = "About Us" %}
|
||||
{% block header %}<h1>About Us</h1>{% endblock %}
|
||||
{% block page_sidebar %}
|
||||
{% include "templates/includes/web_sidebar.html" %}
|
||||
{% endblock %}
|
||||
{% set default_intro = """<p>Some Introduction about your company that you would
|
||||
like your website visitor to know.
|
||||
More people than you think will read your About page.
|
||||
People always like to know who the are doing business with.
|
||||
Be authentic and avoid using jargon like 'value added services' etc.
|
||||
Be sure to update your company history and
|
||||
list of key team members in Website > About Us Settings</p>""" %}
|
||||
|
||||
{% set title = doc.page_title or _("About Us") %}
|
||||
{% block page_content %}
|
||||
|
||||
<article class="about-content">
|
||||
{{ doc.company_introduction or """<p>Some Introduction about your company that you would
|
||||
like your website visitor to know.
|
||||
More people than you think will read your About page.
|
||||
People always like to know who the are doing business with.
|
||||
Be authentic and avoid using jargon like 'value added services' etc.
|
||||
Be sure to update your company history and
|
||||
list of key team members in Website > About Us Settings</p>""" }}
|
||||
{{ web_block(
|
||||
'Hero',
|
||||
values={
|
||||
"title": doc.page_title or _("About Us"),
|
||||
"subtitle": doc.company_introduction or default_intro
|
||||
},
|
||||
add_container=0,
|
||||
add_top_padding=1,
|
||||
add_bottom_padding=1,
|
||||
) }}
|
||||
|
||||
|
||||
{% if doc.get({"doctype":"Company History"}) %}
|
||||
<div class="about-section">
|
||||
<h3>{{ doc.company_history_heading or "Company History" }}</h3>
|
||||
{% for d in doc.get({"doctype":"Company History"}) %}
|
||||
<div class="row">
|
||||
<span class="col-md-2"><h4 style="margin:0px;">{{ d.year }}</h4></span>
|
||||
<span class="col-md-10"><p>{{ d.highlight }}</p></span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<section class="section section-padding-bottom">
|
||||
<h2>{{ doc.company_history_heading or _("Company History") }}</h2>
|
||||
{% for d in doc.get({"doctype":"Company History"}) %}
|
||||
<div class="row">
|
||||
<span class="col-md-2">
|
||||
<h5>{{ d.year }}</h5>
|
||||
</span>
|
||||
<span class="col-md-8">
|
||||
<p>{{ d.highlight }}</p>
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if doc.get({"doctype":"About Us Team Member"}) %}
|
||||
<div class="about-section">
|
||||
<h3>{{ doc.team_members_heading or "Team Members" }}</h3>
|
||||
{% for d in doc.get({"doctype":"About Us Team Member"}) %}
|
||||
<div class="row" itemscope itemtype="http://schema.org/Person">
|
||||
<span class="col-md-2">
|
||||
<div class="avatar avatar-large">
|
||||
<img class="avatar" src="{{ d.image_link }}" style="" itemprop="image">
|
||||
<section class="section section-padding-bottom">
|
||||
<h2>{{ doc.team_members_heading or _("Team Members") }}</h2>
|
||||
<p>{{ doc.team_members_subtitle }}</p>
|
||||
<div class="row">
|
||||
{% for d in doc.get({"doctype":"About Us Team Member"}) %}
|
||||
<div class="col-md-2 mt-4" itemscope itemtype="http://schema.org/Person">
|
||||
<img class="card card-md w-100" src="{{ d.image_link }}" itemprop="image">
|
||||
<h5 class="mt-3" itemprop="name">{{ d.full_name }}</h5>
|
||||
<p class="small mt-2" itemprop="description">{{ d.bio }}</p>
|
||||
</div>
|
||||
</span>
|
||||
<span class="col-md-10"><h4 itemprop="name">{{ d.full_name }}</h4>
|
||||
<p itemprop="description">{{ d.bio }}</p>
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
<div class="about-footer">
|
||||
{{ doc.footer or "" }}
|
||||
</div>
|
||||
<section class="section section-padding-bottom">
|
||||
{{ doc.footer or "" }}
|
||||
</section>
|
||||
</article>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
@ -9,8 +9,4 @@ sitemap = 1
|
|||
def get_context(context):
|
||||
context.doc = frappe.get_doc("About Us Settings", "About Us Settings")
|
||||
|
||||
context.parents = [
|
||||
{ "name": frappe._("Home"), "route": "/" }
|
||||
]
|
||||
|
||||
return context
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue