mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
Add breadcrumbs, navbar and blog listing for bs4
This commit is contained in:
12
foundation/templates/includes/breadcrumbs.html
Normal file
12
foundation/templates/includes/breadcrumbs.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{% if parents and parents|length > 0 %}
|
||||
<ul class="breadcrumb mb-4" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
|
||||
{% for parent in parents %}
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{{ url_prefix }}{{ parent.route | abs_url }}" itemprop="url">
|
||||
<span itemprop="title">{{ parent.title or parent.label or parent.name or "" }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li class="breadcrumb-item active"><span itemprop="title">{{ title or "" }}</span></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
17
foundation/templates/includes/navbar/dropdown_items.html
Normal file
17
foundation/templates/includes/navbar/dropdown_items.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<ul class="nav-bar nav ml-auto mt-2 mt-lg-0">
|
||||
{% if top_bar_items -%}
|
||||
{%- for page in top_bar_items -%}
|
||||
{% if not page.parent_label and not page.right -%}
|
||||
{% include "templates/includes/navbar/navbar_link.html" %}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- for page in top_bar_items -%}
|
||||
{% if not page.parent_label and page.right -%}
|
||||
{% include "templates/includes/navbar/navbar_link.html" %}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
{% block navbar_right_extension %}{% endblock %}
|
||||
{% include "templates/includes/navbar/navbar_search.html" %}
|
||||
{% include "templates/includes/navbar/dropdown_login.html" %}
|
||||
</ul>
|
||||
17
foundation/templates/includes/navbar/dropdown_login.html
Normal file
17
foundation/templates/includes/navbar/dropdown_login.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!-- post login tools -->
|
||||
{% if not only_static %}
|
||||
{%- for child in post_login -%}
|
||||
<li {% if child.label %}data-label="{{ child.label }}" {% endif %}
|
||||
class="{% if child.class %} {{ child.class }} {% endif %} logged-in" >
|
||||
{%- if child.url -%}
|
||||
<a href="{{ child.url | abs_url }}" {{ child.target or '' }}
|
||||
rel="nofollow">
|
||||
{{ child.label }}
|
||||
</a>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
{% if not hide_login %}
|
||||
<li class="btn-login-area"><a href="/login">{{ _("Login") }}</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
12
foundation/templates/includes/navbar/navbar.html
Normal file
12
foundation/templates/includes/navbar/navbar.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<nav class="navbar navbar-expand-lg" role="navigation">
|
||||
<a class="navbar-brand ellipsis"
|
||||
href="{{ url_prefix }}{{ home_page or "/"}}">
|
||||
<span>{{ brand_html or (frappe.get_hooks("brand_html") or ["Home"])[0] }}</span>
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
{% include "templates/includes/navbar/navbar_items.html" %}
|
||||
</div>
|
||||
</nav>
|
||||
21
foundation/templates/includes/navbar/navbar_items.html
Normal file
21
foundation/templates/includes/navbar/navbar_items.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{% if top_bar_items -%}
|
||||
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
|
||||
{%- for page in top_bar_items -%}
|
||||
{% if not page.parent_label and not page.right -%}
|
||||
{% include "templates/includes/navbar/navbar_link.html" %}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{%- endif %}
|
||||
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
|
||||
{%- for page in top_bar_items -%}
|
||||
{% if not page.parent_label and page.right -%}
|
||||
{% include "templates/includes/navbar/navbar_link.html" %}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
{% if not only_static %}
|
||||
{% block navbar_right_extension %}{% endblock %}
|
||||
{% endif %}
|
||||
{% include "templates/includes/navbar/navbar_search.html" %}
|
||||
{% include "templates/includes/navbar/navbar_login.html" %}
|
||||
</ul>
|
||||
13
foundation/templates/includes/navbar/navbar_link.html
Normal file
13
foundation/templates/includes/navbar/navbar_link.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<li class="nav-item {% if page.child_items %} dropdown {% endif %}" data-label='{{ page.label }}'>
|
||||
<a {% if not page.child_items -%} class="nav-link" href="{{ (page.url or '')|abs_url }}" {%- endif %}
|
||||
{% if page.child_items %} class="nav-link dropdown-toggle" data-toggle="dropdown" id="navbarDropdown" role="button" aria-haspopup="true" aria-expanded="false" {% endif %}
|
||||
{{ page.target or ''}}>
|
||||
{{ page.label }}
|
||||
</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
{%- for child in page.child_items -%}
|
||||
<a class="dropdown-item" data-label='{{ child.label }}' href="{{ child.url | abs_url }}" {{ child.target or '' }}>{{ child.label }}</a>
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
25
foundation/templates/includes/navbar/navbar_login.html
Normal file
25
foundation/templates/includes/navbar/navbar_login.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!-- post login tools -->
|
||||
{% if not only_static %}
|
||||
<li class="nav-item dropdown logged-in" id="website-post-login"
|
||||
data-label="website-post-login" style="display: none">
|
||||
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="user-image-wrapper"></span>
|
||||
<span class="full-name"></span>
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
{%- for child in post_login -%}
|
||||
{%- if child.url -%}
|
||||
<a href="{{ child.url | abs_url }}" {{ child.target or '' }}
|
||||
rel="nofollow">
|
||||
{{ child.label }}
|
||||
</a>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
<a href="/desk">{{ _('Switch To Desk') }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{% if not hide_login %}
|
||||
<li class="nav-item btn-login-area"><a class="nav-link" href="/login">{{ _("Login") }}</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
9
foundation/templates/includes/navbar/navbar_search.html
Normal file
9
foundation/templates/includes/navbar/navbar_search.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% if navbar_search %}
|
||||
<li>
|
||||
<form action='/search'>
|
||||
<input name='q' class='form-control navbar-search' type='text'
|
||||
value='{{ frappe.form_dict.q or ''}}'
|
||||
{% if not frappe.form_dict.q%}placeholder="{{ _("Search...") }}"{% endif %}>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user