summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/static/src/js
AgeCommit message (Collapse)Author
2019-07-12[MERGE] Forwardport of saas-12.2 to saas-12.3 up to 01365a3f625c9e7Martin Trigaux
closes odoo/odoo#34747 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-10[MERGE] Forward port of 12.0 to saas-12.2 up to 3b1d00acda9358108Martin Trigaux
closes odoo/odoo#34732 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-08[FIX] mass_mailing: Proper translation stringJairo Llopis
Computed expressions cannot happen inside a translation string. closes odoo/odoo#34643 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-05[FIX]web_editor: Fixed traceback due to 'field_html' widget while saving recordmgh-odoo
Previously, when user edited record having 'field_html' widget and tried to save the record immediately, a traceback was faced sometimes because content was not loaded yet. This commit fixes the issue by calling super method if the content is not loaded yet properly. Task: #1932687 Closes: #30833 closes odoo/odoo#31581 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-13[MERGE] forward port branch saas-12.2 up to c9f832d9f03Christophe Simonis
closes odoo/odoo#31790 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-06[REF] mass_mailing: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-18[FIX] *: various docstring formatting issuesXavier Morel
Would yield block quotes instead of code blocks or lists or whatnot.
2019-02-14[IMP] web_editor: lazy load the wysiwygChristophe Matthieu
Issue: wysiwyg asset slow down the loading of the website, error inadvertently introduced: https://github.com/odoo/odoo/pull/29775 The assets are now loaded assynchroneously, when the editor is needed, its assets will be loaded. closes odoo/odoo#30700
2019-02-25[FIX] mass_mailing: fix send email issue.Siddarth Gajjar
- while clicking on send now button in mass mailing app it throws error due to wysiwyg undefined. closes odoo/odoo#30533
2019-01-25[FIX] mass_mailing: restore email templatesSiddarth Gajjar
Following the new editor's merge at https://github.com/odoo/odoo/pull/29775, the classes 'o_mail_wrapper' and 'o_mail_wrapper_td' were renamed to 'o_mailWrapper' and 'o_mailWrapper_td' because of what appears to be a JS-variable-search-replace fail. Strange enough, the scss was not impacted which allowed to see the bug in master. closes odoo/odoo#30544
2019-01-17[ADD] web_editor,*: Tests for new structure of web editorAntoine Guenet
The refactoring also had to be done in order to create a set of unit tests. Each behavior can be tested, including the behaviors performed as a consequence of keyboard interactions (for instance: Enter, Tab...). This commit also contains some changes to test_utils that were necessary given the new structure of the wysiwyg editor. Co-authored-by: Gorash <chm@odoo.com>
2019-01-17[IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' fieldChristophe Matthieu
* Creating a new structure by transforming all the plugins in the library using the odoo inheritance system. Plugins are easier to implement with the AbstractPlugin to add Odoo behaviors. * From now on, the methods of the library (in this case Summernote) can no longer be called by other modules or files. Only the wysiwyg widgets can access it, to simplify the updating process. The wysiwyg object serves as an interface. * Depending on the options the snippets will be loaded or not, the editor will be in an iframe or not... all of this is transparent from the outside. * Regarding iframes, all controllers related to editing have been removed: the new API no longer needs them. This speeds up loading, eases testing and removes complexity for the same features. PUBLIC FEATURES There are several public methods on the Wysiwyg class: * Wysiwyg.prepare (WidgetParent): returns a deferred resolved when the library (xml, lazy, assets...) is loaded. * Wysiwyg.getRange (DOM): returns the range (selection in the dom) * Wysiwyg.setRange (startNode, startOffset, endNode, endOffset): creates a range (selection in the dom) * Wysiwyg.setRangeFromNode (DOM, options) that creates a range from an element (option available to select all, start or end) A jQuery selector was added: :o_editable, which indicates whether the current element is editable. That is, if it is contained in a tag with the attribute 'contentEditable = "true"' or in a tag with the class o_editable. Several methods are also present: * focusIn: makes a focus and places the cursor at the beginning of the element * focusInEnd: makes a focus and places the cursor at the end of the element * selectContent: makes a focus and selects the content HTML FIELD The HTML field can receive different options: * style-inline: {boolean} transforms a class into an inline style when saving and vice versa when reading. * no-attachment: {boolean} prevents the use of attachments (in media dialog) * cssEdit: {xml_id} to use a template containing the css to loaded in an iframe when editing * cssReadonly: {xml_id} to use a template containing the css to load into an iframe when viewing in readonly * snippets: {xml_id} snippets template (can be used with or without cssEdit) * wrapper: {template} qweb static template (containing a tag: id = "wrapper") that will include the content during editing (removed on save) MASS MAILING A widget was created for mass mailing. There are now two fields: body_html and body_arch. body_arch contains the code with the class without conversion into inline style, useful when editing and one with the inline style that is visible in readonly mode and sent by email. Advantage: no spreading errors, able to update css/theme, able to do more changes when converting to inline style so that a maximum of mail clients have an impeccable rendering. Co-authored-by: Antoine Guenet <age@odoo.com>
2019-01-17[REF] web_editor,*: Move and rename files to prepare refactoringChristophe Matthieu
The refactoring of the wysiwyg editor and 'html' field allows us to move some of the code that was in web_editor but only used in website or in mass_mailing. Some parts are still in web_editor but will be moved at a later time.
2018-12-19[REF] mass_mailing: clean JS views overridesAurélien Warnon
Task #1909424 The mass_mailing module used a lot of JS "include" to override the behavior of the kanban view and the html_frame widget. This commit cleans the overrides by using proper inheritance with "extend" instead of "include". It also slightly changes the current behavior of the mass_mailing kanban view to disable the drag and drop feature only when the view is grouped by "state" or "email_from". (Before this commit, the drag and drop feature was disabled for ALL fields). closes odoo/odoo#29452
2018-08-13[IMP] mass_mailing: focus on content when user selects the plaintext themeParth Gajjar
2018-08-13[IMP] mass_mailing: removed font-family from plain textAnshuman Sharma
Purpose behind this commit is to remove font-family from all elements in plaintext theme. So mail receiver will see this mail in default system font. This is inspired by new Gmail and suggested by FP As we want to show system's default font in the mail sent with the basic theme. And so we remove font-family from basic theme while saving. But by doing so in readonly mode is not getting proper font in odoo as we don't having any assets in readonly mail editor. So we added stylesheet just for display purpose.
2018-08-10[IMP] mail, mass_mailing : apply blacklist, opt_out per mailing listDavid Beguin
Purpose ======= - Apply the blacklist implementation to Improve mailing subscription to be more compliant with the European GDPR law. Keep a list of people who does not want to receive promotional emails (or mass mailing in general) anymore. - Allows the recipient to update himself his mailing preferences Specifications =========== This commit is regrouping some main changes on mass mailing. Apply Blacklist for following models through blacklist.mixin : - crm.lead - res.partner - mail.mass_mailing.contact - mail.channel.partner - Opt_out per mailing list instead of per mailing contact. - Replace opt_out by blacklist in crm.lead + res.partner models - Added 'ignored' state for mass_mailing. Ignored = blacklisted, opted-out Ignored email are not included into final statistics to avoid confusion. - Unsubscribe(d) pages migrated from website_mass_mailing to mass_mailing module as thoses pages should work without having the website module installed Detailed implementation =================== Mass-mailing : - A blacklisted email is notified by the ban icon next to the email field. (at the left of the email field for display purpose) - Renaming the '_get_blacklist' method that was actually searching opt_out list into 'get_opt_out_list' - Opt out per mailing list : Add opt_out + related fields (for display and ergonomy reasons) on the relational model - Display relational model tree view instead of mass_mailing.contact tree view when clicking on mass_mailing_list in kanban view -> In order to be align between contact_nbr displayed in kanban tile and the content of the tree view -> mass_mailing contact is accesible via the user icon in this tree view - Remove custom filters 'filter_contact_subscription' and 'filter_contact_unsubscription' as opt_out is not on mass_mailing.contact model anymore - Add 'is_public' to mailing list The name of this mailing list can be seen (or not) by recipient in the unsubscription page If the mailing lists used in the mass mailing are not public, the user in only informed that he has been unsubscribed. If the mailing lists are public, the user is informed that he has been unsubscribed from the mailing lists and he has the choice to modify his subscription to all the public mailing list he is or was subscribed to. - Unsubscription Page : - mass_mailing_contact : Opt_out per mailing list, done by email and not by id, as multiple contact can have the same email The recipient can add/remove himself to/from the blacklist The recipient can send a feedback about why he unsubscribed - crm.lead + res.partner : Once the recipient unsubscribe, he is automatically blacklisted The recipient can 'Come back' and remove himself from the blacklist if he changes his mind - Show blacklist button parameter added in config : The idea is to enable/disable the fact that the recipient can add himself to the blacklist by showing or not the 'blacklist me' button Only applies for mass_mailing.contact. The recipient, once blacklisted, can always, no matter the value of this parameter, 'come back' and unblacklist himself crm.lead + res.partner : - Replace opt_out by blacklist in crm.lead + res.partner models. As when a res.partner or crm.lead unsubcribe, we assume that the recipient does not want to receive mass mailing anymore, at all, even if we adds him to a mailing list afterwards. He is then blacklisted to avoid this. With this behaviour, if a new lead is created with the same email address, he won't be able to receive mail in mass_mode. But he will still be able to receive '1 to 1' direct email. Task ID 33224 Closes #25966
2018-07-27[REF] *: BS4, adapt dropdowns and caretsqsm-odoo
- The dropdown structure was simplified, allowing to get rid of the 3-levels structure induced by <ul/> elements and dropdowns can now contain anything. The class 'dropdown-item' is now mandatory for each dropdown clickable element. The class 'dropdown-item-text' can be used to add same padding and style but without making the element have a clickable look. - Dividers now use the class 'dropdown-divider' - The way dropdowns are opened and hidden also changed (before the 'open' class was added on the `.dropdown-menu` parent, now the 'show' class is added on both the `.dropdown-menu` parent and the `.dropdown-menu` itself). - JS-wise, no click event handlers can be put on `.dropdown-toggle` elements anymore (instead, use handlers for dropdown events). - Carets are automatically put on `.dropdown-toggle` elements, so this commit replaces the `.caret` elements with this. This feature was possible to disable but would prevent us from adding a caret with scss. Also, this simplifies the DOM. The 'o-no-caret' class was also introduced to allow using the 'dropdown-toggle' class on non-caret elements. - Also adapt the scss to use $caret-width instead of $caret-width-base
2018-07-27[REF] *: BS4, adapt display classesqsm-odoo
The system completely changed. I also had to adapt classes to new screen breakpoints. hidden/hide -> d-none show -> d-block hidden-xs -> d-none d-md-(block/inline/...) hidden-sm -> d-md-none d-lg-(block/inline/...) hidden-md -> d-lg-none d-xl-(block/inline/...) hidden-lg -> d-xl-none visible-xs-* -> d-* d-md-none visible-sm-* -> d-none d-md-* d-lg-none visible-md-* -> d-none d-lg-* d-xl-none visible-lg-* -> d-none d-xl-* hidden-print -> d-print-none visible-print-* -> d-none d-print-* ... and all possible combination of those had to be handled too.
2018-06-12[MERGE] forward port branch 11.0 up to e3658d6f568Christophe Simonis
2018-06-06[FIX] mass_mailing: URI too longNicolas Martinelli
Since commit 6494f511718893, all images in mass mailing are created as attachments. This can lead to URI too long to be handled by some proxy, e.g. Nginx. opw-1853188
2018-02-15[MERGE] forward port branch saas-11.1 up to a277b585072Christophe Simonis
2018-02-14[MERGE] forward port branch saas-16 up to 77927559465Christophe Simonis
2018-02-14[MERGE] forward port branch saas-15 up to d24bdbde81bChristophe Simonis
2018-02-14[MERGE] forward port branch saas-14 up to 9d0de611147Christophe Simonis
2018-02-13[FIX] mass_mailing, *: duplicating two-columns snippetsqsm-odoo
* web_editor, website This commit fixes a bug with table duplication in mailing template: - Click on a snippet with two columns - Duplicate it -> the snippet is duplicated but the two columns are transformed in two rows. This was because there is an implemented behavior for column duplication: if we duplicate a column which was alone on its row, we duplicate the row instead. This code should however be triggered when duplicating the column alone to be working, not the snippet that contains it. Note: this required a backport of a33ec972abf1cadbae2a6a04f759617c82f2a95e which was fixing a non-critical "bug" for 11.0. This non-critical "bug" is therefor fixed here too. opw-807105
2018-02-05[FIX] mass_mailing: complete commit 66aefb1723c336cc1c61fb32926ed926ba9e29e4qsm-odoo
- There should not be margins around lists - There should not be editor overlay on the whole content
2018-02-01[MERGE] forward port branch saas-11.1 up to 7e469eb77aaChristophe Simonis
2018-02-01[IMP] mass_mailing: onboardingAlexandre Kühn
Lots of small usability improvements on the mass_mailing app.
2018-01-26[FIX] mass_mailing: lower the risk of messing with the mail wrapperqsm-odoo
Mail content is wrapped in a table to properly allow centering the layout in all mail clients. The problem was that this table was able to be customized by the editor while it should not.
2018-01-08[IMP] web_editor, *: change height/margin system to padding systemqsm-odoo
* web, website, mass_mailing Before this commit, the editor allowed defining the margin of some elements and the height of some elements. There were three main problems with this system: 1) When an user dragged the arrow, he often expected to change the size of the element while he was in fact changing the margin 2) When changing the margin, you increase the space between two elements but with a white space (while most users want a space with the same color of the block they are resizing = padding) 3) When changing the height, the user was able to hide snippet parts and the height was not consistent accross screen sizes Now, the only thing you can edit is padding. There is only one arrow for each direction, which allows increasing spacing and consistent dimension at the same time. The only feature that is lost with this change is the ability to control vertical alignement of colored columns. This is not a problem as colored columns are rare in our current snippets and there still have the possibility to add margin classes by hand if necessary (there are also plans to control vertical alignement another way). Note: margin classes are kept for compatibility.
2017-11-16[MERGE] forward port branch saas-16 up to 745d00362abChristophe Simonis
2017-11-15[MERGE] forward port branch saas-15 up to 73e4dacf78aChristophe Simonis
2017-11-13[MERGE] forward port branch saas-14 up to abfd6621091Christophe Simonis
2017-11-13[FIX] mass_mailing: switch to theme images at 1st theme selectionJairo Llopis
Without this patch, default images for themes are not used automatically in themes' templates when one is chosen for the 1st time. This was not inducing any bug in standard 10.0 but with custom-made templates, you had to put the correct themes images in the defined template. This allows to just `t-call` snippets instead of having to fully hardcode them in theme templates.
2017-10-20[MERGE] forward port branch saas-16 up to dc2a6c6cd2aChristophe Simonis
2017-10-17[MERGE] forward port branch saas-15 up to 8d0942380b5Christophe Simonis
2017-10-17[MERGE] forward port branch saas-14 up to fbdda5437a8Christophe Simonis
2017-10-17[MERGE] forward port branch 9.0 up to d5c0cae60b5Christophe Simonis
2017-10-17[FIX] mass_mailing: background snippet option outlook compatible (#20137)Lucas Perais
Origin of the fix: the snippet background image did not change the background image. This was due to commit a14f89c which wraps the snippet's content into a table for outlook display compliance This issue is fixed here, with the modificaion of the background snippet option. OPW 772442
2017-09-29[FIX] mass_mailing: never ending resizeNicolas Lempereur
In odoo@2972976 a mouseup that unbound resizing in mass mailing was missing so once resizing there was no way to stop resizing.
2017-08-16[REF] web_editor, website, *: complete refactoringqsm-odoo
* mass_mailing, payment, point_of_sale, portal, survey, web, web_tour, website_blog, website_crm_partner_assign, website_event, website_event_questions, website_form, website_forum, website_gengo, website_hr_recruitment, website_links, website_mail, website_mail_channel, website_mass_mailing, website_quote, website_sale, website_sale_options, website_slides, website_twitter This commit reviews the whole "JS side" of the web_editor and website apps. This is a first step to be able to improve them with new and better functionnalities; this commit is not supposed to change any visual behavior. The main goal was to achieve a structure similar to the backend one. Now, the frontend side also has a root widget (like the WebClient) and all other widgets are attached to it one way or another. This allows the benefits of using the 'trigger_up' functionnality for example. As RPC are now mainly done with the `this._rpc` functionnality (being possible thanks to the parent hierarchy), the frontend will also be possible to test thanks to QUnit in a future update (besides the "text" editor side which still requires a refactoring to be able to do that). --- Here are some of the changes: (-) conventions and documentation The code has been updated to follow JS conventions and a lot of code has been commented (around +2000 lines of comment). This also means that lots of functions have been renamed to use camelCase or simply to make their name understandable. See https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines. (-) deprecated: web_editor.base The "web_editor.base" module has been split and does not force the modules which require it to wait for DOM ready anymore. This was indeed slowing loading times, but also prevented to use some modules in some contexts (see the LESS editor use in web_studio which is the subject of another task). Now the "editor context" can be got thanks to the "web_editor.context" JS module with its "get" function. The "web_editor.base" module should probably not be used anymore (see its code and recent updates). (-) new: web.dom_ready If a JS module should wait for the DOM to be ready to be executed, a new JS module has been created: "web.dom_ready". This should always be used in a module which only want to instantiate stuff. Do not extend (or worst, include) classes after DOM ready. (-) website.website The "website.website" module has been split. "website.website" does not return anything useful anymore, it just initialize some miscellaneous stuff, without waiting for the DOM to be ready. You might want to check "website.utils", "website.content.compatibility" or `WebsiteRoot`. Also `website.form` has been deleted (use `this._rpc`), so has been `website.error`. `website.prompt` will be removed in a future update to be replaced by `Dialog.prompt`. (-) widgets are great Many classes which were not widgets are now widgets. This allows them to use the 'events', the 'xmlDependencies' and the 'this._rpc' features for example. Here are some of the main ones: - Snippet options: these were classes with a `$el` for the menu element and `$target` for the customized element. This is still the case but following standard `Widget` structure (one exception: using `this.$(...)` searches in the `$target` as before this update). - Snippet animations: instead of class instances with a `$target` element which can be `start` and `stop`, these are now standard widgets which can be `start` and `destroy`. `this.$target` is an alias to `this.$el` for ease of compatibility. - Snippet editors: instead of class instances in charge of an editor overlay, these are now widgets. Each "child" snippet editor is properly attached as a "child", which allows editors to communicate and to be properly destroyed. (-) root widgets and website navbar The frontend is different of the backend. In the backend, the page has an empty <body/> element and all the components are instantiated from parent to children (i.e. the `WebClient` is instantiated and is in charge of instantiating the `ControlPanel`, etc). The frontend cannot work like that on page loadings as they are way more frequent than in the backend and we do not want them to flicker. A frontend page is loaded as a <body/> element which already contains the website navbar and its menus and the whole content page. JS code has to be "attached" to these existing elements. This is possible thanks to the `RootWidget` instances and the specialized `WebsiteRoot`, `IframeRoot` and `WebsiteNavbar` (see code for details). (-) lazy loading No more (or at least a lot less) XML/JS has to be loaded on page loading, thanks to the use of the `Widget.xmlDependencies` feature. XML which have to be lazy loaded is loaded only on related Widget instantiation if necessary, which allows to execute a lot of JS code before the DOM is ready and to start many widgets on DOM ready (not later). A visual benefit of this is clicking on the 'edit' button as soon as it is possible: before this commit, this was sometimes not doing anything as event handlers were not binded yet. Still a possible exception: loading the session and locales. This may be asynchronous stuff which is still required before widget instantiations but this will be the subject of another task. (-) deprecated code and code location More than reviewing code and organizing it, many apparent dead code was removed. More importantly, mislocated code was put in the right app. This is the case for snippet animations which is a concept for website apps but was defined in the web_editor app, or some translation concepts which were part of website but should have been part of web_editor. --- There are probably more things to say about this commit but I will let the comments speak for those.
2017-06-26[MERGE] forward port branch saas-15 up to 4d79a1ff58fChristophe Simonis
2017-06-16[IMP] mass_mailing: allow to don't wrap a template in a tableJeremy Kersten
In some case we don't want to wrap the content to be centered. Now, you can add a data-nowrap when you define the theme params to don't wrap it in a table automatically Eg: <div data-name="blank" data-img="/xxx" >> data-nowrap="1" data-images-info='{...}'>
2017-06-15[FIX] web_editor,mass_mailing: adapt d7939282 to new viewsJoren Van Onder
Also adds body_html to the blacklisted fields. Because that tends to be quite long as well.
2017-05-16[MERGE] Forward-port saas-15 up to 878fbc75ff9ebade92f43748500e64350367a824Olivier Dony
2017-05-15[FIX] mass_mailing: increase email clients compatibilityqsm-odoo
Creating a mail template which is complex and compatible with all mail clients is a very difficult task as each mail client supports a different subset of basic CSS rules. This commit fixes 3 problems which were occuring in outlook and/or thunderbird but not in gmail: - Main layout horizontal overflow -> change 24px horizontal padding of main layout to 3% and set the width to 94% (so that the sum is 100%) - Fixed 600px content was full width instead -> Change the .o_mail_wrapper to be a <table> element instead of a <div> element. The table is full-width and contains one row of 3 cells: an empty left one, a fixed 600px-width center one and an empty right one. This allows to have the same layout as before but without using the unsupported max-width css rule. - Texts were not using the right color and font-size -> <p> elements were not properly inheriting the color and font-size properties, so force the style on <p> elements. opw-743156
2017-04-11[REF] web,*: convert Kanban widgets to new styleAaron Bohy
The remaining widgets were KanbanRecord and the two quick create widgets. Now, all kanban files have been converted and refactored.
2017-04-11[IMP] web, *: let kanban column and record know about modelNameqsm-odoo
* hr_attendance, hr_gamification, hr_recruitment, mass_mailing, project, sales_team Before this commit, the kanban column did not know about the model name which make customization impossible without a getParent. Kanban records were supposed to know about this thanks to the options parameter but this was broken. Now the model name is automatically initialized from the given state. Adapt all extensions which relied on this.
2017-04-11[IMP] *: remove deprecated view extensionsqsm-odoo
* account, mass_mailing, sales_team These view extensions have already been ignored for around two years. The new views development is a great opportunity to remove them.