Feat: Home and Contact pages setup with Altcha bot protection and saving to database using alterntive layout.
This commit is contained in:
@@ -112,6 +112,7 @@ class Model_View_Base(BaseModel, ABC):
|
||||
FLAG_ASSESSMENT: ClassVar[str] = Assessment.FLAG_ASSESSMENT
|
||||
FLAG_ASSESSMENT_COMMAND_MODALITY_LINK: ClassVar[str] = Assessment_Command_Modality_Link.FLAG_ASSESSMENT_COMMAND_MODALITY_LINK
|
||||
FLAG_ASSESSMENT_RESPONSE: ClassVar[str] = Assessment_Response.FLAG_ASSESSMENT_RESPONSE
|
||||
FLAG_BENEFITS: ClassVar[str] = 'benefits'
|
||||
FLAG_BOOL_FALSE: ClassVar[str] = 'false'
|
||||
FLAG_BOOL_TRUE: ClassVar[str] = 'true'
|
||||
FLAG_BRIBE: ClassVar[str] = Bribe.FLAG_BRIBE
|
||||
@@ -139,6 +140,8 @@ class Model_View_Base(BaseModel, ABC):
|
||||
FLAG_CONTAINER_ICON_AND_LABEL: ClassVar[str] = 'container-icon-label'
|
||||
FLAG_CONTAINER_INPUT: ClassVar[str] = 'container-input'
|
||||
FLAG_CSRF_TOKEN: ClassVar[str] = 'X-CSRFToken'
|
||||
FLAG_CTA_1: ClassVar[str] = 'cta-1'
|
||||
FLAG_CTA_2: ClassVar[str] = 'cta-2'
|
||||
FLAG_DATA: ClassVar[str] = 'data'
|
||||
FLAG_DATE_FROM: ClassVar[str] = Base.FLAG_DATE_FROM
|
||||
FLAG_DATE_TO: ClassVar[str] = Base.FLAG_DATE_TO
|
||||
@@ -159,6 +162,8 @@ class Model_View_Base(BaseModel, ABC):
|
||||
FLAG_ERROR: ClassVar[str] = 'error'
|
||||
FLAG_EXPANDED: ClassVar[str] = 'expanded'
|
||||
FLAG_FAILURE: ClassVar[str] = 'failure'
|
||||
FLAG_FAQ: ClassVar[str] = 'faq'
|
||||
FLAG_FEATURES: ClassVar[str] = 'features'
|
||||
FLAG_FILTER: ClassVar[str] = 'filter'
|
||||
FLAG_FORM: ClassVar[str] = 'form'
|
||||
FLAG_FORM_FILTERS: ClassVar[str] = 'form-filters'
|
||||
@@ -272,8 +277,20 @@ class Model_View_Base(BaseModel, ABC):
|
||||
NAME_COMPANY: ClassVar[str] = 'Precision And Research Technology Systems Limited - Fetch Metrics'
|
||||
NAME_COMPANY_SHORT: ClassVar[str] = 'Fetch Metrics'
|
||||
NAME_CSRF_TOKEN: ClassVar[str] = 'csrf-token'
|
||||
URL_GITHUB: ClassVar[str] = 'https://github.com/Teddy-1024'
|
||||
URL_LINKEDIN: ClassVar[str] = 'https://uk.linkedin.com/in/teddyms'
|
||||
USERNAME_DISCORD: ClassVar[str] = 'Fetch Metrics'
|
||||
USERNAME_GITHUB: ClassVar[str] = 'Teddy-1024'
|
||||
USERNAME_INSTAGRAM: ClassVar[str] = 'fetchmetrics'
|
||||
USERNAME_LINKEDIN: ClassVar[str] = 'teddyms'
|
||||
USERNAME_REDDIT: ClassVar[str] = 'Fetch-Metrics'
|
||||
USERNAME_TIKTOK: ClassVar[str] = 'fetchmetrics'
|
||||
USERNAME_TWITTER: ClassVar[str] = 'FetchMetrics'
|
||||
URL_DISCORD: ClassVar[str] = f'https://discord.gg/WFZN6WuZ'
|
||||
URL_GITHUB: ClassVar[str] = f'https://github.com/{USERNAME_GITHUB}'
|
||||
URL_INSTAGRAM: ClassVar[str] = f'https://www.instagram.com/{USERNAME_INSTAGRAM}/'
|
||||
URL_LINKEDIN: ClassVar[str] = f'https://uk.linkedin.com/in/{USERNAME_LINKEDIN}'
|
||||
URL_REDDIT: ClassVar[str] = f'https://www.reddit.com/u/{USERNAME_REDDIT}/s/gZKEz2ZwHN'
|
||||
URL_TIKTOK: ClassVar[str] = f'https://www.tiktok.com/@{USERNAME_TIKTOK}'
|
||||
URL_TWITTER: ClassVar[str] = f'https://x.com/{USERNAME_TWITTER}'
|
||||
|
||||
_title: str
|
||||
hash_page_current: str
|
||||
|
||||
31
models/model_view_contact.py
Normal file
31
models/model_view_contact.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: View Models
|
||||
Feature: Contact View Model
|
||||
|
||||
Description:
|
||||
Data model for contact view
|
||||
"""
|
||||
|
||||
# internal
|
||||
from business_objects.project_hub.contact_form import Contact_Form
|
||||
from models.model_view_base import Model_View_Base
|
||||
# from routes import bp_home
|
||||
from lib import argument_validation as av
|
||||
from forms.project_hub.contact import Form_Contact
|
||||
# external
|
||||
from flask_wtf import FlaskForm
|
||||
from abc import abstractproperty
|
||||
from pydantic import BaseModel
|
||||
from typing import ClassVar
|
||||
|
||||
class Model_View_Contact(Model_View_Base):
|
||||
|
||||
form_contact: Form_Contact
|
||||
|
||||
def __init__(self, form_contact, hash_page_current=Model_View_Base.HASH_PAGE_CONTACT, **kwargs):
|
||||
super().__init__(hash_page_current=hash_page_current, form_contact=form_contact, **kwargs)
|
||||
self._title = 'Contact'
|
||||
28
models/model_view_contact_success.py
Normal file
28
models/model_view_contact_success.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: View Models
|
||||
Feature: Contact View Model
|
||||
|
||||
Description:
|
||||
Data model for contact view
|
||||
"""
|
||||
|
||||
# internal
|
||||
from models.model_view_base import Model_View_Base
|
||||
# from routes import bp_home
|
||||
from lib import argument_validation as av
|
||||
# from forms.contact import Form_Contact
|
||||
# external
|
||||
from flask_wtf import FlaskForm
|
||||
from abc import abstractproperty
|
||||
from pydantic import BaseModel
|
||||
from typing import ClassVar
|
||||
|
||||
class Model_View_Contact_Success(Model_View_Base):
|
||||
|
||||
def __init__(self, hash_page_current=Model_View_Base.HASH_PAGE_CONTACT_SUCCESS, **kwargs):
|
||||
super().__init__(hash_page_current=hash_page_current, **kwargs)
|
||||
self._title = 'Contact Success'
|
||||
@@ -14,8 +14,15 @@ Data model for home view
|
||||
from models.model_view_base import Model_View_Base
|
||||
# from routes import bp_home
|
||||
# external
|
||||
from typing import ClassVar
|
||||
|
||||
|
||||
class Model_View_Home(Model_View_Base):
|
||||
FLAG_EARLY_ACCESS: ClassVar[str] = 'early-access'
|
||||
FLAG_PROBLEM: ClassVar[str] = 'problem'
|
||||
FLAG_SOCIAL_PROOF: ClassVar[str] = 'social-proof'
|
||||
FLAG_SOLUTION: ClassVar[str] = 'solution'
|
||||
|
||||
def __init__(self, hash_page_current=Model_View_Base.HASH_PAGE_HOME):
|
||||
super().__init__(hash_page_current=hash_page_current)
|
||||
self._title = 'Home'
|
||||
|
||||
Reference in New Issue
Block a user