Skip to content

Commit

Permalink
🚒 12.0 port
Browse files Browse the repository at this point in the history
  • Loading branch information
fedoranvar authored and fedoranvar committed Aug 26, 2019
1 parent 722f55a commit c1f0e91
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 48 deletions.
9 changes: 5 additions & 4 deletions website_team/README.rst
Expand Up @@ -13,7 +13,8 @@ Credits

Contributors
------------
* Kolushov Alexandr <kolushov@it-projects.info>
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Anvar Kildebekov <https://it-projects.info/team/fedoranvar>`__

Sponsors
--------
Expand All @@ -26,12 +27,12 @@ Maintainers
Further information
===================

Demo: http://runbot.it-projects.info/demo/misc-addons/8.0
Demo: http://runbot.it-projects.info/demo/misc-addons/12.0

HTML Description: https://apps.odoo.com/8.0/website_team/
HTML Description: https://apps.odoo.com/12.0/website_team/

Usage instructions: `<doc/index.rst>`__

Changelog: `<doc/changelog.rst>`__

Tested on Odoo 8.0 27a47eb3c3d4b79d8fffb6df66f107a993ddf805
Tested on Odoo 12.0 32c2666d189047db66eb7b1392ea34b086fd341e
1 change: 0 additions & 1 deletion website_team/__init__.py
@@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
from . import controllers
from . import models
7 changes: 3 additions & 4 deletions website_team/__manifest__.py
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
{
"name": """Website Team""",
"summary": """Team""",
"category": "website",
# "live_test_URL": "",
"images": [],
"version": "1.0.0",
"images": ["images/website_team.png"],
"version": "12.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Kolushov Alexandr",
Expand Down Expand Up @@ -33,5 +32,5 @@
"post_init_hook": None,

"auto_install": False,
"installable": False,
"installable": True,
}
1 change: 0 additions & 1 deletion website_team/controllers/__init__.py
@@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from . import main
7 changes: 3 additions & 4 deletions website_team/controllers/main.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from openerp import http
from odoo import http
import werkzeug
from werkzeug.exceptions import NotFound

Expand All @@ -20,8 +19,8 @@ def user(self, login):
current_user = User.search([('username_github', '=', login), ('website_published', '=', True)])

if not current_user:
current_user = User.search([('alias_name', '=', login), ('website_published', '=', True)])
if current_user.username_github is not False and current_user.username_github != current_user.alias_name:
current_user = User.search([('login', '=', login), ('website_published', '=', True)])
if current_user.username_github is not False and current_user.username_github != current_user.login:
return werkzeug.utils.redirect("/team/" + current_user.username_github)

if current_user.id is False:
Expand Down
Binary file added website_team/images/website_team.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions website_team/models/__init__.py
@@ -1,4 +1 @@
# -*- coding: utf-8 -*-

from . import team

12 changes: 3 additions & 9 deletions website_team/models/team.py
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from openerp import models, fields, api, _
from openerp.exceptions import Warning as UserError
from odoo import models, fields, api, _
from odoo.exceptions import Warning as UserError
import re


Expand Down Expand Up @@ -42,11 +40,7 @@ def get_youtube_id(self, link):
return "https://www.youtube.com/embed/" + link_id + "?rel=0&amp;showinfo=0"

def get_alias_mail(self):
if self.alias_name:
alias_email_full = self.alias_name + "@" + self.alias_domain
return alias_email_full
else:
return False
return self.email if self.login else False


class ResCompany(models.Model):
Expand Down
38 changes: 19 additions & 19 deletions website_team/views/website_team_template.xml
@@ -1,5 +1,5 @@
<openerp>
<data>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="website_team_twitter" name="Website Team Twitter">
<script src="https://buttons.github.io/buttons.js"></script>
<script>
Expand Down Expand Up @@ -27,7 +27,7 @@
</xpath>
</template>

