-
Notifications
You must be signed in to change notification settings - Fork 6
[16.0][ADD]SCB: add custom overrides for supercoop bremen #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 16.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # -*- coding: utf-8 -*- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # -*- coding: utf-8 -*- | ||
| { | ||
| "name": "SUPERCOOP Bremen Website Overrides", | ||
| "summary": "Navbar-, User-Menü- und Become-Cooperator-Anpassungen für SUPERCOOP Bremen", | ||
| "version": "16.0.1.0.0", | ||
| "author": "SUPERCOOP Bremen eG", | ||
| "website": "https://supercoop-bremen.de", | ||
| "category": "Website", | ||
| "license": "LGPL-3", | ||
| "depends": [ | ||
| "website", | ||
| "portal", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why "portal" module is a dependency of this module ? |
||
| "cooperator_website", | ||
| ], | ||
| "data": [ | ||
| "views/website_navbar.xml", | ||
| "views/website_user_menu.xml", | ||
| "views/website_become_cooperator.xml", | ||
| ], | ||
| "assets": {}, | ||
| "installable": True, | ||
| "application": False, | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <data noupdate="0"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| <!-- Become-Cooperator Seite: SUPERCOOP-spezifische Logik für Mitglieder vs. Nicht-Mitglieder --> | ||
| <template id="supercoop_become_cooperator_inherit" | ||
| name="SUPERCOOP Become Cooperator" | ||
| inherit_id="cooperator_website.becomecooperator"> | ||
|
|
||
| <!-- Ersetze nur den Block, der main_form_template aufruft, um eigene Logik einzufügen --> | ||
| <xpath expr="//t[@t-call='cooperator_website.main_form_template']" position="replace"> | ||
| <t t-call="cooperator_website.main_form_template"> | ||
|
|
||
| <!-- Mitgliedschaft ermitteln --> | ||
| <t t-set="user" t-value="request.env.user"/> | ||
| <t t-set="is_public" t-value="user._is_public()"/> | ||
| <t t-set="partner" t-value="(not is_public) and user.partner_id or False"/> | ||
| <!-- HINWEIS: Falls das Feld anders heißt (z.B. is_cooperator), hier anpassen --> | ||
| <t t-set="is_member" t-value="partner and partner.cooperator or False"/> | ||
|
|
||
| <!-- Titel je nach Status --> | ||
| <t t-if="is_member"> | ||
| <t t-set="title">Zusätzliche Anteile erwerben</t> | ||
| </t> | ||
| <t t-else=""> | ||
| <t t-set="title">Der Genossenschaft beitreten</t> | ||
| </t> | ||
|
|
||
| <!-- Hinweis für bereits eingeloggt + Mitglied --> | ||
| <t t-if="is_member"> | ||
| <div class="alert alert-info d-flex align-items-center mb-3" role="alert"> | ||
| <i class="fa fa-check-circle me-2"/> | ||
| <span>Du bist bereits Mitglied bei SUPERCOOP Bremen. Du kannst unten direkt zusätzliche Anteile zeichnen.</span> | ||
| </div> | ||
| </t> | ||
|
|
||
| <!-- Login/Bestätigungsmail-Blöcke --> | ||
| <div class="mb-3 field-login"> | ||
| <label for="email" class="form-label">Email</label> | ||
| <input class="form-control form-control-sm" | ||
| t-attf-class="form-control form-control-sm{{ error and 'email' in error and ' is-invalid' or '' }}" | ||
| autocapitalize="off" type="email" name="email" id="email" required="true" | ||
| t-att-readonly="logged" t-att-value="email" | ||
| placeholder="kontakt@supercoop-bremen.de"/> | ||
| </div> | ||
|
|
||
| <div t-if="not logged" class="mb-3 field-confirm_login" name="confirm_email_container"> | ||
| <label for="confirm_email" class="form-label">Confirm Email</label> | ||
| <input t-attf-class="form-control form-control-sm{{ error and 'confirm_email' in error and ' is-invalid' or '' }}" | ||
| autocapitalize="off" type="email" name="confirm_email" id="confirm_email" required="true" | ||
| t-att-readonly="logged" t-att-value="confirm_email" | ||
| placeholder="kontakt@supercoop-bremen.de"/> | ||
| </div> | ||
|
|
||
| <!-- Rest bleibt wie im Original --> | ||
| <t t-call="cooperator_website.contact_template"/> | ||
| <t t-call="cooperator_website.iban_template"/> | ||
| <t t-call="cooperator_website.address_template"/> | ||
| <t t-call="cooperator_website.shares_template"/> | ||
| <t t-call="cooperator_website.rules_template"/> | ||
|
|
||
| </t> | ||
| </xpath> | ||
|
Comment on lines
+11
to
+63
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not use such a In the same template, create several E.g.: <xpath expr="//div[hasclass('field-login')]" position="before">
<!-- Mitgliedschaft ermitteln -->
<t t-set="user" t-value="request.env.user"/>
<t t-set="is_public" t-value="user._is_public()"/>
<t t-set="partner" t-value="(not is_public) and user.partner_id or False"/>
<!-- HINWEIS: Falls das Feld anders heißt (z.B. is_cooperator), hier anpassen -->
<t t-set="is_member" t-value="partner and partner.cooperator or False"/>
<!-- Titel je nach Status -->
<t t-if="is_member">
<t t-set="title">Zusätzliche Anteile erwerben</t>
</t>
<t t-else="">
<t t-set="title">Der Genossenschaft beitreten</t>
</t>
<!-- Hinweis für bereits eingeloggt + Mitglied -->
<t t-if="is_member">
<div class="alert alert-info d-flex align-items-center mb-3" role="alert">
<i class="fa fa-check-circle me-2"/>
<span>Du bist bereits Mitglied bei SUPERCOOP Bremen. Du kannst unten direkt zusätzliche Anteile zeichnen.</span>
</div>
</t>
</xpath>
Also, please, use english for text. Then translate using `.po` files. |
||
|
|
||
| </template> | ||
|
|
||
| </data> | ||
| </odoo> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <data noupdate="0"> | ||
|
|
||
| <!-- Navbar-Anpassungen für SUPERCOOP Bremen --> | ||
| <template id="supercoop_navbar_inherit" | ||
| name="SUPERCOOP Navbar" | ||
| inherit_id="website.navbar"> | ||
|
|
||
| <!-- 1) Nav-Element leicht anpassen (shadow, etc.) --> | ||
| <xpath expr="//nav[@data-name='Navbar']" position="attributes"> | ||
| <!-- bestehende Klassen erweitern, nicht ersetzen --> | ||
| <attribute name="class" add=" shadow-sm" separator=" "/> | ||
| </xpath> | ||
|
|
||
| <!-- 2) Container: flex-Layout sicherstellen --> | ||
| <xpath expr="//div[@id='top_menu_container']" position="attributes"> | ||
| <attribute name="class"> | ||
| container d-flex align-items-center justify-content-start justify-content-lg-between | ||
| </attribute> | ||
| </xpath> | ||
|
|
||
| <!-- 3) Top-Menü-UL pilliger machen --> | ||
| <xpath expr="//ul[@id='top_menu']" position="attributes"> | ||
| <attribute name="class"> | ||
| nav navbar-nav flex-grow-1 nav-pills gap-3 | ||
| </attribute> | ||
| <attribute name="role">menu</attribute> | ||
| </xpath> | ||
|
|
||
| <!-- 4) Struktur-Slot rechts vom Menü (falls noch nicht vorhanden) --> | ||
| <xpath expr="//div[@id='top_menu_collapse']" position="after"> | ||
| <div class="oe_structure oe_structure_solo ms-lg-4"/> | ||
| </xpath> | ||
|
|
||
| </template> | ||
|
Comment on lines
+5
to
+36
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job here. :) |
||
|
|
||
| </data> | ||
| </odoo> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <data noupdate="0"> | ||
|
|
||
| <!-- User-Menü Override: keine Namen mehr, nur "Mein Konto" --> | ||
| <template id="supercoop_website_user_menu" | ||
| name="SUPERCOOP User Menu Override" | ||
| inherit_id="website.user_menu"> | ||
|
|
||
| <!-- Public-Teil ersetzen --> | ||
| <xpath expr="//t[@t-if='request.env.user._is_public()']" position="replace"> | ||
| <t t-if="request.env.user._is_public()"> | ||
| <ul class="navbar-nav ms-lg-auto"> | ||
| <li class="nav-item"> | ||
| <a class="nav-link" href="/web/login">Anmelden</a> | ||
| </li> | ||
| </ul> | ||
| </t> | ||
| </xpath> | ||
|
|
||
| <!-- Eingeloggt-Teil ersetzen --> | ||
| <xpath expr="//t[@t-else='']" position="replace"> | ||
| <t t-else=""> | ||
| <ul class="navbar-nav ms-lg-auto"> | ||
| <li class="nav-item dropdown o_no_autohide_item"> | ||
| <a href="#" role="button" | ||
| data-bs-toggle="dropdown" | ||
| class="dropdown-toggle nav-link fw-bold"> | ||
| <i class="fa fa-user-circle-o me-1"/> | ||
| <span>Mein Konto</span> | ||
| </a> | ||
| <div role="menu" class="dropdown-menu js_usermenu"> | ||
| <a href="/my/home" role="menuitem" class="dropdown-item ps-3"> | ||
| <i class="fa fa-fw fa-id-card-o me-1 small text-muted"/> Mein Konto | ||
| </a> | ||
| <a href="/my/shift" role="menuitem" class="dropdown-item"> | ||
| Meine Schichten | ||
| </a> | ||
| <div class="dropdown-divider"/> | ||
| <a id="o_logout" role="menuitem" class="dropdown-item ps-3" | ||
| href="/web/session/logout?redirect=/"> | ||
| <i class="fa fa-fw fa-sign-out me-1 small text-muted"/> Abmelden | ||
| </a> | ||
| </div> | ||
| </li> | ||
| </ul> | ||
| </t> | ||
| </xpath> | ||
|
|
||
| </template> | ||
|
|
||
| </data> | ||
| </odoo> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m not sure about this template. I don’t find Also using |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since python 3 this header is not needed in files as all files must be utf-8. To remove in all files.
Instead use header like this:
Edit to conform you copyright holder.