Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from RamakrishnaVellala/17.0-develop
Browse files Browse the repository at this point in the history
G2p-2658 Rename Service Provider Portal to Registration Portal
  • Loading branch information
shibu-narayanan authored Aug 6, 2024
2 parents e52211e + 9b7ffc0 commit 7580370
Show file tree
Hide file tree
Showing 66 changed files with 8,205 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ org_name: OpenG2P
org_slug: OpenG2P
rebel_module_groups: []
repo_description: This repo contains openg2p auth related modules.
repo_name: OpenG2P Auth
repo_slug: openg2p-auth
repo_website: https://github.com/OpenG2P/openg2p-importer
repo_name: OpenG2P Registration Portal
repo_slug: openg2p-registration-portal
repo_website: https://github.com/OpenG2P/openg2p-registration-portal
use_pyproject_toml: true
use_ruff: true

62 changes: 62 additions & 0 deletions g2p_portal_base/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
=============================
G2P Registration Portal: Base
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b237d3d791f88a90d51a124702fbe5e62c63e36a293e907569cdc9a8f2d577d7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/github-OpenG2P%2Fopeng2p--registration--portal-lightgray.png?logo=github
:target: https://github.com/OpenG2P/openg2p-registration-portal/tree/17.0-develop/g2p_portal_base
:alt: OpenG2P/openg2p-registration-portal

|badge1| |badge2|

OpenG2P Registration Portal Base

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OpenG2P/openg2p-registration-portal/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OpenG2P/openg2p-registration-portal/issues/new?body=module:%20g2p_portal_base%0Aversion:%2017.0-develop%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* OpenG2P

Contributors
~~~~~~~~~~~~

`Manoj Kumar <[email protected]>`

Maintainers
~~~~~~~~~~~

This module is part of the `OpenG2P/openg2p-registration-portal <https://github.com/OpenG2P/openg2p-registration-portal/tree/17.0-develop/g2p_portal_base>`_ project on GitHub.

You are welcome to contribute.
3 changes: 3 additions & 0 deletions g2p_portal_base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Part of OpenG2P. See LICENSE file for full copyright and licensing details.
from . import models
from . import controllers
32 changes: 32 additions & 0 deletions g2p_portal_base/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "G2P Registration Portal: Base",
"category": "OpenG2P",
"version": "17.0.1.0.0",
"sequence": 1,
"author": "OpenG2P",
"website": "https://openg2p.org",
"license": "Other OSI approved licence",
"development_status": "Alpha",
"depends": ["account", "website"],
"data": [
"views/about_us.xml",
"views/base.xml",
"views/home.xml",
"views/contact_us.xml",
"views/login.xml",
"views/profile.xml",
"views/other.xml",
"views/menu_view.xml",
"views/registration_portal_extend_view.xml",
],
"assets": {
"web.assets_frontend": [],
"web.assets_common": [],
"website.assets_wysiwyg": [],
},
"demo": [],
"images": [],
"application": True,
"installable": True,
"auto_install": False,
}
1 change: 1 addition & 0 deletions g2p_portal_base/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
72 changes: 72 additions & 0 deletions g2p_portal_base/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import logging
from argparse import _AppendAction

from werkzeug.exceptions import Forbidden, Unauthorized

from odoo import _, http
from odoo.http import request

from odoo.addons.web.controllers.home import Home

_logger = logging.getLogger(__name__)


class registrationBaseContorller(http.Controller):
@http.route(["/registration"], type="http", auth="public", website=True)
def portal_root(self, **kwargs):
if request.session and request.session.uid:
return request.redirect("/registration/home")
else:
return request.redirect("/registration/login")

@http.route(["/registration/login"], type="http", auth="public", website=True)
def registration_login(self, **kwargs):
redirect_uri = request.params.get("redirect") or "/registration/home"
if request.session and request.session.uid:
return request.redirect(redirect_uri)

context = {}

if request.httprequest.method == "POST":
res = Home().web_login(**kwargs)
if request.params["login_success"]:
return res
else:
context["error"] = "Invalid Credentials"

