diff options
| author | Barad Mahendra <mba@tinyerp.com> | 2014-04-10 19:46:22 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2014-04-10 19:46:22 +0200 |
| commit | 0152bea512d868cbb0d9adf33cdbf98bc2030a0f (patch) | |
| tree | 6553ccef3cc7a9a0814ad8441c24e4f98df6a7f4 /addons/website_twitter/views | |
| parent | 7c75b5e004ef2e1c836ad2cc788a701a687a6440 (diff) | |
[MERGE] [ADD] website_twitter: add twitter scroller snippet
bzr revid: odo@openerp.com-20140410174622-j2waid38nk3fqitt
Diffstat (limited to 'addons/website_twitter/views')
| -rw-r--r-- | addons/website_twitter/views/twitter_snippet.xml | 33 | ||||
| -rw-r--r-- | addons/website_twitter/views/twitter_view.xml | 56 |
2 files changed, 89 insertions, 0 deletions
diff --git a/addons/website_twitter/views/twitter_snippet.xml b/addons/website_twitter/views/twitter_snippet.xml new file mode 100644 index 00000000000..bc039d71c61 --- /dev/null +++ b/addons/website_twitter/views/twitter_snippet.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> +<data> + <template id="website_twitter_snippet" name="Twitter snippet" inherit_id="website.snippets"> + <xpath expr="//div[@id='snippet_feature']" position="inside"> + <div> + <div class="oe_snippet_thumbnail"> + <img class="oe_snippet_thumbnail_img" src="/website_twitter/static/src/img/twitter_scroll.png"/> + <span class="oe_snippet_thumbnail_title">Twitter Scroller</span> + </div> + <section class="oe_snippet_body twitter" data-screen-name="OpenERP" data-limit="15"> + <div class="twitter_timeline" contenteditable="false"></div> + </section> + </div> + </xpath> + </template> + <template id="website_twitter_options" name="Twitter Options" inherit_id="website.snippet_options"> + <xpath expr="//div" position="after"> + <div data-snippet-option-id='twitter' + data-selector=".twitter" + data-selector-children=".oe_structure, [data-oe-type=html]"> + </div> + </xpath> + </template> + <template id="twitter" inherit_id="website.layout" name="Twitter Snippet"> + <xpath expr="//head" position="inside"> + <link rel="stylesheet" href="/website_twitter/static/src/css/website.twitter.css" type="text/css"/> + <script type="text/javascript" src="/website_twitter/static/src/js/website.twitter.animation.js"></script> + <script type="text/javascript" src="/website_twitter/static/src/js/website.twitter.editor.js" groups="base.group_website_publisher"></script> + </xpath> + </template> +</data> +</openerp> diff --git a/addons/website_twitter/views/twitter_view.xml b/addons/website_twitter/views/twitter_view.xml new file mode 100644 index 00000000000..8600ceca039 --- /dev/null +++ b/addons/website_twitter/views/twitter_view.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + <record id="view_website_config_settings" model="ir.ui.view"> + <field name="name">Twitter settings</field> + <field name="model">website.config.settings</field> + <field name="inherit_id" ref="website.view_website_config_settings"/> + <field name="arch" type="xml"> + <xpath expr="//div[@name='social_twitter']" position="after"> + <label for="id" string="Twitter API"/> + <div> + <p>Set your Twitter API access below to be able to use the Twitter Scroller Website snippet.<br/> + You can get your API credentials from <a href="https://apps.twitter.com/app/new" target="new">https://apps.twitter.com/app/new</a> + </p> + <div> + <field name="twitter_tutorial" class="oe_inline"/><label for="twitter_tutorial"/> + + <blockquote class="small" attrs="{'invisible':[('twitter_tutorial','=',False)]}"> + <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> OpenERP Tweet Scroller</li> + <li><strong>Description: </strong> OpenERP Tweet Scroller </li> + <li><strong>Website: </strong> <tt>http://www.openerp.com</tt></li> + <li><strong>Callback URL: </strong> leave it blank</li> + <li>Accept terms of use and click on the Create 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'/> + </li> + <li>Copy/Paste API Key and Secret below</li> + <li>Enter the screen name from which you want to load favorite Tweets (does not need to be the same as the API keys)</li> + </ol> + </blockquote> + </div> + <div> + <label for="twitter_api_key"/> + <field name="twitter_api_key" class="oe_inline"/> + </div> + <div> + <label for="twitter_api_secret"/> + <field name="twitter_api_secret" class="oe_inline"/> + </div> + <div> + <label for="twitter_screen_name"/> + <field name="twitter_screen_name" class="oe_inline"/> + </div> + </div> + </xpath> + </field> + </record> + </data> +</openerp> |
