Skip to content

[9.0] [MIG] website_img_bg_style - #290

Merged
pedrobaeza merged 4 commits into
OCA:9.0from
Tecnativa:9.0-mig-website_img_bg_style
Dec 21, 2016
Merged

pedrobaeza merged 4 commits into
OCA:9.0from
Tecnativa:9.0-mig-website_img_bg_style

Conversation

@cubells

@cubells cubells commented Nov 28, 2016

Copy link
Copy Markdown
Member
  • Update README.rst
  • Updated xml files

@Tecnativa

@cubells
cubells force-pushed the 9.0-mig-website_img_bg_style branch from d607a99 to 700e21c Compare November 28, 2016 12:12
@pedrobaeza
pedrobaeza force-pushed the 9.0-mig-website_img_bg_style branch from 700e21c to bffc727 Compare November 28, 2016 20:44
Comment thread website_img_bg_style/README.rst Outdated
@@ -0,0 +1,74 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put target line

Comment thread website_img_bg_style/README.rst Outdated
Known issues / Roadmap
======================

* Right now you can only select one style for every snippet. To fix that we

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this text as we are in version 9 😉

Comment thread website_img_bg_style/__openerp__.py Outdated
"license": "AGPL-3",
"application": False,
"installable": True,
"external_dependencies": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't put empty keys

Comment thread website_img_bg_style/__openerp__.py Outdated
"summary": "Let you change styles of snippets background images",
"version": "9.0.1.0.0",
"category": "Website",
"website": "https://odoo-community.org/",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put Tecnativa's website

@@ -0,0 +1,357 @@
@charset "UTF-8";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't include this file and map one, as version 9 now generates it on the fly from sass file. Map file isn't generated in fact, but we can't maintain a possible obsolete copy of it.

Comment thread website_img_bg_style/views/assets.xml Outdated
inherit_id="website.assets_frontend"
name="Website snippets background image style">
<xpath expr="//link[last()]" position="after">
<link href="/website_img_bg_style/static/src/css/styles.css"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put here sass file instead

@pedrobaeza pedrobaeza mentioned this pull request Nov 28, 2016
34 tasks

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cubells, I'm afraid the module is not working. I have tried it on runbot and new options don't appear.

@cubells

cubells commented Nov 30, 2016

Copy link
Copy Markdown
Member Author

@pedrobaeza It works for me. Can you check it?

When you save the block, then you can see the new menu "Background style" like this:

website_img_bg_style

@pedrobaeza

Copy link
Copy Markdown
Member

OK, there are 2 problems:

@cubells

cubells commented Nov 30, 2016

Copy link
Copy Markdown
Member Author

ok. I'll review.

@cubells

cubells commented Nov 30, 2016

Copy link
Copy Markdown
Member Author

@pedrobaeza

Options doesn't appear after you save and edit again. We should be able to access to these options immediately. This also happened on version 8, but it but be very good it it's possible to have them.

I see options always once block is saved if block has background.

@yajo yajo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrating snippets to v9 is one of the hardest parts I found, because there's not much documentation but API has changed a lot.

Let's see if applying these suggestions the addon works fine.

@if $map2
+mix($attribute, $map2, $other: $value)

*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace * by .oe_img_bg

Comment thread website_img_bg_style/views/snippets.xml Outdated
inherit_id="website.snippet_options"
name="Container width type chooser">
<xpath expr=".">
<div data-snippet-option-id='background-style'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace data-snippet-option-id='background-style' by data-js="background_style".

Comment thread website_img_bg_style/views/snippets.xml Outdated
<li class="dropdown-submenu">
<a href="#">Vertical</a>
<ul class="dropdown-menu">
<li data-value="bg-top">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace every data-value occurrence in this file by data-select_class to take advantage of new features introduced in v9 for snippet options.

Also add an element like this at the end of every option group:

<li data-select_class="">
    <a>None</a>
</li>

@cubells

cubells commented Dec 13, 2016

Copy link
Copy Markdown
Member Author

All changes requested by @pedrobaeza are done:

  • Menu is available on edit mode.
  • Menu now works

name="Container width type chooser">
<xpath expr=".">
<div data-js='background-style'
data-selector="section, :not(.o_gallery > .container) > .carousel, .parallax">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ain't it better here to simply put .oe_img_bg? Blocks without background image do not need any of these customizations...

OTOH, another possibility is to put these new options under Background > Style, to remove apparent duplicities as you can see in the image:

captura de pantalla de 2016-12-14 09-16-43

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I saw with you that current behaviour is best possible, so this is OK.

<a>Rounded</a>
</li>
<li data-select_class="bg-no-repeat-h">
<a>None</a>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I miss the <li data-select_class=""> option, although you can call it Auto this time, to avoid confusions of having 2 None options.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was fixed.

<a>Rounded</a>
</li>
<li data-select_class="bg-no-repeat-v">
<a>None</a>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I miss the <li data-select_class=""> option, although you can call it Auto this time, to avoid confusions of having 2 None options.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was fixed.

@yajo yajo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All fixed, cool! 👍

name="Container width type chooser">
<xpath expr=".">
<div data-js='background-style'
data-selector="section, :not(.o_gallery > .container) > .carousel, .parallax">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I saw with you that current behaviour is best possible, so this is OK.

<a>Rounded</a>
</li>
<li data-select_class="bg-no-repeat-v">
<a>None</a>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was fixed.

<a>Rounded</a>
</li>
<li data-select_class="bg-no-repeat-h">
<a>None</a>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was fixed.

@rafaelbn rafaelbn added this to the 9.0 milestone Dec 15, 2016
@rafaelbn

Copy link
Copy Markdown
Member

Travis fails, could you review please?

@yajo

yajo commented Dec 15, 2016

Copy link
Copy Markdown
Member

The failure is in website_seo_redirection, not related

@yajo

yajo commented Dec 21, 2016

Copy link
Copy Markdown
Member

Rebasing should fix travis now that #297 is merged.

@cubells
cubells force-pushed the 9.0-mig-website_img_bg_style branch from 5dc55e4 to 162d99a Compare December 21, 2016 11:15
@pedrobaeza
pedrobaeza merged commit 3c6c727 into OCA:9.0 Dec 21, 2016
@pedrobaeza
pedrobaeza deleted the 9.0-mig-website_img_bg_style branch December 21, 2016 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants