flectra/addons/website_rating_project/views/website_rating_project.xml
2018-01-16 02:34:37 -08:00

132 lines
6.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<data>
<!-- CSS Style Bundle -->
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Website Rating Project Assets">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/website_rating_project/static/src/css/website_rating_project.css"/>
</xpath>
</template>
<!-- Layout add footer -->
<template id="header_footer_custom" inherit_id="website.footer_default" name="Project Rating Footer Link">
<xpath expr="//ul[@id='products']" position="inside">
<li><a href="/project/rating/">Project Customer Satisfaction</a></li>
</xpath>
</template>
<!-- Page : List of project -->
<template id="index" name="Project Rating List">
<t t-call="website.layout">
<t t-set="additional_title">Project Satisfaction</t>
<div id="wrap">
<div class="oe_structure"/>
<div class="container oe_website_rating_project">
<div class="row text-center">
<h2>Projects</h2>
</div>
<div class="oe_structure"/>
<div class="row">
<t t-foreach="projects" t-as="project">
<div t-if="project.percentage_satisfaction_project != -1" class="col-sm-6 col-xs-4 col-md-4 col-lg-4">
<div class="thumbnail">
<div>
<div class="caption">
<span class="label label-default pull-right"><t t-esc="project.privacy_visibility"/></span>
<h4><t t-esc="project.name"/></h4>
<p t-if="project.date" class="text-muted">
<i class="fa fa-calendar"/> End date : <t t-esc="project.date"/>
</p>
<p t-if="project.alias_name and project.alias_domain" class="text-muted">
<i class="fa fa-envelope"/> Email : <t t-esc="project.alias_name"/>@<t t-esc="project.alias_domain"/>
</p>
<div class="row">
<div class="col-md-6 text-center">
<h2><t t-esc="len(project.task_ids)"/></h2>
<p><t t-esc="project.label_tasks"/></p>
</div>
</div>
</div>
<div class="caption">
<p>
<a t-att-href="'/project/rating/%s' % project.id" class="btn btn-primary btn-lg btn-block">
<i class="fa fa-arrow-circle-right "/> See the feedbacks
</a>
</p>
</div>
</div>
</div>
</div>
</t>
</div>
</div>
<div class="oe_structure"/>
</div>
</t>
</template>
<!-- Page : Rating of a particular project -->
<template id="project_rating_data" name="Project Rating Page">
<div class="progress">
<div class="progress-bar progress-bar-success" t-attf-style="width: #{stats[duration][10]}%;" title="Happy">
<t t-esc="int(stats[duration][10])"/>%
</div>
<div class="progress-bar progress-bar-warning" t-attf-style="width: #{stats[duration][5]}%;" title="Average">
<t t-esc="int(stats[duration][5])"/>%
</div>
<div class="progress-bar progress-bar-danger" t-attf-style="width: #{stats[duration][1]}%;" title="Bad">
<t t-esc="int(stats[duration][1])"/>%
</div>
</div>
</template>
<template id="project_data_satisfaction">
<div class="row">
<div class="col-sm-4">
<h5>Last 7 days</h5>
<t t-set="duration" t-value="7"/>
<t t-set="stats" t-value="data['stats']"/>
<t t-call="website_rating_project.project_rating_data"/>
</div>
<div class="col-sm-4">
<h5>Last 30 days</h5>
<t t-set="duration" t-value="30"/>
<t t-set="stats" t-value="data['stats']"/>
<t t-call="website_rating_project.project_rating_data"/>
</div>
<div class="col-sm-4">
<h5>Last 3 months</h5>
<t t-set="duration" t-value="90"/>
<t t-set="stats" t-value="data['stats']"/>
<t t-call="website_rating_project.project_rating_data"/>
</div>
</div>
<h5 class="page-header">Latest Feedbacks</h5>
<t t-foreach="data['ratings']" t-as="rating" class="media">
<img t-attf-src='/rating/static/src/img/rating_#{int(rating.rating)}.png' t-att-alt="rating.res_name" t-att-title="rating.res_name"/>
</t>
</template>
<template id="project_rating_page" name="Project Rating Page">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure"/>
<div class="container oe_website_rating_project">
<h1 t-esc="project.name" class="text-center"/>
<div class="row mb32">
<div class="col-md-8">
<t t-set="type" t-value="'Tasks'"/>
<t t-set="data" t-value="task_data"/>
<t t-call="website_rating_project.project_data_satisfaction"/>
</div>
</div>
</div>
<div class="oe_structure"/>
</div>
</t>
</template>
</data>
</flectra>