288 lines
16 KiB
XML
288 lines
16 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<templates id="template" xml:space="preserve">
|
|
<!-- Anchor Name option dialog -->
|
|
<t t-name="website.dialog.anchorName">
|
|
<Dialog title="this.title" size="'lg'" modalRef="this.modalRef">
|
|
<div class="mb-3 row">
|
|
<label class="col-form-label col-md-3" for="anchorName">Choose an anchor name</label>
|
|
<div class="col-md-9">
|
|
<input type="text" class="form-control o_input_anchor_name" id="anchorName"
|
|
t-attf-value="#{props.currentAnchor}" placeholder="Anchor name"/>
|
|
<div class="invalid-feedback">
|
|
<p class="d-none o_anchor_already_exists">The chosen name already exists</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<t t-set-slot="footer">
|
|
<button class="btn btn-primary" t-on-click="onClickConfirm">Save & copy</button>
|
|
<button class="btn btn-secondary" t-on-click="onClickDiscard">Discard</button>
|
|
<button t-if="props.delete" class="btn btn-link ms-auto" t-on-click="onClickDelete"><i class="fa fa-icon fa-trash"/>
|
|
Remove
|
|
</button>
|
|
</t>
|
|
</Dialog>
|
|
</t>
|
|
|
|
<!-- Add a Font option dialog -->
|
|
<t t-name="website.dialog.addFont.singlePreview">
|
|
<div class="row">
|
|
<label class="col-12" t-attf-style="font-weight: {{previewWeight}};" t-out="previewLabel"/>
|
|
</div>
|
|
<div class="mb-3 row">
|
|
<div class="col-11 offset-1" t-attf-style="font-family: '{{previewFontName}}';">
|
|
<input t-if="previewFontName" class="w-100 border-0 bg-transparent" t-model="state.previewText" t-attf-style="font-weight: {{previewWeight}};"/>
|
|
<input t-else="" class="w-100 border-0 bg-transparent" readonly="1" t-attf-style="font-weight: {{previewWeight}};"/>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
<t t-name="website.dialog.addFont.preview">
|
|
<div class="mb-3 row text-center">
|
|
<label class="col-12">
|
|
<t t-if="previewFontName">Preview of <t t-out="previewFontName"/></t>
|
|
<t t-else="">Preview</t>
|
|
</label>
|
|
</div>
|
|
<t t-call="website.dialog.addFont.singlePreview">
|
|
<t t-set="previewLabel">Light</t>
|
|
<t t-set="previewWeight">300</t>
|
|
</t>
|
|
<t t-call="website.dialog.addFont.singlePreview">
|
|
<t t-set="previewLabel">Regular</t>
|
|
<t t-set="previewWeight">400</t>
|
|
</t>
|
|
<t t-call="website.dialog.addFont.singlePreview">
|
|
<t t-set="previewLabel">Bold</t>
|
|
<t t-set="previewWeight">700</t>
|
|
</t>
|
|
</t>
|
|
<t t-name="website.dialog.addFont">
|
|
<Dialog title="this.props.title" size="'xl'">
|
|
<div class="row">
|
|
<div class="col-lg-7">
|
|
<!-- Google Font -->
|
|
<div class="mb-3 row">
|
|
<div class="col-form-label col-md-4">
|
|
<label for="google_font">Choose from list</label>
|
|
<div class="text-muted">Explore on <a target="_blank" href="https://fonts.google.com">fonts.google.com</a>.</div>
|
|
</div>
|
|
<div class="col-form-label col-md-8 o_field_widget">
|
|
<div class="o_input_dropdown">
|
|
<GoogleFontAutoComplete
|
|
value="state.googleFontFamily"
|
|
placeholder.translate="Select a Google Font..."
|
|
sources="getGoogleFontList"
|
|
onSelect.bind="onGoogleFontSelect"
|
|
/>
|
|
<span class="o_dropdown_button" />
|
|
</div>
|
|
</div>
|
|
<label class="col-form-label col-md-4" for="google_font_serve">
|
|
Serve font from Google servers
|
|
<sup class="text-info" title="To comply with some local regulations">
|
|
<a target="_blank" href="https://www.odoo.com/forum/help-1/how-to-use-google-fonts-and-respecting-german-requirements-214049">?</a>
|
|
</sup>
|
|
</label>
|
|
<label class="o_switch col-form-label col-md-8" t-att-class="{'o_switch_disabled': !state.googleFontFamily}" for="google_font_serve">
|
|
<input type="checkbox" checked="checked" t-att-disabled="!state.googleFontFamily" id="google_font_serve" t-model="state.googleServe"/>
|
|
<span/>
|
|
</label>
|
|
</div>
|
|
<hr/>
|
|
<!-- Upload font -->
|
|
<div class="mb-3 row">
|
|
<div class="col-form-label col-md-4">
|
|
<label for="upload_font">Custom Font</label>
|
|
<div class="text-muted">zip, ttf, woff, woff2, otf</div>
|
|
</div>
|
|
<div class="col-md-8">
|
|
<input t-ref="fileInput" type="file" class="form-control s_website_form_input" name="Custom Font"
|
|
id="upload_font" accept=".woff, .woff2, .ttf, .zip, .otf, font/*"
|
|
t-on-change="onUploadChange"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-5" style="border-left: var(--gray-300) solid 1px;">
|
|
<!-- Preview -->
|
|
<t t-call="website.dialog.addFont.preview">
|
|
<t t-if="state.googleFontFamily">
|
|
<t t-set="previewFontName" t-value="state.googleFontFamily"/>
|
|
</t>
|
|
<t t-elif="state.uploadedFonts.length">
|
|
<t t-set="previewFontName" t-value="state.uploadedFontName"/>
|
|
</t>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
<t t-set-slot="footer">
|
|
<button class="btn btn-primary" t-att-disabled="state.loading" t-on-click="onClickSave">
|
|
<t t-if="state.loading">
|
|
<i class="fa fa-icon fa-icon"/>
|
|
</t>
|
|
Save and Reload
|
|
</button>
|
|
<button class="btn btn-secondary" t-on-click="onClickCancel">Cancel</button>
|
|
</t>
|
|
</Dialog>
|
|
</t>
|
|
<t t-name="website.delete_font_btn">
|
|
<i t-if="!local" role="button" class="text-info me-2 fa fa-cloud" title="This font is hosted and served to your visitors by Google servers"/>
|
|
<t t-set="delete_font_title">Delete this font</t>
|
|
<i role="button"
|
|
class="text-danger fa fa-trash-o o_we_delete_font_btn me-2"
|
|
t-att-aria-label="delete_font_title"
|
|
t-att-title="delete_font_title"
|
|
t-att-data-local-font="local"
|
|
t-att-data-font-index="index"/>
|
|
</t>
|
|
<t t-name="website.add_font_btn">
|
|
<we-button href="#" class="o_we_add_font_btn"
|
|
t-att-data-variable="variable">
|
|
Add a Custom Font
|
|
</we-button>
|
|
</t>
|
|
|
|
<t t-name="website.color_combination_edition">
|
|
<we-colorpicker string="Background" data-customize-website-layer2-color="null"
|
|
t-attf-data-layer-color="o-cc#{number}-bg"
|
|
t-attf-data-layer-gradient="o-cc#{number}-bg-gradient"
|
|
data-loader-on-option-panel="true"
|
|
data-no-bundle-reload="true" data-with-gradients="true"/>
|
|
<we-colorpicker string="Text" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-text"/>
|
|
<we-collapse>
|
|
<we-colorpicker string="Headings" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-headings"/>
|
|
<we-colorpicker string="Headings 2" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-h2"/>
|
|
<we-colorpicker string="Headings 3" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-h3"/>
|
|
<we-colorpicker string="Headings 4" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-h4"/>
|
|
<we-colorpicker string="Headings 5" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-h5"/>
|
|
<we-colorpicker string="Headings 6" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-h6"/>
|
|
</we-collapse>
|
|
<we-colorpicker string="Links" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-link"/>
|
|
<we-row string="Primary Buttons">
|
|
<we-colorpicker title="Background" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-btn-primary"/>
|
|
<we-colorpicker title="Border" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-btn-primary-border"/>
|
|
</we-row>
|
|
<we-row string="Secondary Buttons">
|
|
<we-colorpicker title="Background" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-btn-secondary"/>
|
|
<we-colorpicker title="Border" data-customize-website-color="null" t-attf-data-color="o-cc#{number}-btn-secondary-border"/>
|
|
</we-row>
|
|
</t>
|
|
<t t-name="website.s_google_map_modal">
|
|
<Dialog title="props.title" size="'md'" modalRef="modalRef">
|
|
<p>Use Google Map on your website (Contact Us page, snippets, etc).</p>
|
|
<div class="row mb-0">
|
|
<label class="col-sm-2 col-form-label" for="pin_address">API Key</label>
|
|
<div class="col">
|
|
<div class="input-group">
|
|
<div class="input-group-text"><i class="fa fa-key"/></div>
|
|
<input type="text" class="form-control" id="api_key_input"
|
|
t-model="this.state.apiKey"
|
|
placeholder="BSgzTvR5L1GB9jriT451iTN4huVPxHmltG6T6eo"/>
|
|
</div>
|
|
<small id="api_key_help" class="text-danger">
|
|
</small>
|
|
<div class="small form-text text-muted">
|
|
Hint: How to use Google Map on your website (Contact Us page and as a snippet)
|
|
<br/>
|
|
<a target="_blank" href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend,static_maps_backend&keyType=CLIENT_SIDE&reusekey=true">
|
|
<i class="oi oi-arrow-right"/>
|
|
Create a Google Project and Get a Key
|
|
</a>
|
|
<br/>
|
|
<a target="_blank" href="https://cloud.google.com/maps-platform/pricing">
|
|
<i class="oi oi-arrow-right"/>
|
|
Enable billing on your Google Project
|
|
</a>
|
|
</div>
|
|
<div class="alert alert-info mb-0 mt-3">
|
|
Make sure your settings are properly configured:
|
|
<ul class="mb-0">
|
|
<li>
|
|
Enable the right google map APIs in your google account
|
|
<ul>
|
|
<li>Maps Static API</li>
|
|
<li>Maps JavaScript API</li>
|
|
<li>Places API</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
Make sure billing is enabled
|
|
</li>
|
|
<li>
|
|
Make sure to wait if errors keep being shown: sometimes enabling an API allows to use it immediately but Google keeps triggering errors for a while
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<t t-set-slot="footer">
|
|
<button t-on-click="onClickSave" class="btn btn-primary">Save</button>
|
|
<button class="btn" t-on-click="() => this.props.close()">Cancel</button>
|
|
</t>
|
|
</Dialog>
|
|
</t>
|
|
|
|
<!-- Theme - custom code -->
|
|
<t t-name="website.s_embed_code_dialog">
|
|
<Dialog title="props.title">
|
|
<p class="h5">Do not copy/paste code you do not understand, this could put your data at risk.</p>
|
|
<p>
|
|
<button class="btn btn-link ps-0" t-on-click="onInjectHeadOrBody">
|
|
If you need to add analytics or marketing tags, inject code in your <head> or <body> instead.
|
|
</button>
|
|
</p>
|
|
<CodeEditor mode="props.mode"
|
|
class="'o_website_code_editor_field'"
|
|
theme="'monokai'"
|
|
onChange.bind="onCodeChange"
|
|
value="this.state.value"/>
|
|
<t t-set-slot="footer">
|
|
<button class="btn btn-primary" t-on-click="onConfirm">Save</button>
|
|
<button class="btn" t-on-click="this.props.close">Discard</button>
|
|
</t>
|
|
</Dialog>
|
|
</t>
|
|
|
|
<t t-name="website.SnippetsMenu" t-inherit="web_editor.SnippetsMenu" t-inherit-mode="primary">
|
|
<xpath expr="//button[@data-action='cancel']" position="before">
|
|
<button t-on-click="_onMobilePreviewClick" type="button" class="btn btn-secondary" data-action="mobile" title="Mobile Preview" accesskey="v"><span class="fa fa-mobile"/></button>
|
|
</xpath>
|
|
<xpath expr="//div[@id='snippets_menu']" position="inside">
|
|
<button type="button" tabindex="3" class="o_we_customize_theme_btn text-uppercase"
|
|
t-att-class="{ 'active': state.currentTab === constructor.tabs.THEME }"
|
|
t-on-click="_onThemeTabClick"
|
|
t-if="isDesigner" accesskey="2">
|
|
<span>Theme</span>
|
|
</button>
|
|
</xpath>
|
|
<xpath expr="//we-customizeblock-options[@id='o_we_editor_toolbar_container']/we-title/span" position="after">
|
|
<we-button class="fa fa-fw o_we_link o_we_highlight_animated_text"
|
|
t-attf-class="#{state.animatedTextHighlighted ? 'fa-eye text-success' : 'fa-eye-slash'}"
|
|
title="Highlight Animated Text"
|
|
t-if="state.hasAnimatedText"
|
|
t-on-click="_onHighlightAnimatedTextClick"
|
|
aria-label="Highlight Animated Text">
|
|
</we-button>
|
|
</xpath>
|
|
<xpath expr="//Toolbar" position="inside">
|
|
<div id="animate" class="btn-group">
|
|
<div title="Animate text" class="btn o_we_animate_text"
|
|
t-att-class="{ 'active': state.isTextAnimated }"
|
|
t-on-click="_onAnimateTextClick">
|
|
<span class="fa fa-play fa-fw"></span>
|
|
<span>Animate</span>
|
|
</div>
|
|
</div>
|
|
<div id="highlight" class="btn-group">
|
|
<div title="Add Text Highlight Effects"
|
|
class="btn o_we_text_highlight"
|
|
t-att-class="{ 'active': state.isTextHighlighted }"
|
|
t-on-click.stop="_onTextHighlightClick">
|
|
<span class="oi oi-text-effect oi-fw"></span>
|
|
<span>Highlight</span>
|
|
</div>
|
|
</div>
|
|
</xpath>
|
|
</t>
|
|
</templates>
|