return request.render("g2p_portal_base.login_page", qcontext=context)

@http.route(["/registration/home"], type="http", auth="user", website=True)
def portal_home(self, **kwargs):
self.check_roles("registration")
return request.render("g2p_portal_base.home_page")

@http.route(["/registration/myprofile"], type="http", auth="public", website=True)
def portal_profile(self, **kwargs):
if request.session and request.session.uid:
current_partner = request.env.user.partner_id
return request.render(
"g2p_portal_base.profile_page",
{
"current_partner": current_partner,
},
)

@http.route(["/registration/aboutus"], type="http", auth="public", website=True)
def portal_about_us(self, **kwargs):
return request.render("g2p_portal_base.about_us_page")

@http.route(["/registration/contactus"], type="http", auth="public", website=True)
def portal_contact_us(self, **kwargs):
return request.render("g2p_portal_base.contact_us_page")

@http.route(["/registration/otherpage"], type="http", auth="public", website=True)
def portal_other_page(self, **kwargs):
return request.render("g2p_portal_base.other_page")

def check_roles(self, role_to_check):
if role_to_check == "registration":
if not request.session or not request.env.user:
raise Unauthorized(_("User is not logged in"))
if not request.env.user.partner_id.supplier_rank > 0:
raise Forbidden(_AppendAction("User is not allowed to access the portal"))
200 changes: 200 additions & 0 deletions g2p_portal_base/i18n/g2p_portal_base.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * g2p_portal_base
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.profile_page
msgid ""
"<span class=\"s_website_form_label_content\" style=\"color: #666666;\">Email"
" Address</span>"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.profile_page
msgid ""
"<span class=\"s_website_form_label_content\" style=\"color: "
"#666666;\">Mobile Number</span>"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.profile_page
msgid ""
"<span class=\"s_website_form_label_content\" style=\"color: "
"#666666;\">Name</span>"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "<span>English</span>"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "<span>Filipino</span>"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "<span>Français</span>"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.about_us_page
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "About Us"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.about_us_page
msgid "About Us | Registration Portal"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.contact_us_page
msgid "Contact Us"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.contact_us_page
msgid "Contact Us| Registration Portal"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.login_page
msgid "Email or Phone"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.login_page
msgid "Enter email or phone"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.login_page
msgid "Enter password"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.login_page
msgid "Facing any challenges?"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.login_page
msgid "Help"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.about_us_page
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.contact_us_page
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.other_page
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.profile_page
msgid "Home"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.home_page
msgid "Home | Registration Portal"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.login_page
msgid "Login"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "Logout"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.profile_page
msgid "My Profile"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.profile_page
msgid "My Profile | Registration Portal"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.other_page
msgid "Other"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "Others"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.other_page
msgid "Other| Registration Portal"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.about_us_page
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.contact_us_page
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.other_page
msgid ""
"Our experts are working hard to make this page available. Meanwhile, we "
"request you to please visit after some time."
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.about_us_page
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.contact_us_page
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.other_page
msgid "Page Under Construction!"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.login_page
msgid "Password"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.login_page
msgid "Reset Password"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "Search here"
msgstr ""

#. module: g2p_portal_base
#: model:ir.ui.menu,name:g2p_portal_base.menu_account_supplier
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.res_partner_view_search_g2p_inherit
msgid "Registration"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "User"
msgstr ""

#. module: g2p_portal_base
#. odoo-python
#: code:addons/g2p_portal_base/controllers/main.py:0
#, python-format
msgid "User is not logged in"
msgstr ""

#. module: g2p_portal_base
#: model_terms:ir.ui.view,arch_db:g2p_portal_base.base
msgid "© 2023 National Social Benefits Portal. All rights reserved."
msgstr ""
Empty file.
3 changes: 3 additions & 0 deletions g2p_portal_base/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions g2p_portal_base/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`Manoj Kumar <[email protected]>`
1 change: 1 addition & 0 deletions g2p_portal_base/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OpenG2P Registration Portal Base
Binary file added g2p_portal_base/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7580370

Please sign in to comment.