Files
odoo_source/addons/website/static/src/xml/website.editor.xml
T
Andrea Ulliana 59cc261448 [IMP] website, *: allow creating anchor links
* portal, web_editor

Anchor Link:
- Some visual improvements of the link dialog.
- New 'Page Anchor' field.
    - System by default: top and bottom.
    - Shows existing anchors.

Creation of the anchor:
- New option 'Anchor Name' to be able to create an anchor.

task-1913458

closes odoo/odoo#29150
2019-01-09 16:16:01 +00:00

97 lines
5.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<div t-name="website.homepage_editor_welcome_message" class="container text-center o_homepage_editor_welcome_message">
<h2 class="mt0">Welcome to your <b>Homepage</b>!</h2>
<p class="lead d-none d-md-block">Let's start designing.</p>
<div class="o_tooltip_container d-none d-md-block fade">Follow all the <div class="o_tooltip bottom"/> signs to get your website ready in no time.</div>
</div>
<div t-name="website.leaving_current_page_edition">
<p>What do you want to do?</p>
<p class="text-muted">Your current changes will be saved automatically.</p>
</div>
<div t-name="website.theme_customize_modal_layout" class="d-flex align-items-start">
<ul class="nav flex-column flex-shrink-0 w-25"/>
<div class="tab-content pl-3 pb-2 flex-grow-1"/>
</div>
<div t-name="website.theme_customize_modal_content" t-att-id="id" class="tab-pane">
<h5 class="mt-0"><t t-esc="title"/></h5>
<div class="form-row justify-content-between o_options_container"/>
</div>
<t t-name="website.theme_customize_modal_option">
<div t-attf-class="o_theme_customize_option my-1 flex-grow-0 #{font ? 'o_theme_customize_option_font_' + font : ''}">
<img t-if="icon" t-att-src="icon"/>
<label t-attf-class="#{widget ? 'd-none' : 'd-flex'} align-items-center justify-content-center text-center">
<input t-att-id="id" t-att-name="name" type="radio" class="o_theme_customize_option_input" t-att-data-xmlid="xmlid" t-att-data-enable="enable" t-att-data-disable="disable" t-att-data-reload="reload"/>
<span><t t-esc="string"/></span>
</label>
</div>
</t>
<t t-name="website.theme_customize_color_palette">
<div class="o_theme_customize_color_previews">
<div>
<h6>Main colors</h6>
<t t-foreach="{'primary': _t('Primary'), 'secondary': _t('Secondary'), 'alpha': _t('Primary'), 'beta': _t('Secondary'), 'gamma': _t('Extra Color'), 'delta': _t('Extra Color'), 'epsilon': _t('Extra Color')}" t-as="color">
<t t-call="website.theme_customize_color_palette_button">
<t t-set="color_type" t-value="'theme'"/>
</t>
</t>
</div>
<div>
<h6>Background colors</h6>
<t t-foreach="{'body': _t('Body'), 'menu': _t('Menus'), 'footer': _t('Footer')}" t-as="color">
<t t-call="website.theme_customize_color_palette_button"/>
</t>
</div>
<div>
<h6>Text colors</h6>
<t t-foreach="{'text': _t('Text'), 'h1': _t('Headings 1'), 'h2': _t('Headings 2'), 'h3': _t('Headings 3'), 'h4': _t('Headings 4'), 'h5': _t('Headings 5'), 'h6': _t('Headings 6')}" t-as="color">
<t t-call="website.theme_customize_color_palette_button"/>
</t>
</div>
<div>
<h6>State colors</h6>
<t t-foreach="{'success': _t('Success'), 'info': _t('Info'), 'warning': _t('Warning'), 'danger': _t('Error')}" t-as="color">
<t t-call="website.theme_customize_color_palette_button">
<t t-set="color_type" t-value="'theme'"/>
</t>
</t>
</div>
</div>
</t>
<t t-name="website.theme_customize_color_palette_button">
<button type="button"
t-attf-class="btn btn-secondary #{color == 'primary' or color == 'secondary' ? 'd-none' : 'd-flex'} align-items-center w-100 mt-2 justify-content-between o_theme_customize_color o_theme_customize_color_#{color}"
t-att-data-color="color"
t-att-data-color-type="color_type">
<span class="o_color_name"><t t-esc="color_value"/></span>
<span t-attf-class="o_color_preview bg-#{color}"/>
</button>
</t>
<t t-extend="web_editor.dialog.link">
<t t-jquery="#o_link_dialog_url_input" t-operation="after">
<small class="form-text">Hint: Type '/' to link to an existing page and '#' to an anchor.</small>
</t>
<t t-jquery="div.o_url_input" t-operation="after">
<div class="form-group row o_link_dialog_page_anchor d-none">
<label class="col-form-label col-md-3" for="o_link_dialog_anchor_input">Page Anchor</label>
<div class="col-md-9">
<select name="link_anchor" class="form-control link-style"></select>
<small class="form-text font-weight-bold o_anchors_loading">Loading...</small>
</div>
</div>
</t>
</t>
<!-- Anchor Name option dialog -->
<div t-name="website.dialog.anchorName">
<div class="form-group 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="#{currentAnchor}" placeholder="Anchor name"/>
<div class="invalid-feedback">The chosen name already exists</div>
</div>
</div>
</div>
</templates>