diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/website_twitter/views | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/website_twitter/views')
| -rw-r--r-- | addons/website_twitter/views/res_config_settings_views.xml | 61 | ||||
| -rw-r--r-- | addons/website_twitter/views/website_twitter_snippet_templates.xml | 37 |
2 files changed, 98 insertions, 0 deletions
diff --git a/addons/website_twitter/views/res_config_settings_views.xml b/addons/website_twitter/views/res_config_settings_views.xml new file mode 100644 index 00000000..d3e51201 --- /dev/null +++ b/addons/website_twitter/views/res_config_settings_views.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="res_config_settings_view_form" model="ir.ui.view"> + <field name="name">res.config.settings.view.form.inherit.website.twitter</field> + <field name="model">res.config.settings</field> + <field name="inherit_id" ref="website.res_config_settings_view_form"/> + <field name="arch" type="xml"> + <div id="google_maps_setting" position="after"> + <div class="col-12 col-lg-6 o_setting_box" id="twitter_roller_install_setting"> + <div class="o_setting_right_pane"> + <span class="o_form_label">Twitter Roller</span> + <span class="fa fa-lg fa-globe" title="Values set here are website-specific." groups="website.group_multi_website"/> + <div class="text-muted"> + Twitter API Credentials + </div> + <div class="content-group"> + <div class="row mt16"> + <label class="col-lg-3 o_light_label" string="API Key" for="twitter_api_key"/> + <field name="twitter_api_key" class="oe_inline"/> + </div> + <div class="row"> + <label class="col-lg-3 o_light_label" string="API secret" for="twitter_api_secret"/> + <field name="twitter_api_secret" class="oe_inline"/> + </div> + <a data-toggle="collapse" href="#" data-target="#twitter_tutorial" aria-label="Twitter tutorial"> + <i class="fa fa-arrow-right"/> + Show me how to obtain the Twitter API key and Twitter API secret + </a> + <div class="row mt16 collapse" id="twitter_tutorial"> + <blockquote class="small"> + <h2>How to configure the Twitter API access</h2> + <ol> + <li>Create a new Twitter application on <a href="https://apps.twitter.com/app/new" target="new">https://apps.twitter.com/app/new</a> + with the following values: + <ul> + <li><strong>Name: </strong> Odoo Twitter Integration</li> + <li><strong>Description: </strong> Odoo Twitter Integration </li> + <li><strong>Website: </strong> + <b><field name="twitter_server_uri" /></b></li> + <li><strong>Callback URL: </strong>Leave blank</li> + <li>Accept terms of use and click on the Create your Twitter application button at the bottom</li> + </ul> + </li> + <li>Switch to the API Keys tab: <br/> + <img src='/website_twitter/static/src/img/api_key.png' alt="API Key"/> + </li><br/> + <li>Copy/Paste Consumer Key (API Key) and Consumer Secret (API Secret) keys below.</li> + </ol> + </blockquote> + </div> + <div class="row"> + <label class="col-lg-3 o_light_label" string="Favorites From" for="twitter_screen_name"/> + <field name="twitter_screen_name" class="oe_inline"/> + </div> + </div> + </div> + </div> + </div> + </field> + </record> +</odoo> diff --git a/addons/website_twitter/views/website_twitter_snippet_templates.xml b/addons/website_twitter/views/website_twitter_snippet_templates.xml new file mode 100644 index 00000000..461c2367 --- /dev/null +++ b/addons/website_twitter/views/website_twitter_snippet_templates.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <template id="s_twitter" name="Twitter Scroller"> + <section class="twitter" data-screen-name="OpenERP" data-limit="15"> + <div class="twitter_timeline o_not_editable"/> + </section> + </template> + + <template id="remove_external_snippets" inherit_id="website.external_snippets"> + <xpath expr="//t[@t-install='website_twitter']" position="replace"/> + </template> + <template id="website_twitter_snippet" inherit_id="website.snippets"> + <xpath expr="//t[@id='twitter_favorite_tweets_hook']" position="replace"> + <t t-snippet="website_twitter.s_twitter" t-thumbnail="/website/static/src/img/snippets_thumbs/s_twitter_scroll.svg"/> + </xpath> + </template> + + <template id="website_twitter_options" inherit_id="website.snippet_options"> + <xpath expr="." position="inside"> + <div data-js="twitter" data-selector=".twitter"/> + </xpath> + </template> + + <template id="twitter" inherit_id="website.assets_frontend"> + <xpath expr="//link[last()]" position="after"> + <link rel="stylesheet" type="text/scss" href="/website_twitter/static/src/scss/website_twitter.scss"/> + </xpath> + <xpath expr="//script[last()]" position="after"> + <script type="text/javascript" src="/website_twitter/static/src/js/website.twitter.animation.js"/> + </xpath> + </template> + <template id="twitter_editor" inherit_id="website.assets_editor"> + <xpath expr="//script[last()]" position="after"> + <script type="text/javascript" src="/website_twitter/static/src/js/website.twitter.editor.js"/> + </xpath> + </template> +</odoo> |
