flectra/addons/website/data/website_demo.xml

248 lines
11 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
2018-01-16 11:34:37 +01:00
<flectra>
<data>
<record id="base.main_company" model="res.company">
2018-01-16 11:34:37 +01:00
<field name="social_twitter">https://twitter.com/Flectra</field>
<field name="social_facebook">https://www.facebook.com/Flectra</field>
<field name="social_googleplus">https://plus.google.com/+Flectraapps</field>
<field name="social_linkedin">https://www.linkedin.com/company/flectra</field>
</record>
</data>
<data noupdate="1">
<!--
Some demo data for front-end server action generating templates
-->
<template id="template_partner_post" name="Partner Post and Thanks (Website Server Action Demo)">
<t t-call="website.layout">
<t t-set="additional_title">Partner Detail</t>
<div id="wrap">
<div class="oe_structure">
<section>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Thank you for posting a message !</h2>
</div>
</div>
</div>
</section>
</div>
</div>
</t>
</template>
<record id="action_partner_post" model="ir.actions.server">
<field name="name">Website: Partner Post and Thanks Demo</field>
<field name="website_published" eval="True"/>
<field name="website_path">partner_thanks</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="code">
partner = model
post_partner_id = request.params.get('partner_id')
post_body = request.params.get('body')
if post_partner_id:
try:
post_partner_id = int(post_partner_id)
except:
post_partner_id = False
if post_partner_id:
partner = model.browse(post_partner_id).exists()
if partner and post_body:
message = partner.message_post(body=post_body, subtype='mail.mt_comment')
values = {
'partner': partner,
}
response = request.website.render("website.template_partner_post", {'partner': partner})
</field>
<field name="state">code</field>
<field name="type">ir.actions.server</field>
</record>
<template id="template_partner_comment" name="Partner Comment (Website Server Action Demo)">
<t t-call="website.layout">
<t t-set="additional_title">Partners</t>
<div id="wrap">
<div class="oe_structure">
<section>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="text-center">Send a Message to our Partners</h1>
<h3 class="text-muted text-center">Discuss and Comments</h3>
</div>
</div>
</div>
</section>
</div>
<div class="container">
<div class="row">
<form class="form-horizontal" action="/website/action/website.action_partner_post" method="post">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="form-group">
<label class="col-sm-2 control-label">Recipient</label>
<div class="col-sm-10">
<select t-if="partners" name="partner_id" class="form-control">
<t t-foreach="partners" t-as="partner"><option t-att-value="partner.id" t-esc="partner.name"/></t>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Message</label>
<div class="col-sm-10">
<textarea name="body" rows="10" class="form-control"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">
Send <span class="fa fa-long-arrow-right"/>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</t>
</template>
<record id="action_partner_comment" model="ir.actions.server">
<field name="name">Website: Partners Comment Form</field>
<field name="website_published" eval="True"/>
<field name="website_path">partner_comment</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="code">
response = request.render("website.template_partner_comment", {
'partners': model.search([('customer', '=', True)]),
})
</field>
<field name="state">code</field>
<field name="type">ir.actions.server</field>
</record>
<record id="default_website" model="website">
<field name="name">Website localhost</field>
</record>
<record id="website2" model="website">
<field name="name">Website 0.0.0.0</field>
<field name="domain">0.0.0.0</field>
</record>
2018-07-13 11:51:12 +02:00
<record id="website2_homepage" model="ir.ui.view">
<field name="name">Home</field>
<field name="type">qweb</field>
<field name="key">website2.homepage</field>
<field name="arch" type="xml">
<t name="Home" priority="29" t-name="website2.homepage">
<t t-call="website.layout">
<div id="wrap" class="oe_structure oe_empty">
<div class="carousel slide mb32" id="myCarousel0" style="height: 320px;">
<ol class="carousel-indicators hidden">
<li class="active" data-slide-to="0" data-target="#myCarousel0"/>
</ol>
<div class="carousel-inner">
<div class="item image_text oe_img_bg active" style="background-image: url(http://0.0.0.0:8069/web/image/website.s_background_image_11);">
<div class="container">
<div class="row content">
<div class="carousel-content col-md-6 col-sm-12">
<h2>Homepage 0.0.0.0</h2>
<h3>Click to customize this text</h3>
<p>
<a class="btn btn-success btn-large" href="/contactus">Contact us</a>
</p>
</div>
<span class="carousel-img col-md-6 hidden-sm hidden-xs"> </span>
</div>
</div>
</div>
</div>
<div class="carousel-control left hidden" data-slide="prev" data-target="#myCarousel0" href="#myCarousel0" style="width: 10%">
<i class="fa fa-chevron-left"/>
</div>
<div class="carousel-control right hidden" data-slide="next" data-target="#myCarousel0" href="#myCarousel0" style="width: 10%">
<i class="fa fa-chevron-right"/>
</div>
</div>
</div>
</t>
</t>
</field>
</record>
<record id="website2_homepage_page" model="website.page">
<field name="website_published">True</field>
<field name="url">/</field>
<field name="view_id" ref="website2_homepage" />
<field name="website_ids" eval="[(4, ref('website2'))]" />
</record>
<record id="website2_contactus" model="ir.ui.view">
<field name="name">Contact Us</field>
<field name="type">qweb</field>
<field name="key">website2.contactus</field>
<field name="arch" type="xml">
<t name="Contact Us" t-name="website2.contactus">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure"/>
<div class="container">
<h1>Contact us</h1>
<div class="row">
<div class="col-md-8">
<div class="oe_structure">
<div>
<p>Contact us about anything related to our company or services.</p>
<p>We'll do our best to get back to you as soon as possible.</p>
</div>
</div>
<div class="text-center mt64" name="mail_button">
<a t-attf-href="mailto:{{ res_company.email }}" class="btn btn-primary" id="o_contact_mail">Send us an email</a>
</div>
</div>
<div class="col-md-4 mb32">
<t t-call="website.company_description"/>
</div>
</div>
</div>
<div class="oe_structure"/>
</div>
</t>
</t>
</field>
</record>
<record id="website2_contactus_page" model="website.page">
<field name="website_published">True</field>
<field name="url">/contactus</field>
<field name="view_id" ref="website2_contactus" />
<field name="website_ids" eval="[(4, ref('website2'))]" />
</record>
<!-- Menu & Homepage -->
<record id="website2" model="website">
<field name="homepage_id" ref="website2_homepage_page" />
</record>
<record id="website2_main_menu" model="website.menu">
<field name="name">Top Menu</field>
<field name="website_id" ref="website2"/>
</record>
<record id="website2_menu_homepage" model="website.menu">
<field name="name">Home</field>
<field name="url">/</field>
<field name="parent_id" ref="website.website2_main_menu"/>
<field name="sequence" type="int">10</field>
<field name="website_id" ref="website2"/>
<field name="page_id" ref="website2_homepage_page" />
</record>
<record id="website2_menu_contactus" model="website.menu">
<field name="name">Contact us</field>
<field name="url">/contactus</field>
<field name="parent_id" ref="website.website2_main_menu"/>
<field name="sequence" type="int">60</field>
<field name="website_id" ref="website2"/>
<field name="page_id" ref="website2_contactus_page" />
</record>
</data>
2018-01-16 11:34:37 +01:00
</flectra>