<template name="user list" id="team_template" page="True">
<template name="user list" id="team_template">
<t t-call="website.layout">
<t t-set="title">Team </t>
<div class="oe_structure">
Expand All @@ -40,25 +40,25 @@
<div class="col-md-3">
<div class="team_profile">
<t t-if="user.partner_id.image is not None">
<a t-if="user.username_github" t-attf-href="/team/{{ user.username_github }}/"><span t-field="user.image" class="team_image image" t-field-options='{"widget": "image"}' /></a>
<a t-if="user.username_github is False and user.alias_name" t-attf-href="/team/{{ user.alias_name }}/"><span t-field="user.image" class="team_image image" t-field-options='{"widget": "image"}' /></a>
<t t-if="user.username_github is False and user.alias_name is False">
<span t-field="user.image" class="team_image image" t-field-options='{"widget": "image"}' />
<a t-if="user.username_github" t-attf-href="/team/{{ user.username_github }}/"><span t-field="user.image" class="team_image image" t-options='{"widget": "image"}' /></a>
<a t-if="user.username_github is False and user.login" t-attf-href="/team/{{ user.login }}/"><span t-field="user.image" class="team_image image" t-options='{"widget": "image"}' /></a>
<t t-if="user.username_github is False and user.login is False">
<span t-field="user.image" class="team_image image" t-options='{"widget": "image"}' />
</t>
</t>
<t t-if="user.partner_id.image is None">
<a t-if="user.username_github" t-attf-href="/team/{{ user.username_github }}/"><img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/></a>
<a t-if="user.username_github is False and user.alias_name" t-attf-href="/team/{{ user.alias_name }}/"><img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/></a>
<t t-if="user.username_github is False and user.alias_name is False">
<a t-if="user.username_github is False and user.login" t-attf-href="/team/{{ user.login }}/"><img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/></a>
<t t-if="user.username_github is False and user.login is False">
<img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/>
</t>
</t>
<div class="user">
<a t-if="user.username_github" t-attf-href="/team/{{ user.username_github }}/"><t t-esc="user.name"/></a>
<t t-if="user.username_github is False">
<a t-if="user.alias_name" t-attf-href="/team/{{ user.alias_name }}/"><t t-esc="user.name"/></a>
<a t-if="user.login" t-attf-href="/team/{{ user.login }}/"><t t-esc="user.name"/></a>
</t>
<t t-if="user.username_github is False and user.alias_name is False">
<t t-if="user.username_github is False and user.login is False">
<t t-esc="user.name"/>
</t>
</div>
Expand Down Expand Up @@ -88,7 +88,7 @@
</t>
</template>

<template name="user card" id="user_template" page="True">
<template name="user card" id="user_template">
<t t-call="website.layout">
<t t-set="title"><t t-esc="user.name"/></t>
<div class="container">
Expand Down Expand Up @@ -118,7 +118,7 @@
</div>
<div class="col-md-1 user_avatar">
<t t-if="user.partner_id.image is not None">
<span t-field="user.image" class="image" t-field-options='{"widget": "image"}' />
<span t-field="user.image" class="image" t-options='{"widget": "image"}' />
</t>
<t t-if="user.partner_id.image is None">
<img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/>
Expand All @@ -138,8 +138,8 @@
<div class="github" t-if="user.username_github">
<a class="github-button" t-attf-href="https://github.com/{{ user.username_github }}" data-show-count="true" aria-label="Follow @user on GitHub">Follow</a>
</div>
<div class="email" t-if="user.alias_name">
<a t-attf-href="mailto:{{user.alias_name}}@{{user.alias_domain}}" target="_blank"><i class="fa fa-envelope-o"/></a>
<div class="email" t-if="user.login">
<a t-attf-href="mailto:{{user.login}}@{{user.email}}" target="_blank"><i class="fa fa-envelope-o"/></a>
</div>
</div>
</div>
Expand Down Expand Up @@ -171,11 +171,11 @@
</t>
</template>

<template id="footer_custom" inherit_id="website.footer_default" name="Footer Team Link">
<xpath expr="//div[@id='info']/ul" position="inside">
<template id="footer_custom" inherit_id="website.footer_custom" name="Footer Team Link">
<xpath expr="//footer//div[@id='connect']//ul//li[1]" position="after">
<li><a href="/team">Team</a></li>
</xpath>
</template>

</data>
</openerp>

</odoo>
9 changes: 6 additions & 3 deletions website_team/views/website_team_view.xml
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@class='oe_title']//field[@name='active']" position="after">
<xpath expr="//button[hasclass('oe_stat_button')]" position="after">
<div>
<label for="website_published" string="Show at team page"/>
<field name="website_published"/>
</div>
</xpath>
<xpath expr="//group[@name='preferences']" position="inside">
<field name="location"/>
Expand Down Expand Up @@ -42,4 +45,4 @@
<field name="parent_id" ref="website.main_menu" />
</record>
</data>
</openerp>
</odoo>

0 comments on commit c1f0e91

Please sign in to comment.