Skip to content

Commit 85a4db2

Browse files
committed
[MIG] website_local_font: Migration to 16.0
1 parent 7368455 commit 85a4db2

File tree

8 files changed

+599
-67
lines changed

8 files changed

+599
-67
lines changed

website_local_font/README.rst

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
==================
2+
Website Local Font
3+
==================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:21948d7b105e692895d067c8fee8367e630601f87e0a96393bed77d7fbf1a58b
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
20+
:target: https://github.com/OCA/website/tree/16.0/website_local_font
21+
:alt: OCA/website
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/website-16-0/website-16-0-website_local_font
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows to add local fonts on Odoo website.
32+
33+
By default,Odoo only allows to upload fonts available from Google(fonts.google.com) and they can be made available locally or from Google's server in addition to the fonts made available via website theme modules.But there's no option to upload and have local fonts available across all website themes.
34+
35+
36+
To overcome this limitation, this module has been developed to allow users to upload proprietary (or custom) fonts in the most widely used font formats - otf,ttf,woff and woff2 and make it available across all website themes.
37+
38+
The fonts can be deleted as well if not needed anymore.
39+
40+
**Table of contents**
41+
42+
.. contents::
43+
:local:
44+
45+
Usage
46+
=====
47+
48+
To upload local fonts and use it for the website, you need to :
49+
50+
1.Go to website (with editor enabled),click on 'Edit' and go to 'THEMES' section.Under Font Family, you would find an option 'Add a Local Font'.
51+
52+
.. image:: https://raw.githubusercontent.com/OCA/website/16.0/website_local_font/static/description/AddALocalFontOption.png
53+
54+
2.When you click on the 'Add a Local Font' option, a wizard would open with two fields- 'Font File' and 'Font Name'.Upload the file with one of the supported file formats and the font name would be automatically updated based on the file.You can update the name or leave it as it is.
55+
56+
.. image:: https://raw.githubusercontent.com/OCA/website/16.0/website_local_font/static/description/SaveTheFont.png
57+
58+
3.Click on 'Save & Reload' Button, you will see the font is applied to the elements of the website.
59+
60+
.. image:: https://raw.githubusercontent.com/OCA/website/16.0/website_local_font/static/description/FontAppliedOnWebsite.png
61+
62+
4.If you want to see the list of local fonts or delete the locally uploaded fonts,click on 'Edit' on website and go to 'THEMES' section.Under Font Family, you would find the newly added font.
63+
64+
.. image:: https://raw.githubusercontent.com/OCA/website/16.0/website_local_font/static/description/NewlyAddedFont.png
65+
66+
5.If you want to delete this locally added font , you can click on the delete icon next to it.Once, you click on the delete icon, it would open up a confirmation dialog.
67+
68+
.. image:: https://raw.githubusercontent.com/OCA/website/16.0/website_local_font/static/description/DeleteFontConfirmation.png
69+
70+
6.Once you click on 'Ok' button, the page would be refreshed and you would see the font is changed for the website and also the font is not found in the list.
71+
72+
.. image:: https://raw.githubusercontent.com/OCA/website/16.0/website_local_font/static/description/FontDeleted.png
73+
74+
Bug Tracker
75+
===========
76+
77+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/issues>`_.
78+
In case of trouble, please check there if your issue has already been reported.
79+
If you spotted it first, help us to smash it by providing a detailed and welcomed
80+
`feedback <https://github.com/OCA/website/issues/new?body=module:%20website_local_font%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
81+
82+
Do not contact contributors directly about support or help with technical issues.
83+
84+
Credits
85+
=======
86+
87+
Authors
88+
~~~~~~~
89+
90+
* Onestein
91+
92+
Contributors
93+
~~~~~~~~~~~~
94+
95+
* `Onestein <https://www.onestein.nl>`_:
96+
97+
* Anjeel Haria
98+
99+
Maintainers
100+
~~~~~~~~~~~
101+
102+
This module is maintained by the OCA.
103+
104+
.. image:: https://odoo-community.org/logo.png
105+
:alt: Odoo Community Association
106+
:target: https://odoo-community.org
107+
108+
OCA, or the Odoo Community Association, is a nonprofit organization whose
109+
mission is to support the collaborative development of Odoo features and
110+
promote its widespread use.
111+
112+
This module is part of the `OCA/website <https://github.com/OCA/website/tree/16.0/website_local_font>`_ project on GitHub.
113+
114+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

website_local_font/__manifest__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Website Local Font",
66
"summary": "Allows to add local fonts on Odoo website",
7-
"version": "15.0.1.0.0",
7+
"version": "16.0.1.0.0",
88
"category": "Website",
99
"website": "https://github.com/OCA/website",
1010
"author": "Onestein, Odoo Community Association (OCA)",
@@ -25,5 +25,8 @@
2525
"website_local_font/static/src/scss/secondary_variables.scss",
2626
),
2727
],
28+
"web.assets_backend": [
29+
"website_local_font/static/src/xml/website.editor.xml",
30+
],
2831
},
2932
}

website_local_font/models/assets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33

44
import re
55

6-
from odoo import models
6+
from odoo import api, models
77

88

99
class Assets(models.AbstractModel):
1010
_inherit = "web_editor.assets"
1111

12+
@api.model
1213
def make_scss_customization(self, url, values):
1314
"""
1415
Added handling for local fonts deletion and addition in scss
9.23 KB
Loading

0 commit comments

Comments
 (0)