You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
168 lines
10 KiB
168 lines
10 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<!--Project Kanban View Template-->
|
|
<template id="project_kanban_view_template" name="Kanban View">
|
|
<t t-if="viewtype =='kanban'">
|
|
<t t-if="page_name == 'project'">
|
|
<section class="section-Kanban-view w-100 float-left kanban-container">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="container-projects pl-5 pr-5 float-left w-100">
|
|
<div class="row">
|
|
<t t-foreach="projects" t-as="project">
|
|
<div class="col-lg-3 mb-4">
|
|
<div class="project-container w-100 float-left p-3">
|
|
<h6>
|
|
<a t-attf-href="/my/projects/#{project.id}?{{ keep_query() }}">
|
|
<t t-esc="project.name"/>
|
|
</a>
|
|
</h6>
|
|
<div class="tasks">
|
|
<a t-attf-href="/my/projects/#{project.id}?{{ keep_query() }}">
|
|
<t t-out="project.task_count"/>
|
|
Tasks
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</t>
|
|
</t>
|
|
</template>
|
|
<!--Inheriting the Searchbar to add kanban and task icon-->
|
|
<template id="kanban_view_template_inherit" inherit_id="portal.portal_searchbar">
|
|
<xpath expr="//nav" position="replace">
|
|
<div>
|
|
<t t-if="page_name == 'project' or page_name == 'task'">
|
|
<div class="container-view float-right w-10">
|
|
<div class="mt-3 mb-3 list-view-icon">
|
|
<a t-att-href="default_url + '?' + keep_query('*', viewtype='list')">
|
|
<img class="w-100"
|
|
src="/project_website_kanban_view/static/src/images/img-list-view.png"/>
|
|
</a>
|
|
</div>
|
|
<div class="mt-3 mb-3 thumbnail-view-icon mr-2">
|
|
<a t-att-href="default_url + '?' + keep_query('*', viewtype='kanban')">
|
|
<img class="w-100"
|
|
src="/project_website_kanban_view/static/src/images/img-thumbnail-view.png"/>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
<nav t-attf-class="navbar navbar-expand-lg flex-wrap mb-4 p-0 o_portal_navbar {{classes if classes else ''}}" style="width:100%;">
|
|
<!-- Navbar breadcrumb or title -->
|
|
<t t-if="breadcrumbs_searchbar">
|
|
<t t-call="portal.portal_breadcrumbs"/>
|
|
</t>
|
|
<span t-else="" class="navbar-brand mb-0 h1 me-auto" t-esc="title or 'No title'"/>
|
|
|
|
<!-- Collapse button -->
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
|
|
data-bs-target="#o_portal_navbar_content" aria-controls="navbarSupportedContent"
|
|
aria-expanded="false" aria-label="Toggle filters">
|
|
<span class="fa fa-fw fa-bars"/>
|
|
</button>
|
|
|
|
<!-- Collapsable content -->
|
|
<div class="collapse navbar-collapse flex-wrap-reverse justify-content-end gap-3"
|
|
id="o_portal_navbar_content">
|
|
<div class="nav flex-column flex-sm-row gap-2 ms-auto p-0 mb-3 mb-lg-0 mt-1 mt-lg-0">
|
|
<div t-if="searchbar_sortings">
|
|
<span class="small me-1 navbar-text">Sort By:</span>
|
|
<div class="btn-group">
|
|
<button id="portal_searchbar_sortby" data-bs-toggle="dropdown"
|
|
class="btn btn-secondary dropdown-toggle">
|
|
<t t-esc="searchbar_sortings[sortby].get('label', 'Newest')"/>
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-end"
|
|
aria-labelledby="portal_searchbar_sortby">
|
|
<t t-foreach="searchbar_sortings" t-as="option">
|
|
<a t-att-href="request.httprequest.path + '?' + keep_query('*', sortby=option)"
|
|
t-attf-class="dropdown-item#{sortby == option and ' active' or ''}">
|
|
<span t-esc="searchbar_sortings[option].get('label')"/>
|
|
</a>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div t-if="searchbar_filters" class="ms-lg-2">
|
|
<span class="small me-1 navbar-text">Filter By:</span>
|
|
<div class="btn-group">
|
|
<button id="portal_searchbar_filters" data-bs-toggle="dropdown"
|
|
class="btn btn-secondary dropdown-toggle">
|
|
<t t-esc="searchbar_filters.get(filterby,searchbar_filters.get('all')).get('label', 'All')"/>
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-end"
|
|
aria-labelledby="portal_searchbar_filters">
|
|
<t t-foreach="searchbar_filters" t-as="option">
|
|
<a t-att-href="default_url + '?' + keep_query('*', filterby=option)"
|
|
t-attf-class="dropdown-item#{filterby == option and ' active' or ''}">
|
|
<span t-esc="searchbar_filters[option].get('label')"/>
|
|
</a>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div t-if="searchbar_groupby" class="ms-lg-2">
|
|
<span class="small me-1 navbar-text">Group By:</span>
|
|
<div class="btn-group">
|
|
<button id="portal_searchbar_groupby" data-bs-toggle="dropdown"
|
|
class="btn btn-secondary dropdown-toggle">
|
|
<t t-esc="searchbar_groupby[groupby].get('label', 'None')"/>
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-end"
|
|
aria-labelledby="portal_searchbar_groupby">
|
|
<t t-foreach="searchbar_groupby" t-as="option">
|
|
<a t-att-href="default_url + '?' + keep_query('*', groupby=option)"
|
|
t-attf-class="dropdown-item#{groupby == option and ' active' or ''}">
|
|
<span t-esc="searchbar_groupby[option].get('label')"/>
|
|
</a>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<t t-out="0"/>
|
|
</div>
|
|
<form t-if="searchbar_inputs" class="o_portal_search_panel col-md-5 col-xl-4 ms-lg-2">
|
|
<div class="input-group w-100">
|
|
<button type="button" class="btn btn-secondary border-end dropdown-toggle"
|
|
data-bs-toggle="dropdown"/>
|
|
<div class="dropdown-menu dropdown-menu-end" role="menu">
|
|
<t t-foreach='searchbar_inputs' t-as='input'>
|
|
<a t-att-href="'#' + input_value['input']"
|
|
t-attf-class="dropdown-item#{search_in == input_value['input'] and ' active' or ''}">
|
|
<span t-out="input_value['label']"/>
|
|
</a>
|
|
</t>
|
|
</div>
|
|
<input type="text" class="form-control" placeholder="Search" t-att-value='search'
|
|
name="search"/>
|
|
<button class="btn btn-secondary o_wait_lazy_js" type="submit">
|
|
<span class="oi oi-search"/>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
</xpath>
|
|
</template>
|
|
<!--Adding an attribute viewtype to the list view table and also add the Project kanban view Template-->
|
|
<template id="list_view_template_inherit" inherit_id="portal.portal_table">
|
|
<xpath expr="//table[hasclass('o_portal_my_doc_table')]"
|
|
position="attributes">
|
|
<attribute name="t-if">viewtype != 'kanban'</attribute>
|
|
</xpath>
|
|
<xpath expr="//table[hasclass('o_portal_my_doc_table')]"
|
|
position="before">
|
|
<t t-call="project_website_kanban_view.project_kanban_view_template"/>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|
|
|