Skip to content

Commit

Permalink
⬆️1️⃣2️⃣ web_login_background
Browse files Browse the repository at this point in the history
  • Loading branch information
trojik committed Nov 23, 2018
1 parent 3063b75 commit fba3045
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 24 deletions.
6 changes: 6 additions & 0 deletions web_login_background/doc/changelog.rst
@@ -1,3 +1,9 @@
`1.0.2`
-------

- **Fix:** applied new CSS styles according to changes in 12 odoo
- **Fix:** changed the process of getting hash for url

`1.0.1`
-------

Expand Down
4 changes: 3 additions & 1 deletion web_login_background/models.py
@@ -1,13 +1,15 @@

from random import choice
import hashlib
import base64

from odoo import fields, api
from odoo import models
from odoo.tools import pycompat


def _attachment2url(att):
sha = hashlib.sha1(getattr(att, '__last_update').encode('utf-8')).hexdigest()[0:7]
sha = hashlib.md5(pycompat.to_text(att.datas).encode('utf-8')).hexdigest()[0:7]
return '/web/image/%s-%s' % (att.id, sha)


Expand Down
24 changes: 1 addition & 23 deletions web_login_background/templates.xml
Expand Up @@ -4,7 +4,7 @@
<xpath expr="//head" position="inside">
<t t-if="picture_url">
<style type="text/css">
body.container {
body {
background: none;
background-image: url(<t t-raw="picture_url"/>);
background-size: cover;
Expand All @@ -13,27 +13,5 @@
</t>
</xpath>
</template>
<template id="web_login_background_loginborder" priority="4" inherit_id="web.login_layout" name="loginborder">
<xpath expr="//div[hasclass('o_database_list')]" position="replace">
<div class="o_database_list">
<div class="text-center">
<img t-attf-src="/web/binary/company_logo{{ '?dbname='+db if db else '' }}"/>
</div>
<t t-raw="0"/>
<div class="text-center" t-if="not disable_footer">
<t t-if="not disable_database_manager">
<a class="" href="/web/database/manager">Manage Databases</a> |
</t>
<a href="https://www.odoo.com" target="_blank">Powered by <span>Odoo</span></a>
</div>
</div>
</xpath>
<xpath expr="//div[hasclass('o_database_list')]/.." position="attributes">
<attribute name="class">web_login_background</attribute>
</xpath>
<xpath expr="//div[hasclass('web_login_background')]/.." position="before">
<link rel="stylesheet" href="/web_login_background/static/css/login.css"/>
</xpath>
</template>
</data>
</openerp>

0 comments on commit fba3045

Please sign in to comment.