mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
fix!(portal): remove Homepage
This commit is contained in:
@@ -33,38 +33,6 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_homepage_section(section) %}
|
||||
|
||||
{% if section.section_based_on == 'Custom HTML' and section.section_html %}
|
||||
{{ section.section_html }}
|
||||
{% elif section.section_based_on == 'Cards' %}
|
||||
<section class="container my-5">
|
||||
<h3>{{ section.name }}</h3>
|
||||
|
||||
<div class="row">
|
||||
{% for card in section.section_cards %}
|
||||
<div class="col-md-{{ section.column_value }} mb-4">
|
||||
<div class="card h-100 justify-content-between">
|
||||
{% if card.image %}
|
||||
<img class="card-img-top h-75" src="{{ card.image }}" loading="lazy" alt="{{ card.title }}"></img>
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ card.title }}</h5>
|
||||
<p class="card-subtitle mb-2 text-muted">{{ card.subtitle or '' }}</p>
|
||||
<p class="card-text">{{ card.content or '' | truncate(140, True) }}</p>
|
||||
</div>
|
||||
<div class="card-body flex-grow-0">
|
||||
<a href="{{ card.route }}" class="card-link">{{ _('More details') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
{%- macro item_card(item, is_featured=False, is_full_width=False, align="Left") -%}
|
||||
{%- set align_items_class = resolve_class({
|
||||
'align-items-end': align == 'Right',
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/* csslint ignore:start */
|
||||
{% if homepage.hero_image %}
|
||||
.hero-image {
|
||||
background-size: cover;
|
||||
padding: 10rem 0;
|
||||
}
|
||||
{% endif %}
|
||||
/* csslint ignore:end */
|
||||
@@ -1,76 +0,0 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% from "erpnext/templates/includes/macros.html" import render_homepage_section %}
|
||||
|
||||
{% block content %}
|
||||
<main>
|
||||
{% if homepage.hero_section_based_on == 'Default' %}
|
||||
<section class="hero-section border-bottom {%if homepage.hero_image%}hero-image{%endif%}"
|
||||
{% if homepage.hero_image %}
|
||||
style="background-image: url('{{ homepage.hero_image }}');"
|
||||
{%- endif %}
|
||||
>
|
||||
<div class="container py-5">
|
||||
<h1 class="d-none d-sm-block display-4">{{ homepage.tag_line }}</h1>
|
||||
<h1 class="d-block d-sm-none">{{ homepage.tag_line }}</h1>
|
||||
<h2 class="d-none d-sm-block">{{ homepage.description }}</h2>
|
||||
<h3 class="d-block d-sm-none">{{ homepage.description }}</h3>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
{% elif homepage.hero_section_based_on == 'Slideshow' and slideshow %}
|
||||
<section class="hero-section">
|
||||
{% include "templates/includes/slideshow.html" %}
|
||||
</section>
|
||||
{% elif homepage.hero_section_based_on == 'Homepage Section' %}
|
||||
{{ render_homepage_section(homepage.hero_section_doc) }}
|
||||
{% endif %}
|
||||
|
||||
{% if homepage.products %}
|
||||
<section class="container section-products my-5">
|
||||
<h3>{{ _('Products') }}</h3>
|
||||
|
||||
<div class="row">
|
||||
{% for item in homepage.products %}
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card h-100 justify-content-between">
|
||||
<img class="card-img-top website-image-extra-large" src="{{ item.image }}" loading="lazy" alt="{{ item.item_name }}"></img>
|
||||
<div class="card-body flex-grow-0">
|
||||
<h5 class="card-title">{{ item.item_name }}</h5>
|
||||
<a href="{{ item.route }}" class="card-link">{{ _('More details') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if blogs %}
|
||||
<section class="container my-5">
|
||||
<h3>{{ _('Publications') }}</h3>
|
||||
|
||||
<div class="row">
|
||||
{% for blog in blogs %}
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ blog.title }}</h5>
|
||||
<p class="card-subtitle mb-2 text-muted">{{ _('By {0}').format(blog.blogger) }}</p>
|
||||
<p class="card-text">{{ blog.blog_intro }}</p>
|
||||
</div>
|
||||
<div class="card-body flex-grow-0">
|
||||
<a href="{{ blog.route }}" class="card-link">{{ _('Read blog') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% for section in homepage_sections %}
|
||||
{{ render_homepage_section(section) }}
|
||||
{% endfor %}
|
||||
</main>
|
||||
{% endblock %}
|
||||
@@ -1,49 +0,0 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
|
||||
no_cache = 1
|
||||
|
||||
|
||||
def get_context(context):
|
||||
homepage = frappe.get_cached_doc("Homepage")
|
||||
|
||||
homepage.title = homepage.title or homepage.company
|
||||
context.title = homepage.title
|
||||
context.homepage = homepage
|
||||
|
||||
if homepage.hero_section_based_on == "Homepage Section" and homepage.hero_section:
|
||||
homepage.hero_section_doc = frappe.get_cached_doc("Homepage Section", homepage.hero_section)
|
||||
|
||||
if homepage.slideshow:
|
||||
doc = frappe.get_cached_doc("Website Slideshow", homepage.slideshow)
|
||||
context.slideshow = homepage.slideshow
|
||||
context.slideshow_header = doc.header
|
||||
context.slides = doc.slideshow_items
|
||||
|
||||
context.blogs = frappe.get_all(
|
||||
"Blog Post",
|
||||
fields=["title", "blogger", "blog_intro", "route"],
|
||||
filters={"published": 1},
|
||||
order_by="modified desc",
|
||||
limit=3,
|
||||
)
|
||||
|
||||
# filter out homepage section which is used as hero section
|
||||
homepage_hero_section = (
|
||||
homepage.hero_section_based_on == "Homepage Section" and homepage.hero_section
|
||||
)
|
||||
homepage_sections = frappe.get_all(
|
||||
"Homepage Section",
|
||||
filters=[["name", "!=", homepage_hero_section]] if homepage_hero_section else None,
|
||||
order_by="section_order asc",
|
||||
)
|
||||
context.homepage_sections = [
|
||||
frappe.get_cached_doc("Homepage Section", name) for name in homepage_sections
|
||||
]
|
||||
|
||||
context.metatags = context.metatags or frappe._dict({})
|
||||
context.metatags.image = homepage.hero_image or None
|
||||
context.metatags.description = homepage.description or None
|
||||
Reference in New Issue
Block a user