Feat: Dogs page.
This commit is contained in:
2
app.py
2
app.py
@@ -31,6 +31,7 @@ from controllers.dog.dog_command_link import routes_dog_dog_command_link
|
||||
from controllers.dog.home import routes_dog_home
|
||||
from controllers.dog.location import routes_dog_location
|
||||
from controllers.legal.legal import routes_legal
|
||||
from controllers.user.company import routes_user_company
|
||||
from controllers.user.user import routes_user
|
||||
from extensions import db, csrf, mail, oauth
|
||||
from helpers.helper_app import Helper_App
|
||||
@@ -135,6 +136,7 @@ app.register_blueprint(routes_dog_assessment)
|
||||
app.register_blueprint(routes_dog_calendar_entry)
|
||||
app.register_blueprint(routes_legal)
|
||||
app.register_blueprint(routes_user)
|
||||
app.register_blueprint(routes_user_company)
|
||||
|
||||
|
||||
@app.template_filter('console_log')
|
||||
|
||||
@@ -12,6 +12,7 @@ from business_objects.base import Base
|
||||
from business_objects.db_base import SQLAlchemy_ABC, Get_Many_Parameters_Base
|
||||
import lib.argument_validation as av
|
||||
from extensions import db
|
||||
from forms.dog.company import Filters_Company
|
||||
from helpers.helper_app import Helper_App
|
||||
# external
|
||||
from dataclasses import dataclass
|
||||
@@ -154,10 +155,9 @@ class Parameters_Company(Get_Many_Parameters_Base):
|
||||
, require_any_non_id_search_filters_met = json.get('a_require_any_non_id_search_filters_met', True)
|
||||
)
|
||||
|
||||
"""
|
||||
@classmethod
|
||||
def from_form_filters_company(cls, form):
|
||||
av.val_instance(form, 'form', 'Parameters_Company.from_form_filters_company', Filters_Company)
|
||||
av.val_instance(form, 'form', f'{cls.__qualname__}.from_form_filters_company', Filters_Company)
|
||||
has_filter_search_text = not (form.search.data == '' or form.search.data is None)
|
||||
active_only = av.input_bool(form.active_only.data, "active", "Parameters_Company.from_form_filters_company")
|
||||
filters = cls.get_default()
|
||||
@@ -165,9 +165,8 @@ class Parameters_Company(Get_Many_Parameters_Base):
|
||||
filters.get_inactive_company = not active_only
|
||||
filters.ids_company = ''
|
||||
filters.names_company = form.search.data if has_filter_search_text else ''
|
||||
filters.notes_company = form.search.data if has_filter_search_text else ''
|
||||
filters.websites_company = form.search.data if has_filter_search_text else ''
|
||||
return filters
|
||||
"""
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
|
||||
@@ -10,6 +10,7 @@ Feature: Dog Business Object
|
||||
# internal
|
||||
from business_objects.base import Base
|
||||
from business_objects.db_base import SQLAlchemy_ABC, Get_Many_Parameters_Base
|
||||
from forms.dog.dog import Filters_Dog
|
||||
import lib.argument_validation as av
|
||||
from extensions import db
|
||||
from helpers.helper_app import Helper_App
|
||||
@@ -175,21 +176,18 @@ class Parameters_Dog(Get_Many_Parameters_Base):
|
||||
, require_any_non_id_search_filters_met = json.get('a_require_any_non_id_search_filters_met', True)
|
||||
)
|
||||
|
||||
"""
|
||||
@classmethod
|
||||
def from_form_filters_dog(cls, form):
|
||||
av.val_instance(form, 'form', 'Parameters_Dog.from_form_filters_dog', Filters_Dog)
|
||||
has_filter_id = not (form.id_dog.data == '0' or form.id_dog.data == '' or form.id_dog.data is None)
|
||||
has_filter_name = not (form.name_dog.data == '0' or form.name_dog.data == '' or form.name_dog.data is None)
|
||||
has_filter_dog = has_filter_id or has_filter_name
|
||||
active_only = av.input_bool(form.active.data, "active", "Parameters_Dog.from_form_filters_dog")
|
||||
return cls(
|
||||
get_all_dog = not has_filter_dog
|
||||
, get_inactive_dog = not active_only
|
||||
, ids_dog = form.id_dog.data if has_filter_id else ''
|
||||
, names_dog = form.name_dog.data if has_filter_name else ''
|
||||
)
|
||||
"""
|
||||
has_filter_search_text = not (form.search.data == '' or form.search.data is None)
|
||||
has_filter_dog = has_filter_search_text # has_filter_id or has_filter_name
|
||||
active_only = av.input_bool(form.active_only.data, "active_only", "Parameters_Dog.from_form_filters_dog")
|
||||
filter_parameters = cls.get_default()
|
||||
filter_parameters.get_all_dog = not has_filter_dog
|
||||
filter_parameters.get_inactive_dog = not active_only
|
||||
filter_parameters.ids_dog = '' # form.id_dog.data if has_filter_id else ''
|
||||
filter_parameters.names_dog = form.search.data if has_filter_search_text else ''
|
||||
return filter_parameters
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
|
||||
@@ -25,6 +25,7 @@ class User(SQLAlchemy_ABC, Base):
|
||||
ATTR_ID_USER_AUTH0: ClassVar[str] = 'id_user_auth0'
|
||||
FLAG_CAN_ADMIN_DOG: ClassVar[str] = 'can_admin_dog'
|
||||
FLAG_CAN_ADMIN_USER: ClassVar[str] = 'can_admin_user'
|
||||
FLAG_CAN_EDIT_COMPANY: ClassVar[str] = 'can_edit_company'
|
||||
FLAG_IS_EMAIL_VERIFIED: ClassVar[str] = 'is_email_verified'
|
||||
FLAG_IS_SUPER_USER: ClassVar[str] = 'is_super_user'
|
||||
FLAG_PRIORITY_ACCESS_LEVEL: ClassVar[str] = 'priority_access_level'
|
||||
@@ -44,6 +45,7 @@ class User(SQLAlchemy_ABC, Base):
|
||||
priority_access_level = db.Column(db.Integer)
|
||||
can_admin_dog = db.Column(db.Boolean)
|
||||
can_admin_user = db.Column(db.Boolean)
|
||||
can_edit_company = db.Column(db.Boolean)
|
||||
is_new = db.Column(db.Boolean)
|
||||
active = db.Column(db.Boolean)
|
||||
|
||||
@@ -52,6 +54,7 @@ class User(SQLAlchemy_ABC, Base):
|
||||
self.is_new = False
|
||||
self.can_admin_dog = False
|
||||
self.can_admin_user = False
|
||||
self.can_edit_company = False
|
||||
self.id_company = None
|
||||
self.company = None
|
||||
self.id_role = None
|
||||
@@ -75,6 +78,7 @@ class User(SQLAlchemy_ABC, Base):
|
||||
user.priority_access_level = query_row[12]
|
||||
user.can_admin_dog = av.input_bool(query_row[13], cls.FLAG_CAN_ADMIN_DOG, _m)
|
||||
user.can_admin_user = av.input_bool(query_row[14], cls.FLAG_CAN_ADMIN_USER, _m)
|
||||
user.can_edit_company = av.input_bool(query_row[15], cls.FLAG_CAN_ADMIN_USER, _m)
|
||||
# user.is_new = av.input_bool(query_row[9], 'is_new', _m)
|
||||
user.role = Role.from_db_user(query_row)
|
||||
user.company = Company.from_db_user(query_row)
|
||||
@@ -106,6 +110,7 @@ class User(SQLAlchemy_ABC, Base):
|
||||
user.is_super_user = av.input_bool(json[cls.FLAG_IS_SUPER_USER], cls.FLAG_IS_SUPER_USER, _m)
|
||||
user.can_admin_dog = user.is_super_user or json[cls.FLAG_CAN_ADMIN_DOG]
|
||||
user.can_admin_user = user.is_super_user or json[cls.FLAG_CAN_ADMIN_USER]
|
||||
user.can_edit_company = user.is_super_user or json.get(cls.FLAG_CAN_EDIT_COMPANY, False)
|
||||
user.role = Role.from_json(json[Role.FLAG_ROLE])
|
||||
user.company = Company.from_json(json[Company.FLAG_COMPANY])
|
||||
return user
|
||||
@@ -126,7 +131,7 @@ class User(SQLAlchemy_ABC, Base):
|
||||
|
||||
user.can_admin_dog = user.is_super_user
|
||||
user.can_admin_user = user.is_super_user
|
||||
|
||||
user.can_edit_company = user.is_super_user
|
||||
return user
|
||||
|
||||
def to_json(self):
|
||||
@@ -143,10 +148,11 @@ class User(SQLAlchemy_ABC, Base):
|
||||
, self.FLAG_PRIORITY_ACCESS_LEVEL: self.priority_access_level
|
||||
, self.FLAG_CAN_ADMIN_DOG: self.can_admin_dog
|
||||
, self.FLAG_CAN_ADMIN_USER: self.can_admin_user
|
||||
, self.FLAG_CAN_EDIT_COMPANY: self.can_edit_company
|
||||
, Company.ATTR_ID_COMPANY: self.id_company
|
||||
, Company.FLAG_COMPANY: self.company.to_json()
|
||||
, Company.FLAG_COMPANY: None if self.company is None else self.company.to_json()
|
||||
, Role.ATTR_ID_ROLE: self.id_role
|
||||
, Role.FLAG_ROLE: self.role.to_json()
|
||||
, Role.FLAG_ROLE: None if self.role is None else self.role.to_json()
|
||||
}
|
||||
return as_json
|
||||
|
||||
@@ -164,6 +170,7 @@ User (
|
||||
, {self.FLAG_PRIORITY_ACCESS_LEVEL}: {self.priority_access_level}
|
||||
, {self.FLAG_CAN_ADMIN_DOG}: {self.can_admin_dog}
|
||||
, {self.FLAG_CAN_ADMIN_USER}: {self.can_admin_user}
|
||||
, {self.FLAG_CAN_EDIT_COMPANY}: {self.can_edit_company}
|
||||
, {Role.ATTR_ID_ROLE}: {self.id_role}
|
||||
, {Role.FLAG_ROLE}: {self.role}
|
||||
, {Company.ATTR_ID_COMPANY}: {self.id_company}
|
||||
|
||||
@@ -13,12 +13,11 @@ Contact Page Controller.
|
||||
# IMPORTS
|
||||
# internal
|
||||
from business_objects.api import API
|
||||
from business_objects.dog.command import Command
|
||||
from business_objects.dog.dog_command_link import Dog_Command_Link
|
||||
from business_objects.dog.dog import Dog
|
||||
from datastores.datastore_dog import DataStore_Dog
|
||||
from forms.dog.dog_command_link import Filters_Dog_Command_Link
|
||||
from forms.dog.dog import Filters_Dog
|
||||
from helpers.helper_app import Helper_App
|
||||
from models.model_view_dog_base import Model_View_Dog_Base
|
||||
from models.model_view_dog_dog import Model_View_Dog_Dog
|
||||
from models.model_view_home import Model_View_Home
|
||||
import lib.argument_validation as av
|
||||
# external
|
||||
@@ -41,10 +40,68 @@ routes_dog = Blueprint('routes_dog', __name__)
|
||||
|
||||
|
||||
"""
|
||||
@routes_dog.route(Model_View_Dog_Base.HASH_GET_DOG_SCRIPTS_SHARED, methods=['GET'])
|
||||
@routes_dog.route(Model_View_Dog_Dog.HASH_GET_DOG_SCRIPTS_SHARED, methods=['GET'])
|
||||
def scripts_section_dog():
|
||||
hash_page_current = request.args.get('hash_page_current', default = Model_View_Dog_Base.HASH_GET_DOG_SCRIPTS_SHARED, type = str)
|
||||
model = Model_View_Dog_Base(hash_page_current=hash_page_current)
|
||||
hash_page_current = request.args.get('hash_page_current', default = Model_View_Dog_Dog.HASH_GET_DOG_SCRIPTS_SHARED, type = str)
|
||||
model = Model_View_Dog_Dog(hash_page_current=hash_page_current)
|
||||
template = render_template('js/sections/dog.js', model = model)
|
||||
return Response(template, mimetype='application/javascript')
|
||||
"""
|
||||
"""
|
||||
|
||||
|
||||
@routes_dog.route(Model_View_Dog_Dog.HASH_PAGE_DOG_DOGS, methods=['GET'])
|
||||
def dogs():
|
||||
Helper_App.console_log('dogs')
|
||||
Helper_App.console_log(f'request_args: {request.args}')
|
||||
try:
|
||||
form_filters = Filters_Dog.from_json(request.args)
|
||||
except Exception as e:
|
||||
Helper_App.console_log(f'Error: {e}')
|
||||
form_filters = Filters_Dog()
|
||||
Helper_App.console_log(f'form_filters={form_filters}')
|
||||
model = Model_View_Dog_Dog(form_filters_old = form_filters)
|
||||
if not model.is_user_logged_in:
|
||||
return redirect(url_for('routes_dog_home.home'))
|
||||
Helper_App.console_log(f'form_filters={form_filters}')
|
||||
return render_template('pages/dog/_dogs.html', model = model)
|
||||
|
||||
@routes_dog.route(Model_View_Dog_Dog.HASH_SAVE_DOG_DOG, methods=['POST'])
|
||||
def save_dog():
|
||||
data = Helper_App.get_request_data(request)
|
||||
try:
|
||||
form_filters = Filters_Dog.from_json(data[Model_View_Dog_Dog.FLAG_FORM_FILTERS])
|
||||
if not form_filters.validate_on_submit():
|
||||
return jsonify({
|
||||
Model_View_Dog_Dog.FLAG_STATUS: Model_View_Dog_Dog.FLAG_FAILURE,
|
||||
Model_View_Dog_Dog.FLAG_MESSAGE: f'Filters form invalid.\n{form_filters.errors}'
|
||||
})
|
||||
model_return = Model_View_Dog_Dog(form_filters_old=form_filters)
|
||||
if not model_return.is_user_logged_in:
|
||||
raise Exception('User not logged in')
|
||||
|
||||
dogs = data[Model_View_Dog_Dog.FLAG_DOG]
|
||||
if len(dogs) == 0:
|
||||
return jsonify({
|
||||
Model_View_Dog_Dog.FLAG_STATUS: Model_View_Dog_Dog.FLAG_FAILURE,
|
||||
Model_View_Dog_Dog.FLAG_MESSAGE: f'No dogs.'
|
||||
})
|
||||
objs_dog = []
|
||||
for dog in dogs:
|
||||
objs_dog.append(Dog.from_json(dog))
|
||||
Helper_App.console_log(f'objs_dog={objs_dog}')
|
||||
errors = DataStore_Dog.save_dogs(data.get('comment', 'No comment'), objs_dog)
|
||||
|
||||
if (len(errors) > 0):
|
||||
return jsonify({
|
||||
Model_View_Dog_Dog.FLAG_STATUS: Model_View_Dog_Dog.FLAG_FAILURE,
|
||||
Model_View_Dog_Dog.FLAG_MESSAGE: f'Error saving dogs.\n{model_return.convert_list_objects_to_json(errors)}'
|
||||
})
|
||||
return jsonify({
|
||||
Model_View_Dog_Dog.FLAG_STATUS: Model_View_Dog_Dog.FLAG_SUCCESS,
|
||||
Model_View_Dog_Dog.FLAG_DATA: Model_View_Dog_Dog.convert_list_objects_to_json(model_return.dogs)
|
||||
})
|
||||
except Exception as e:
|
||||
return jsonify({
|
||||
Model_View_Dog_Dog.FLAG_STATUS: Model_View_Dog_Dog.FLAG_FAILURE,
|
||||
Model_View_Dog_Dog.FLAG_MESSAGE: f'Bad data received by controller.\n{e}'
|
||||
})
|
||||
115
controllers/user/company.py
Normal file
115
controllers/user/company.py
Normal file
@@ -0,0 +1,115 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: App Routing
|
||||
Feature: Dog - Company Routes
|
||||
|
||||
Description:
|
||||
Contact Page Controller.
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
# internal
|
||||
from business_objects.api import API
|
||||
from business_objects.dog.company import Company
|
||||
from datastores.datastore_dog import DataStore_Dog
|
||||
from forms.dog.company import Filters_Company
|
||||
from helpers.helper_app import Helper_App
|
||||
from models.model_view_user_company import Model_View_User_Company
|
||||
from models.model_view_home import Model_View_Home
|
||||
import lib.argument_validation as av
|
||||
# external
|
||||
from flask import Flask, render_template, jsonify, request, render_template_string, send_from_directory, redirect, url_for, session, Blueprint, current_app, flash
|
||||
from flask_mail import Mail, Message
|
||||
from extensions import db, oauth, mail
|
||||
from urllib.parse import quote_plus, urlencode
|
||||
from authlib.integrations.flask_client import OAuth
|
||||
from authlib.integrations.base_client import OAuthError
|
||||
from urllib.parse import quote, urlparse, parse_qs
|
||||
import json
|
||||
import base64
|
||||
import hmac
|
||||
import hashlib
|
||||
import datetime
|
||||
from altcha import ChallengeOptions, create_challenge, verify_solution
|
||||
|
||||
|
||||
routes_user_company = Blueprint('routes_user_company', __name__)
|
||||
|
||||
"""
|
||||
@routes_user_company.route(Model_View_User_Company.HASH_PAGE_USER_COMPANIES, methods=['GET'])
|
||||
def companies():
|
||||
Helper_App.console_log('companies')
|
||||
Helper_App.console_log(f'request_args: {request.args}')
|
||||
try:
|
||||
form_filters = Filters_Company.from_json(request.args)
|
||||
except Exception as e:
|
||||
Helper_App.console_log(f'Error: {e}')
|
||||
form_filters = Filters_Company()
|
||||
Helper_App.console_log(f'form_filters={form_filters}')
|
||||
model = Model_View_User_Company(form_filters_old = form_filters)
|
||||
if not model.is_user_logged_in:
|
||||
return redirect(url_for('routes_dog_home.home'))
|
||||
Helper_App.console_log(f'form_filters={form_filters}')
|
||||
return render_template('pages/user/_companies.html', model = model)
|
||||
"""
|
||||
@routes_user_company.route(Model_View_User_Company.HASH_PAGE_USER_COMPANY, methods=['GET'])
|
||||
def company():
|
||||
Helper_App.console_log('company')
|
||||
Helper_App.console_log(f'request_args: {request.args}')
|
||||
try:
|
||||
form_filters = Filters_Company.from_json(request.args)
|
||||
except Exception as e:
|
||||
Helper_App.console_log(f'Error: {e}')
|
||||
form_filters = Filters_Company()
|
||||
Helper_App.console_log(f'form_filters={form_filters}')
|
||||
model = Model_View_User_Company(form_filters_old = form_filters)
|
||||
if (not model.is_user_logged_in) or (not model.user.can_edit_company) or (len(model.companies) == 0):
|
||||
return redirect(url_for('routes_dog_home.home'))
|
||||
Helper_App.console_log(f'form_filters={form_filters}')
|
||||
return render_template('pages/user/_company.html', model = model)
|
||||
|
||||
@routes_user_company.route(Model_View_User_Company.HASH_SAVE_USER_COMPANY, methods=['POST'])
|
||||
def save_company():
|
||||
data = Helper_App.get_request_data(request)
|
||||
try:
|
||||
form_filters = Filters_Company.from_json(data[Model_View_User_Company.FLAG_FORM_FILTERS])
|
||||
if not form_filters.validate_on_submit():
|
||||
return jsonify({
|
||||
Model_View_User_Company.FLAG_STATUS: Model_View_User_Company.FLAG_FAILURE,
|
||||
Model_View_User_Company.FLAG_MESSAGE: f'Filters form invalid.\n{form_filters.errors}'
|
||||
})
|
||||
model_return = Model_View_User_Company(form_filters_old=form_filters)
|
||||
if not model_return.is_user_logged_in:
|
||||
return redirect(url_for('routes_core_home.home'))
|
||||
if not model_return.user.can_edit_company:
|
||||
return redirect(url_for('routes_dog_home.home'))
|
||||
|
||||
companies = data[Model_View_User_Company.FLAG_COMPANY]
|
||||
if len(companies) == 0:
|
||||
return jsonify({
|
||||
Model_View_User_Company.FLAG_STATUS: Model_View_User_Company.FLAG_FAILURE,
|
||||
Model_View_User_Company.FLAG_MESSAGE: f'No companies.'
|
||||
})
|
||||
objs_company = []
|
||||
for company in companies:
|
||||
objs_company.append(Company.from_json(company))
|
||||
Helper_App.console_log(f'objs_company={objs_company}')
|
||||
errors = DataStore_Dog.save_companies(data.get('comment', 'No comment'), objs_company)
|
||||
|
||||
if (len(errors) > 0):
|
||||
return jsonify({
|
||||
Model_View_User_Company.FLAG_STATUS: Model_View_User_Company.FLAG_FAILURE,
|
||||
Model_View_User_Company.FLAG_MESSAGE: f'Error saving companies.\n{model_return.convert_list_objects_to_json(errors)}'
|
||||
})
|
||||
return jsonify({
|
||||
Model_View_User_Company.FLAG_STATUS: Model_View_User_Company.FLAG_SUCCESS,
|
||||
Model_View_User_Company.FLAG_DATA: Model_View_User_Company.convert_list_objects_to_json(model_return.companies)
|
||||
})
|
||||
except Exception as e:
|
||||
return jsonify({
|
||||
Model_View_User_Company.FLAG_STATUS: Model_View_User_Company.FLAG_FAILURE,
|
||||
Model_View_User_Company.FLAG_MESSAGE: f'Bad data received by controller.\n{e}'
|
||||
})
|
||||
@@ -193,7 +193,7 @@ def users():
|
||||
try:
|
||||
Helper_App.console_log(f'request_args: {request.args}')
|
||||
user_session = Model_View_User.get_user_session()
|
||||
if not user_session.get_is_logged_in():
|
||||
if (not user_session.get_is_logged_in()) or (not user_session.can_admin_user):
|
||||
return redirect(url_for('routes_dog_home.home'))
|
||||
try:
|
||||
form_filters = Filters_User.from_json(request.args)
|
||||
@@ -207,7 +207,7 @@ def users():
|
||||
return html_body
|
||||
|
||||
|
||||
@routes_user.route(Model_View_User.HASH_SAVE_DOG_USER, methods=['POST'])
|
||||
@routes_user.route(Model_View_User.HASH_SAVE_USER_USER, methods=['POST'])
|
||||
def save_user():
|
||||
data = Helper_App.get_request_data(request)
|
||||
try:
|
||||
@@ -219,7 +219,9 @@ def save_user():
|
||||
})
|
||||
model_return = Model_View_User(form_filters_old=form_filters)
|
||||
if not model_return.is_user_logged_in:
|
||||
raise Exception('User not logged in')
|
||||
return redirect(url_for('routes_core_home.home'))
|
||||
if not model_return.user.can_admin_user:
|
||||
return redirect(url_for('routes_dog_home.home'))
|
||||
|
||||
users = data[Model_View_User.FLAG_USER]
|
||||
if len(users) == 0:
|
||||
|
||||
@@ -14,6 +14,7 @@ Datastore for Users
|
||||
# from routes import bp_home
|
||||
import lib.argument_validation as av
|
||||
from business_objects.sql_error import SQL_Error
|
||||
from business_objects.dog.company import Company, Parameters_Company
|
||||
from business_objects.dog.role import Role, Parameters_Role
|
||||
from business_objects.dog.user import User, User_Temp, Parameters_User
|
||||
from datastores.datastore_base import DataStore_Base
|
||||
@@ -167,4 +168,43 @@ class DataStore_User(DataStore_Base):
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
|
||||
return roles, errors
|
||||
return roles, errors
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_many_company(cls, company_filters):
|
||||
_m = f'{cls.__qualname__}.get_many_company'
|
||||
user = cls.get_user_session()
|
||||
argument_dict = {
|
||||
'a_id_user': user.id_user
|
||||
, **company_filters.to_json()
|
||||
, 'a_debug': 0
|
||||
}
|
||||
Helper_App.console_log(f'argument_dict: {argument_dict}')
|
||||
result = cls.db_procedure_execute('p_dog_get_many_company', argument_dict)
|
||||
cursor = result.cursor
|
||||
|
||||
# Companies
|
||||
result_set_1 = cursor.fetchall()
|
||||
Helper_App.console_log(f'raw companies: {result_set_1}')
|
||||
companies = []
|
||||
company_indexes = {}
|
||||
for row in result_set_1:
|
||||
Helper_App.console_log(f'Raw company: {row}')
|
||||
new_company = Company.from_db_company(row)
|
||||
company_indexes[new_company.id_company] = len(companies)
|
||||
companies.append(new_company)
|
||||
|
||||
# Errors
|
||||
cursor.nextset()
|
||||
result_set_e = cursor.fetchall()
|
||||
Helper_App.console_log(f'raw errors: {result_set_e}')
|
||||
errors = []
|
||||
if len(result_set_e) > 0:
|
||||
errors = [SQL_Error.from_db_record(row) for row in result_set_e]
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
|
||||
return companies, errors
|
||||
55
forms/dog/company.py
Normal file
55
forms/dog/company.py
Normal file
@@ -0,0 +1,55 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: Backend
|
||||
Feature: Company Form
|
||||
|
||||
Description:
|
||||
Defines Flask-WTF form for handling user input on Company page.
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
# internal
|
||||
from business_objects.base import Base
|
||||
# from business_objects.dog.company import Company # Circular
|
||||
from helpers.helper_app import Helper_App
|
||||
# from models.model_view_store import Model_View_Store # circular
|
||||
# from models.model_view_base import Model_View_Base
|
||||
from forms.base import Form_Base
|
||||
import lib.argument_validation as av
|
||||
# external
|
||||
from flask import Flask, render_template, request, flash, redirect, url_for, current_app
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import SelectField, BooleanField, StringField, SubmitField
|
||||
from wtforms.validators import DataRequired, Email, ValidationError
|
||||
import markupsafe
|
||||
from flask_wtf.recaptcha import RecaptchaField
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import json
|
||||
|
||||
class Filters_Company(Form_Base):
|
||||
search = StringField(
|
||||
'Search'
|
||||
)
|
||||
active_only = BooleanField(
|
||||
'Active'
|
||||
, default = True
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
_m = f'{cls.__qualname__}.from_json'
|
||||
Helper_App.console_log(f'{_m}\njson: {json}')
|
||||
filters = cls()
|
||||
filters.search.data = json[Base.FLAG_SEARCH]
|
||||
filters.active_only.data = av.input_bool(json[Base.FLAG_ACTIVE_ONLY], Base.FLAG_ACTIVE_ONLY, f'{cls.__name__}.from_json')
|
||||
return filters
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
Base.FLAG_SEARCH: self.search.data
|
||||
, Base.FLAG_ACTIVE_ONLY: self.active_only.data
|
||||
}
|
||||
|
||||
54
forms/dog/dog.py
Normal file
54
forms/dog/dog.py
Normal file
@@ -0,0 +1,54 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: Backend
|
||||
Feature: Dog Form
|
||||
|
||||
Description:
|
||||
Defines Flask-WTF form for handling user input on Dogs page.
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
# internal
|
||||
from business_objects.base import Base
|
||||
# from business_objects.dog.dog import Dog # Circular
|
||||
from helpers.helper_app import Helper_App
|
||||
# from models.model_view_store import Model_View_Store # circular
|
||||
# from models.model_view_base import Model_View_Base
|
||||
from forms.base import Form_Base
|
||||
import lib.argument_validation as av
|
||||
# external
|
||||
from flask import Flask, render_template, request, flash, redirect, url_for, current_app
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import SelectField, BooleanField, StringField, SubmitField
|
||||
from wtforms.validators import DataRequired, Email, ValidationError
|
||||
import markupsafe
|
||||
from flask_wtf.recaptcha import RecaptchaField
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import json
|
||||
|
||||
class Filters_Dog(Form_Base):
|
||||
search = StringField(
|
||||
'Search'
|
||||
)
|
||||
active_only = BooleanField(
|
||||
'Active'
|
||||
, default = True
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
_m = f'{cls.__qualname__}.from_json'
|
||||
Helper_App.console_log(f'{_m}\njson: {json}')
|
||||
filters = cls()
|
||||
filters.search.data = json[Base.FLAG_SEARCH]
|
||||
filters.active_only.data = av.input_bool(json[Base.FLAG_ACTIVE_ONLY], Base.FLAG_ACTIVE_ONLY, f'{cls.__name__}.from_json')
|
||||
return filters
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
Base.FLAG_SEARCH: self.search.data
|
||||
, Base.FLAG_ACTIVE_ONLY: self.active_only.data
|
||||
}
|
||||
@@ -4,10 +4,10 @@ Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: Backend
|
||||
Feature: Command Form
|
||||
Feature: User Form
|
||||
|
||||
Description:
|
||||
Defines Flask-WTF form for handling user input on Commands page.
|
||||
Defines Flask-WTF form for handling user input on User page.
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
|
||||
@@ -123,6 +123,7 @@ class Model_View_Base(BaseModel, ABC):
|
||||
FLAG_ACTIVE_ONLY: ClassVar[str] = Base.FLAG_ACTIVE_ONLY
|
||||
FLAG_ADD: ClassVar[str] = 'add'
|
||||
# FLAG_ADD_DELETE: ClassVar[str] = 'add-delete'
|
||||
FLAG_APPEARANCE: ClassVar[str] = Dog.FLAG_APPEARANCE
|
||||
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
|
||||
@@ -140,6 +141,9 @@ class Model_View_Base(BaseModel, ABC):
|
||||
FLAG_CALENDAR_ENTRY: ClassVar[str] = Calendar_Entry.FLAG_CALENDAR_ENTRY
|
||||
FLAG_CALENDAR_ENTRY_TYPE: ClassVar[str] = Calendar_Entry_Type.FLAG_CALENDAR_ENTRY_TYPE
|
||||
FLAG_CALLBACK: ClassVar[str] = 'callback'
|
||||
FLAG_CAN_ADMIN_DOG: ClassVar[str] = User.FLAG_CAN_ADMIN_DOG
|
||||
FLAG_CAN_ADMIN_USER: ClassVar[str] = User.FLAG_CAN_ADMIN_USER
|
||||
FLAG_CAN_EDIT_COMPANY: ClassVar[str] = User.FLAG_CAN_EDIT_COMPANY
|
||||
FLAG_CAPTCHA: ClassVar[str] = 'captcha'
|
||||
FLAG_CARD: ClassVar[str] = 'card'
|
||||
FLAG_CHECKBOX: ClassVar[str] = 'checkbox'
|
||||
@@ -199,6 +203,7 @@ class Model_View_Base(BaseModel, ABC):
|
||||
FLAG_LOCATION: ClassVar[str] = Location.FLAG_LOCATION
|
||||
FLAG_LOCATION_PARENT: ClassVar[str] = Location.FLAG_LOCATION_PARENT
|
||||
FLAG_LOGO: ClassVar[str] = 'logo'
|
||||
FLAG_MASS_KG: ClassVar[str] = Dog.FLAG_MASS_KG
|
||||
FLAG_MESSAGE: ClassVar[str] = Command.FLAG_MESSAGE
|
||||
FLAG_MODAL: ClassVar[str] = 'modal'
|
||||
FLAG_NAME: ClassVar[str] = Base.FLAG_NAME
|
||||
@@ -224,6 +229,7 @@ class Model_View_Base(BaseModel, ABC):
|
||||
FLAG_NAV_HOME: ClassVar[str] = 'navHome'
|
||||
FLAG_NAV_USER_ACCOUNT: ClassVar[str] = 'navUserAccount'
|
||||
FLAG_NAV_USER_ACCOUNT: ClassVar[str] = 'navUserAccounts'
|
||||
FLAG_NAV_USER_COMPANY: ClassVar[str] = 'navUserCompany'
|
||||
FLAG_NAV_USER_LOGIN: ClassVar[str] = 'navUserLogin'
|
||||
FLAG_NAV_USER_LOGOUT: ClassVar[str] = 'navUserLogout'
|
||||
FLAG_NOTES: ClassVar[str] = "notes"
|
||||
@@ -279,8 +285,9 @@ class Model_View_Base(BaseModel, ABC):
|
||||
HASH_PAGE_HOME: ClassVar[str] = '/'
|
||||
HASH_PAGE_LICENSE: ClassVar[str] = '/license'
|
||||
HASH_PAGE_PRIVACY_POLICY: ClassVar[str] = '/privacy-policy'
|
||||
HASH_PAGE_USER_ACCOUNT: ClassVar[str] = '/user'
|
||||
HASH_PAGE_USER_ACCOUNTS: ClassVar[str] = '/users'
|
||||
HASH_PAGE_USER_ACCOUNT: ClassVar[str] = '/user/user'
|
||||
HASH_PAGE_USER_ACCOUNTS: ClassVar[str] = '/user/users'
|
||||
HASH_PAGE_USER_COMPANY: ClassVar[str] = '/user/company'
|
||||
HASH_PAGE_USER_LOGIN: ClassVar[str] = '/login'
|
||||
HASH_PAGE_USER_LOGOUT: ClassVar[str] = '/logout'
|
||||
# HASH_SAVE_DOG_ASSESSMENT: ClassVar[str] = '/dog/save-assessment'
|
||||
@@ -291,8 +298,10 @@ class Model_View_Base(BaseModel, ABC):
|
||||
HASH_SAVE_DOG_COMMAND_BUTTON_LINK: ClassVar[str] = '/dog/save-command-button-link'
|
||||
HASH_SAVE_DOG_COMMAND_CATEGORY: ClassVar[str] = '/dog/save-command-category'
|
||||
HASH_SAVE_DOG_DOG_COMMAND_LINK: ClassVar[str] = '/dog/save-dog-command-link'
|
||||
HASH_SAVE_DOG_DOG: ClassVar[str] = '/dog/dogs'
|
||||
HASH_SAVE_DOG_LOCATION: ClassVar[str] = '/dog/save-location'
|
||||
HASH_SAVE_DOG_USER: ClassVar[str] = '/dog/save-user'
|
||||
HASH_SAVE_USER_COMPANY: ClassVar[str] = '/user/save-company'
|
||||
HASH_SAVE_USER_USER: ClassVar[str] = '/user/save-user'
|
||||
ID_BUTTON_ADD: ClassVar[str] = 'buttonAdd'
|
||||
ID_BUTTON_APPLY_FILTERS: ClassVar[str] = 'buttonApplyFilters'
|
||||
ID_BUTTON_CANCEL: ClassVar[str] = 'buttonCancel'
|
||||
|
||||
42
models/model_view_dog_dog.py
Normal file
42
models/model_view_dog_dog.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: View Models
|
||||
Feature: Dog Dogs View Model
|
||||
|
||||
Description:
|
||||
Data model for dog dogs view
|
||||
"""
|
||||
|
||||
# internal
|
||||
from business_objects.dog.dog import Dog, Parameters_Dog
|
||||
from datastores.datastore_dog import DataStore_Dog
|
||||
from models.model_view_dog_base import Model_View_Dog_Base
|
||||
from forms.dog.dog import Filters_Dog
|
||||
# from routes import bp_home
|
||||
from helpers.helper_app import Helper_App
|
||||
import lib.argument_validation as av
|
||||
|
||||
# external
|
||||
from pydantic import BaseModel
|
||||
from typing import ClassVar
|
||||
|
||||
class Model_View_Dog_Dog(Model_View_Dog_Base):
|
||||
dogs: list = None
|
||||
form_filters: Filters_Dog = None
|
||||
form_filters_old: Filters_Dog
|
||||
|
||||
def __init__(self, form_filters_old, hash_page_current=Model_View_Dog_Base.HASH_PAGE_DOG_DOGS):
|
||||
_m = 'Model_View_Dog_Dog.__init__'
|
||||
Helper_App.console_log(f'{_m}\nstarting...')
|
||||
super().__init__(hash_page_current=hash_page_current, form_filters_old=form_filters_old)
|
||||
self._title = 'Dog'
|
||||
self.form_filters = form_filters_old
|
||||
datastore = DataStore_Dog()
|
||||
|
||||
Helper_App.console_log(f'Form filters: {self.form_filters}')
|
||||
parameters_filter_dog = Parameters_Dog.from_form_filters_dog(self.form_filters)
|
||||
Helper_App.console_log(f'Query args: {parameters_filter_dog}')
|
||||
self.dogs, errors = datastore.get_many_dog(parameters_filter_dog)
|
||||
@@ -22,8 +22,6 @@ from models.model_view_base import Model_View_Base
|
||||
from typing import ClassVar
|
||||
|
||||
class Model_View_User(Model_View_Base):
|
||||
FLAG_CAN_ADMIN_DOG: ClassVar[str] = User.FLAG_CAN_ADMIN_DOG
|
||||
FLAG_CAN_ADMIN_USER: ClassVar[str] = User.FLAG_CAN_ADMIN_USER
|
||||
FLAG_ERROR_OAUTH: ClassVar[str] = 'error'
|
||||
FLAG_ERROR_DESCRIPTION_OAUTH: ClassVar[str] = 'error_description'
|
||||
FLAG_FIRSTNAME: ClassVar[str] = User.FLAG_FIRSTNAME
|
||||
@@ -50,6 +48,8 @@ class Model_View_User(Model_View_Base):
|
||||
self.filter_roles, errors = datastore.get_many_role(parameters_filter_role)
|
||||
|
||||
parameters_user = Parameters_User.from_form_filters_user(self.form_filters)
|
||||
if self.hash_page_current == Model_View_Base.HASH_PAGE_USER_ACCOUNT:
|
||||
parameters_user.ids_user = str(self.user.id_user)
|
||||
Helper_App.console_log(f'Query args: {parameters_user}')
|
||||
self.users, errors = datastore.get_many_user(parameters_user)
|
||||
|
||||
41
models/model_view_user_company.py
Normal file
41
models/model_view_user_company.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: View Models
|
||||
Feature: User View Model
|
||||
|
||||
Description:
|
||||
Data model for user view
|
||||
"""
|
||||
|
||||
# internal
|
||||
from business_objects.dog.company import Company, Parameters_Company
|
||||
from datastores.datastore_user import DataStore_User
|
||||
from forms.dog.company import Filters_Company
|
||||
from helpers.helper_app import Helper_App
|
||||
from models.model_view_base import Model_View_Base
|
||||
# from routes import bp_home
|
||||
# external
|
||||
from typing import ClassVar
|
||||
|
||||
class Model_View_User_Company(Model_View_Base):
|
||||
filter_roles: list = None
|
||||
form_filters: Filters_Company = None
|
||||
form_filters_old: Filters_Company
|
||||
companies: list = None
|
||||
|
||||
def __init__(self, form_filters_old, hash_page_current = Model_View_Base.HASH_PAGE_USER_COMPANY):
|
||||
super().__init__(hash_page_current = hash_page_current, form_filters_old = form_filters_old)
|
||||
self._title = 'Company'
|
||||
self.form_filters = form_filters_old
|
||||
|
||||
Helper_App.console_log(f'Form filters: {self.form_filters}')
|
||||
|
||||
datastore = DataStore_User()
|
||||
|
||||
parameters_company = Parameters_Company.from_form_filters_company(self.form_filters)
|
||||
Helper_App.console_log(f'Query args: {parameters_company}')
|
||||
self.companies, errors = datastore.get_many_company(parameters_company)
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
|
||||
|
||||
USE demo;
|
||||
|
||||
-- Clear previous proc
|
||||
DROP PROCEDURE IF EXISTS demo.p_dog_get_many_user;
|
||||
|
||||
DROP PROCEDURE IF EXISTS demo.p_dog_get_many_dog;
|
||||
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE demo.p_dog_get_many_user (
|
||||
IN a_id_user INT
|
||||
, IN a_auth0_id_user VARCHAR(200)
|
||||
, IN a_get_all_user BIT
|
||||
, IN a_get_inactive_user BIT
|
||||
, IN a_ids_user TEXT
|
||||
, IN a_auth0_ids_user TEXT
|
||||
, IN a_names_user TEXT
|
||||
, IN a_emails_user TEXT
|
||||
, IN a_get_all_company BIT
|
||||
, IN a_get_inactive_company BIT
|
||||
, IN a_ids_company TEXT
|
||||
CREATE PROCEDURE demo.p_dog_get_many_dog (
|
||||
IN a_id_user INT
|
||||
, IN a_get_all_dog BIT
|
||||
, IN a_get_inactive_dog BIT
|
||||
, IN a_ids_dog TEXT
|
||||
, IN a_names_dog TEXT
|
||||
, IN a_require_all_id_search_filters_met BIT
|
||||
, IN a_require_any_id_search_filters_met BIT
|
||||
, IN a_require_all_non_id_search_filters_met BIT
|
||||
@@ -25,24 +17,15 @@ CREATE PROCEDURE demo.p_dog_get_many_user (
|
||||
, IN a_debug BIT
|
||||
)
|
||||
BEGIN
|
||||
DECLARE v_code_type_error_bad_data VARCHAR(50);
|
||||
DECLARE v_can_view BIT;
|
||||
DECLARE v_code_type_error_bad_data VARCHAR(100);
|
||||
DECLARE v_code_type_error_no_permission VARCHAR(100);
|
||||
DECLARE v_guid BINARY(36);
|
||||
DECLARE v_has_filter_user_auth0_id BIT;
|
||||
DECLARE v_has_filter_user_id BIT;
|
||||
DECLARE v_has_filter_user_name BIT;
|
||||
DECLARE v_id_access_level_admin INT;
|
||||
DECLARE v_id_access_level_view INT;
|
||||
DECLARE v_id_permission_dog_admin INT;
|
||||
DECLARE v_id_permission_user INT;
|
||||
DECLARE v_id_permission_user_admin INT;
|
||||
DECLARE v_id_minimum INT;
|
||||
DECLARE v_id_permission_dog_view INT;
|
||||
DECLARE v_id_type_error_bad_data INT;
|
||||
DECLARE v_ids_user TEXT;
|
||||
DECLARE v_is_new BIT;
|
||||
DECLARE v_is_super_user BIT;
|
||||
DECLARE v_priority_access_level_edit INT;
|
||||
DECLARE v_priority_access_level_none INT;
|
||||
DECLARE v_priority_access_level_user_view_user INT;
|
||||
DECLARE v_rank_max INT;
|
||||
DECLARE v_id_type_error_no_permission INT;
|
||||
DECLARE v_time_start TIMESTAMP(6);
|
||||
|
||||
DECLARE exit handler for SQLEXCEPTION
|
||||
@@ -91,544 +74,300 @@ BEGIN
|
||||
|
||||
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||
END;
|
||||
|
||||
|
||||
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||
SET v_guid := UUID();
|
||||
SET v_id_access_level_admin := (SELECT ACCESS_LEVEL.id_access_level FROM demo.DOG_Access_Level ACCESS_LEVEL WHERE code = 'ADMIN' LIMIT 1);
|
||||
SET v_id_access_level_view := (SELECT ACCESS_LEVEL.id_access_level FROM demo.DOG_Access_Level ACCESS_LEVEL WHERE code = 'VIEW' LIMIT 1);
|
||||
SET v_priority_access_level_edit := (SELECT ACCESS_LEVEL.id_access_level FROM demo.DOG_Access_Level ACCESS_LEVEL WHERE code = 'EDIT' LIMIT 1);
|
||||
SET v_priority_access_level_none := (SELECT ACCESS_LEVEL.id_access_level FROM demo.DOG_Access_Level ACCESS_LEVEL WHERE code = 'NONE' LIMIT 1);
|
||||
SET v_id_permission_dog_admin := (SELECT id_permission FROM demo.DOG_Permission WHERE code = 'DOG_ADMIN' LIMIT 1);
|
||||
SET v_id_permission_user := (SELECT id_permission FROM demo.DOG_Permission WHERE code = 'USER_VIEW' LIMIT 1);
|
||||
SET v_id_permission_user_admin := (SELECT id_permission FROM demo.DOG_Permission WHERE code = 'USER_ADMIN' LIMIT 1);
|
||||
SET v_code_type_error_bad_data := 'BAD_DATA';
|
||||
SET v_id_type_error_bad_data := (SELECT id_type FROM demo.CORE_Msg_Error_Type WHERE code = v_code_type_error_bad_data LIMIT 1);
|
||||
SET v_is_new := FALSE;
|
||||
SET v_code_type_error_no_permission := 'NO_PERMISSION';
|
||||
SET v_id_type_error_bad_data := (SELECT ERROR_TYPE.id_type FROM demo.CORE_Msg_Error_Type ERROR_TYPE WHERE ERROR_TYPE.code = v_code_type_error_bad_data LIMIT 1);
|
||||
SET v_id_type_error_no_permission := (SELECT ERROR_TYPE.id_type FROM demo.CORE_Msg_Error_Type ERROR_TYPE WHERE ERROR_TYPE.code = v_code_type_error_no_permission LIMIT 1);
|
||||
SET v_id_permission_dog_view := (SELECT PERMISSION.id_permission FROM demo.DOG_Permission PERMISSION WHERE PERMISSION.code = 'DOG_VIEW' LIMIT 1);
|
||||
SET v_id_access_level_view := (SELECT ACCESS_LEVEL.id_access_level FROM demo.DOG_Access_Level ACCESS_LEVEL WHERE ACCESS_LEVEL.code = 'VIEW' LIMIT 1);
|
||||
|
||||
SET a_get_all_user := IFNULL(a_get_all_user, 1);
|
||||
SET a_get_inactive_user := IFNULL(a_get_inactive_user, 0);
|
||||
SET a_ids_user := TRIM(IFNULL(a_ids_user, ''));
|
||||
SET a_auth0_ids_user := TRIM(IFNULL(a_auth0_ids_user, ''));
|
||||
SET a_names_user := TRIM(IFNULL(a_names_user, ''));
|
||||
SET a_emails_user := TRIM(IFNULL(a_emails_user, ''));
|
||||
SET a_id_user := IFNULL(a_id_user, 0);
|
||||
/*
|
||||
SET a_get_all_dog := IFNULL(a_get_all_dog, 0);
|
||||
SET a_get_inactive_dog := IFNULL(a_get_inactive_dog, 0);
|
||||
SET a_ids_dog := TRIM(IFNULL(a_ids_dog, ''));
|
||||
SET a_names_dog := TRIM(IFNULL(a_names_dog, ''));
|
||||
SET a_require_all_id_search_filters_met := IFNULL(a_require_all_id_search_filters_met, 1);
|
||||
SET a_require_any_id_search_filters_met := IFNULL(a_require_any_id_search_filters_met, 1);
|
||||
SET a_require_all_non_id_search_filters_met := IFNULL(a_require_all_non_id_search_filters_met, 0);
|
||||
SET a_require_any_non_id_search_filters_met := IFNULL(a_require_any_non_id_search_filters_met, 1);
|
||||
*/
|
||||
SET a_debug := IFNULL(a_debug, 0);
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
a_id_user
|
||||
, a_auth0_id_user
|
||||
, a_get_all_user
|
||||
, a_get_inactive_user
|
||||
, a_ids_user
|
||||
, a_auth0_ids_user
|
||||
, a_names_user
|
||||
, a_emails_user
|
||||
SELECT
|
||||
a_id_user
|
||||
, a_get_all_dog
|
||||
, a_get_inactive_dog
|
||||
, a_ids_dog
|
||||
, a_names_dog
|
||||
, a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met
|
||||
, a_debug
|
||||
, a_debug
|
||||
;
|
||||
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_id_type_error_no_permission
|
||||
, v_guid
|
||||
, v_id_permission_dog_view
|
||||
, v_time_start
|
||||
;
|
||||
END IF;
|
||||
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_User_Access;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_User;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Company;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Dog;
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Dog (
|
||||
id_dog INT NOT NULL
|
||||
, name VARCHAR(250)
|
||||
, appearance VARCHAR(1000)
|
||||
, mass_kg DECIMAL(7, 3)
|
||||
, notes TEXT
|
||||
, active BIT
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Company (
|
||||
id_company INT NOT NULL
|
||||
, name VARCHAR(250) NOT NULL
|
||||
, website VARCHAR(1000)
|
||||
, active BIT NOT NULL
|
||||
, does_meet_id_filters BIT NOT NULL
|
||||
, does_meet_non_id_filters BIT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_User (
|
||||
id_temp INT PRIMARY KEY AUTO_INCREMENT NOT NULL
|
||||
, id_user INT
|
||||
, id_company INT
|
||||
, id_role INT
|
||||
, id_permission_required INT NOT NULL
|
||||
, priority_access_level_required INT NOT NULL
|
||||
, is_super_user BIT
|
||||
, priority_access_level_user INT
|
||||
, has_access BIT
|
||||
, can_view BIT
|
||||
, can_edit BIT
|
||||
, can_admin BIT
|
||||
, can_admin_dog BIT
|
||||
, can_admin_user BIT
|
||||
, does_meet_id_filters BIT
|
||||
, does_meet_non_id_filters BIT
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_User_Access (
|
||||
id_temp INT PRIMARY KEY AUTO_INCREMENT NOT NULL
|
||||
, id_user INT
|
||||
, id_permission_required INT NOT NULL
|
||||
, priority_access_level_required INT NOT NULL
|
||||
, is_super_user BIT
|
||||
, priority_access_level_user INT
|
||||
, has_access BIT
|
||||
, can_view BIT
|
||||
, can_edit BIT
|
||||
, can_admin BIT
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Msg_Error (
|
||||
id_error INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NOT NULL
|
||||
, code VARCHAR(250) NOT NULL
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
|
||||
id_error INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT
|
||||
, code VARCHAR(250) NOT NULL
|
||||
, msg TEXT NOT NULL
|
||||
);
|
||||
|
||||
|
||||
);
|
||||
|
||||
-- Permissions
|
||||
-- Can View
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid -- guid
|
||||
, 0 -- get_all_user
|
||||
, 0 -- get_inactive_user
|
||||
, a_id_user -- ids_user
|
||||
, a_auth0_id_user -- a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_user -- ids_permission
|
||||
, v_id_access_level_view -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
;
|
||||
SELECT * FROM demo.DOG_Calc_User_Access_Temp CUA_T WHERE CUA_T.GUID = v_guid;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_calc_user_access(
|
||||
v_guid -- guid
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid -- guid
|
||||
, 0 -- get_all_user
|
||||
, 0 -- get_inactive_user
|
||||
, a_id_user -- ids_user
|
||||
, a_auth0_id_user -- a_auth0_ids_user
|
||||
, '' -- a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_user -- ids_permission
|
||||
, v_id_permission_dog_view -- ids_permission
|
||||
, v_id_access_level_view -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
INSERT INTO tmp_User_Access (
|
||||
id_user
|
||||
, id_permission_required
|
||||
, priority_access_level_required
|
||||
, is_super_user
|
||||
, priority_access_level_user
|
||||
, has_access
|
||||
, can_view
|
||||
, can_edit
|
||||
, can_admin
|
||||
)
|
||||
SELECT
|
||||
CALC_USER_T.id_user
|
||||
, CALC_USER_T.id_permission_required
|
||||
, CALC_USER_T.priority_access_level_required
|
||||
, CALC_USER_T.is_super_user
|
||||
, CALC_USER_T.priority_access_level_user
|
||||
, CALC_USER_T.has_access
|
||||
, CALC_USER_T.can_view
|
||||
, CALC_USER_T.can_edit
|
||||
, CALC_USER_T.can_admin
|
||||
FROM demo.DOG_Calc_User_Access_Temp CALC_USER_T
|
||||
WHERE CALC_USER_T.guid = v_guid
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * FROM tmp_User_Access;
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_User_Access t_USER_ACCESS WHERE t_USER_ACCESS.has_access = 1) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
VALUES (
|
||||
v_id_type_error_bad_data
|
||||
, v_code_type_error_bad_data
|
||||
, CONCAT(
|
||||
'You do not have view permissions for '
|
||||
, (SELECT PERMISSION.name FROM demo.DOG_Permission PERMISSION WHERE PERMISSION.id_permission = v_id_permission_user LIMIT 1)
|
||||
)
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_clear_calc_user_access( v_guid, FALSE );
|
||||
END IF;
|
||||
|
||||
SELECT
|
||||
IFNULL(t_USER_ACCESS.is_super_user, 0) AS v_is_super_user
|
||||
, IFNULL(t_USER_ACCESS.id_user, a_id_user) AS a_id_user
|
||||
, IFNULL(t_USER_ACCESS.priority_access_level_user, v_priority_access_level_none) AS v_priority_access_level_user_view_user
|
||||
INTO
|
||||
v_is_super_user
|
||||
, a_id_user
|
||||
, v_priority_access_level_user_view_user
|
||||
FROM tmp_User_Access t_USER_ACCESS
|
||||
LIMIT 1
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_is_super_user AS v_is_super_user
|
||||
, a_id_user AS a_id_user
|
||||
, v_priority_access_level_user_view_user AS v_priority_access_level_user_view_user
|
||||
, a_debug -- a_debug
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_calc_user_access(
|
||||
v_guid-- guid
|
||||
, 0 -- get_all_user
|
||||
, 0 -- get_inactive_user
|
||||
, a_id_user -- ids_user
|
||||
, '' -- a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_dog_view -- ids_permission
|
||||
, v_id_access_level_view -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, a_debug -- a_debug
|
||||
);
|
||||
|
||||
SELECT
|
||||
IFNULL(CALC_USER_T.has_access, 0)
|
||||
INTO
|
||||
v_can_view
|
||||
FROM demo.DOG_Calc_User_Access_Temp CALC_USER_T
|
||||
WHERE CALC_USER_T.GUID = v_guid
|
||||
LIMIT 1
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT v_can_view;
|
||||
SELECT COUNT(*) AS Count_Errors FROM tmp_Msg_Error t_ERROR;
|
||||
SELECT * FROM tmp_Msg_Error t_ERROR;
|
||||
END IF;
|
||||
|
||||
IF (v_can_view = 0) THEN
|
||||
DELETE t_ME
|
||||
FROM tmp_Msg_Error t_ME
|
||||
WHERE t_ME.id_type <> v_id_type_error_no_permission
|
||||
;
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
VALUES (
|
||||
v_id_type_error_no_permission
|
||||
, v_code_type_error_no_permission
|
||||
, 'You do not have permission to view Commands.'
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_clear_calc_user_access(
|
||||
v_guid
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
-- Companies
|
||||
|
||||
-- Call Dog Calc
|
||||
IF NOT EXISTS(SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid -- v_guid
|
||||
v_guid -- a_guid
|
||||
, a_id_user -- a_id_user
|
||||
, a_get_all_company -- a_get_all_company
|
||||
, a_get_inactive_company -- a_get_inactive_company
|
||||
, a_ids_company -- a_ids_company
|
||||
, NULL -- a_names_company
|
||||
, NULL -- a_websites_company
|
||||
, a_get_all_dog -- a_get_all_dog
|
||||
, a_get_inactive_dog -- a_get_inactive_dog
|
||||
, a_ids_dog -- a_ids_dog
|
||||
, a_names_dog -- a_names_dog
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, 0 -- a_require_any_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_calc_company (
|
||||
v_guid -- v_guid
|
||||
CALL demo.p_dog_calc_dog(
|
||||
v_guid -- a_guid
|
||||
, a_id_user -- a_id_user
|
||||
, a_get_all_company -- a_get_all_company
|
||||
, a_get_inactive_company -- a_get_inactive_company
|
||||
, a_ids_company -- a_ids_company
|
||||
, NULL -- a_names_company
|
||||
, NULL -- a_websites_company
|
||||
, a_get_all_dog -- a_get_all_dog
|
||||
, a_get_inactive_dog -- a_get_inactive_dog
|
||||
, a_ids_dog -- a_ids_dog
|
||||
, a_names_dog -- a_names_dog
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, 0 -- a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
INSERT INTO tmp_Company (
|
||||
id_company
|
||||
INSERT INTO tmp_Dog (
|
||||
id_dog
|
||||
, name
|
||||
, website
|
||||
, appearance
|
||||
, mass_kg
|
||||
, notes
|
||||
, active
|
||||
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
SELECT
|
||||
COMPANY_T.id_company
|
||||
, COMPANY_T.name
|
||||
, COMPANY_T.website
|
||||
, COMPANY_T.active
|
||||
DOG_T.id_dog
|
||||
, DOG_T.name
|
||||
, DOG_T.appearance
|
||||
, DOG_T.mass_kg
|
||||
, DOG_T.notes
|
||||
, DOG_T.active
|
||||
|
||||
, COMPANY_T.does_meet_id_filters
|
||||
, COMPANY_T.does_meet_non_id_filters
|
||||
FROM demo.DOG_Company_Temp COMPANY_T
|
||||
WHERE COMPANY_T.GUID = v_guid
|
||||
, DOG_T.does_meet_id_filters
|
||||
, DOG_T.does_meet_non_id_filters
|
||||
FROM demo.DOG_Dog_Temp DOG_T
|
||||
WHERE DOG_T.GUID = v_guid
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'After get permissions user companies';
|
||||
SELECT * FROM tmp_Company;
|
||||
SELECT * FROM tmp_Dog;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
-- Calculated fields
|
||||
-- Can admin dog
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid -- guid
|
||||
, a_get_all_user -- get_all_user
|
||||
, a_get_inactive_user -- get_inactive_user
|
||||
, a_ids_user -- ids_user
|
||||
, a_auth0_ids_user -- a_auth0_ids_user
|
||||
, a_names_user -- a_names_user
|
||||
, a_emails_user -- a_emails_user
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_dog_admin -- ids_permission
|
||||
, v_id_access_level_admin -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
;
|
||||
SELECT * FROM demo.DOG_Calc_User_Access_Temp;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_calc_user_access(
|
||||
v_guid -- guid
|
||||
, a_get_all_user -- get_all_user
|
||||
, a_get_inactive_user -- get_inactive_user
|
||||
, a_ids_user -- ids_user
|
||||
, a_auth0_ids_user -- a_auth0_ids_user
|
||||
, a_names_user -- a_names_user
|
||||
, a_emails_user -- a_emails_user
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_dog_admin -- ids_permission
|
||||
, v_id_access_level_admin -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
INSERT INTO tmp_User (
|
||||
id_user
|
||||
, id_role
|
||||
, id_company
|
||||
, id_permission_required
|
||||
, priority_access_level_required
|
||||
, is_super_user
|
||||
, priority_access_level_user
|
||||
, has_access
|
||||
, can_view
|
||||
, can_edit
|
||||
, can_admin
|
||||
, can_admin_dog
|
||||
)
|
||||
WITH Can_Access_User AS (
|
||||
SELECT
|
||||
USER.id_user
|
||||
, t_COMPANY.id_company
|
||||
, ROW_NUMBER() OVER (PARTITION BY USER.id_user ORDER BY CASE WHEN t_COMPANY.id_company IS NOT NULL THEN 1 ELSE 0 END DESC) AS index_user_company_link_in_user
|
||||
FROM demo.DOG_User USER
|
||||
LEFT JOIN demo.DOG_User_Company_Link USER_COMPANY_LINK
|
||||
ON USER.id_user = USER_COMPANY_LINK.id_user
|
||||
AND (
|
||||
(
|
||||
a_get_inactive_company = 1
|
||||
AND a_get_inactive_user = 1
|
||||
)
|
||||
OR USER_COMPANY_LINK.active = 1
|
||||
)
|
||||
LEFT JOIN tmp_Company t_COMPANY
|
||||
ON USER_COMPANY_LINK.id_company = t_COMPANY.id_company
|
||||
AND (
|
||||
a_get_inactive_company = 1
|
||||
OR USER_COMPANY_LINK.active = 1
|
||||
)
|
||||
)
|
||||
SELECT
|
||||
CALC_USER_T.id_user
|
||||
, CALC_USER_T.id_role
|
||||
, CAN_ACCESS_USER.id_company
|
||||
, CALC_USER_T.id_permission_required
|
||||
, CALC_USER_T.priority_access_level_required
|
||||
, CALC_USER_T.is_super_user
|
||||
, CALC_USER_T.priority_access_level_user
|
||||
, CALC_USER_T.has_access
|
||||
, CALC_USER_T.can_view
|
||||
, CALC_USER_T.can_edit
|
||||
, CALC_USER_T.can_admin
|
||||
, CALC_USER_T.can_admin AS can_admin_dog
|
||||
FROM demo.DOG_Calc_User_Access_Temp CALC_USER_T
|
||||
/*
|
||||
LEFT JOIN demo.DOG_User_Company_Link USER_COMPANY_LINK ON CALC_USER_T.id_user = USER_COMPANY_LINK.id_user
|
||||
LEFT JOIN tmp_Company t_COMPANY ON USER_COMPANY_LINK.id_company = t_COMPANY.id_company
|
||||
*/
|
||||
INNER JOIN Can_Access_User CAN_ACCESS_USER ON CALC_USER_T.id_user = CAN_ACCESS_USER.id_user
|
||||
WHERE
|
||||
CALC_USER_T.guid = v_guid
|
||||
AND (
|
||||
v_is_super_user = 1
|
||||
OR (
|
||||
v_priority_access_level_user_view_user <= v_priority_access_level_edit
|
||||
AND CAN_ACCESS_USER.id_company IS NOT NULL
|
||||
AND CAN_ACCESS_USER.index_user_company_link_in_user = 1
|
||||
)
|
||||
OR CALC_USER_T.id_user = a_id_user
|
||||
)
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'After get many user';
|
||||
SELECT * FROM tmp_User;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_clear_calc_user_access( v_guid, FALSE );
|
||||
END IF;
|
||||
|
||||
-- Can admin user
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid -- guid
|
||||
, a_get_all_user -- get_all_user
|
||||
, a_get_inactive_user -- get_inactive_user
|
||||
, a_ids_user -- ids_user
|
||||
, a_auth0_ids_user -- a_auth0_ids_user
|
||||
, a_names_user -- a_names_user
|
||||
, a_emails_user -- a_emails_user
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_user_admin -- ids_permission
|
||||
, v_id_access_level_admin -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
;
|
||||
SELECT * FROM demo.DOG_Calc_User_Access_Temp;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_calc_user_access(
|
||||
v_guid -- guid
|
||||
, a_get_all_user -- get_all_user
|
||||
, a_get_inactive_user -- get_inactive_user
|
||||
, a_ids_user -- ids_user
|
||||
, a_auth0_ids_user -- a_auth0_ids_user
|
||||
, a_names_user -- a_names_user
|
||||
, a_emails_user -- a_emails_user
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_user_admin -- ids_permission
|
||||
, v_id_access_level_admin -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
UPDATE tmp_User t_USER
|
||||
INNER JOIN demo.DOG_Calc_User_Access_Temp CALC_USER_T
|
||||
ON CALC_USER_T.id_user = t_USER.id_user
|
||||
AND CALC_USER_T.guid = v_guid
|
||||
LEFT JOIN tmp_Company t_COMPANY ON t_USER.id_company = t_COMPANY.id_company
|
||||
SET t_USER.can_admin_user = CALC_USER_T.can_admin
|
||||
WHERE
|
||||
v_is_super_user = 1
|
||||
OR t_COMPANY.id_company IS NOT NULL
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * FROM tmp_User;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_clear_calc_user_access( v_guid, FALSE );
|
||||
END IF;
|
||||
|
||||
|
||||
-- Filter outputs
|
||||
IF EXISTS(SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * FROM tmp_User;
|
||||
SELECT * FROM tmp_Dog;
|
||||
END IF;
|
||||
|
||||
DELETE FROM tmp_User;
|
||||
DELETE FROM tmp_Dog;
|
||||
END IF;
|
||||
|
||||
-- Returns
|
||||
SELECT
|
||||
USERS.id_user
|
||||
, USERS.id_user_auth0
|
||||
, USERS.firstname
|
||||
, USERS.surname
|
||||
, USERS.email
|
||||
, USERS.is_email_verified
|
||||
, t_USER.id_role
|
||||
, ROLES.name AS name_role
|
||||
, t_USER.id_company
|
||||
, t_COMPANY.name AS name_company
|
||||
, t_COMPANY.website AS website_company
|
||||
, t_USER.is_super_user
|
||||
, t_USER.priority_access_level_user AS priority_access_level
|
||||
, t_USER.can_admin_dog
|
||||
, t_USER.can_admin_user
|
||||
FROM tmp_User t_USER
|
||||
-- INNER JOIN tmp_User_Access t_USER_ACCESS
|
||||
INNER JOIN demo.DOG_User USERS ON t_USER.id_user = USERS.id_user
|
||||
LEFT JOIN demo.DOG_Role ROLES ON t_USER.id_role = ROLES.id_role
|
||||
LEFT JOIN tmp_Company t_COMPANY ON t_USER.id_company = t_COMPANY.id_company
|
||||
;
|
||||
|
||||
# Errors
|
||||
|
||||
|
||||
-- Outputs
|
||||
SELECT
|
||||
t_DOG.id_dog
|
||||
, t_DOG.name
|
||||
, t_DOG.appearance
|
||||
, t_DOG.mass_kg
|
||||
, t_DOG.notes
|
||||
, t_DOG.active
|
||||
|
||||
, t_DOG.does_meet_id_filters
|
||||
, t_DOG.does_meet_non_id_filters
|
||||
FROM tmp_Dog t_DOG
|
||||
;
|
||||
|
||||
-- Errors
|
||||
SELECT
|
||||
t_ERROR.id_error
|
||||
, t_ERROR.id_type
|
||||
, t_ERROR.id_type
|
||||
, t_ERROR.code
|
||||
, ERROR_TYPE.name
|
||||
, ERROR_TYPE.description
|
||||
, ERROR_TYPE.is_breaking_error
|
||||
, ERROR_TYPE.background_colour
|
||||
, ERROR_TYPE.text_colour
|
||||
, t_ERROR.msg
|
||||
, t_ERROR.msg
|
||||
FROM tmp_Msg_Error t_ERROR
|
||||
INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
;
|
||||
INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'End';
|
||||
SELECT * FROM tmp_User;
|
||||
SELECT * FROM tmp_User_Access;
|
||||
IF a_debug = 1 AND v_can_view = 1 THEN
|
||||
SELECT * FROM tmp_Dog;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_clear_calc_dog(
|
||||
v_guid -- a_guid
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
-- Clean up
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_User_Access;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_User;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Company;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Dog;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
CALL demo.p_debug_timing_reporting ( v_time_start );
|
||||
CALL demo.p_core_debug_timing_reporting ( v_time_start );
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
/*
|
||||
select * FROM demo.DOG_Calc_User_Access_Temp;
|
||||
delete FROM demo.DOG_Calc_User_Access_Temp;
|
||||
|
||||
SELECT *
|
||||
FROM demo.DOG_USER;
|
||||
|
||||
CALL demo.p_dog_get_many_user(
|
||||
NULL -- :a_id_user,
|
||||
, 'auth0|6582b95c895d09a70ba10fef' -- :a_auth0_id_user,
|
||||
, 1 -- :a_get_all_user,
|
||||
, 0 -- :a_get_inactive_user,
|
||||
-- , 0 -- :a_get_first_user_only,
|
||||
, NULL -- :a_ids_user,
|
||||
, 'auth0|6582b95c895d09a70ba10fef' -- :a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, '' -- a_ids_company
|
||||
, 0 -- a_get_all_company
|
||||
, 0 -- a_get_inactive_company
|
||||
, 1 -- :a_require_all_id_search_filters_met,
|
||||
, 1 -- :a_require_any_id_search_filters_met,
|
||||
, 0 -- :a_require_all_non_id_search_filters_met,
|
||||
, 1 -- :a_require_any_non_id_search_filters_met,
|
||||
, 0 -- a_debug
|
||||
CALL demo.p_dog_get_many_dog (
|
||||
1 -- 'auth0|6582b95c895d09a70ba10fef', -- a_id_user
|
||||
, 1 -- a_get_all_dog
|
||||
, 0 -- a_get_inactive_dog
|
||||
, '' -- a_ids_dog
|
||||
, '' -- a_names_dog
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 1 -- a_require_any_non_id_search_filters_met
|
||||
, 1 -- a_debug
|
||||
);
|
||||
*/
|
||||
|
||||
CALL demo.p_dog_get_many_dog (
|
||||
1 -- 'auth0|6582b95c895d09a70ba10fef', -- a_id_user
|
||||
, 1 -- a_get_all_dog
|
||||
, 0 -- a_get_inactive_dog
|
||||
, '' -- a_ids_dog
|
||||
, 'pat' -- a_names_dog
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 1 -- a_require_any_non_id_search_filters_met
|
||||
, 1 -- a_debug
|
||||
);
|
||||
|
||||
*/
|
||||
@@ -31,7 +31,9 @@ BEGIN
|
||||
DECLARE v_has_filter_user_id BIT;
|
||||
DECLARE v_has_filter_user_name BIT;
|
||||
DECLARE v_id_access_level_admin INT;
|
||||
DECLARE v_id_access_level_edit INT;
|
||||
DECLARE v_id_access_level_view INT;
|
||||
DECLARE v_id_permission_company_edit INT;
|
||||
DECLARE v_id_permission_dog_admin INT;
|
||||
DECLARE v_id_permission_user INT;
|
||||
DECLARE v_id_permission_user_admin INT;
|
||||
@@ -95,9 +97,11 @@ BEGIN
|
||||
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||
SET v_guid := UUID();
|
||||
SET v_id_access_level_admin := (SELECT ACCESS_LEVEL.id_access_level FROM fetchmetrics.DOG_Access_Level ACCESS_LEVEL WHERE code = 'ADMIN' LIMIT 1);
|
||||
SET v_id_access_level_edit := (SELECT ACCESS_LEVEL.id_access_level FROM fetchmetrics.DOG_Access_Level ACCESS_LEVEL WHERE code = 'EDIT' LIMIT 1);
|
||||
SET v_id_access_level_view := (SELECT ACCESS_LEVEL.id_access_level FROM fetchmetrics.DOG_Access_Level ACCESS_LEVEL WHERE code = 'VIEW' LIMIT 1);
|
||||
SET v_priority_access_level_edit := (SELECT ACCESS_LEVEL.id_access_level FROM fetchmetrics.DOG_Access_Level ACCESS_LEVEL WHERE code = 'EDIT' LIMIT 1);
|
||||
SET v_priority_access_level_none := (SELECT ACCESS_LEVEL.id_access_level FROM fetchmetrics.DOG_Access_Level ACCESS_LEVEL WHERE code = 'NONE' LIMIT 1);
|
||||
SET v_id_permission_company_edit := (SELECT id_permission FROM fetchmetrics.DOG_Permission WHERE code = 'COMPANY_EDIT' LIMIT 1);
|
||||
SET v_id_permission_dog_admin := (SELECT id_permission FROM fetchmetrics.DOG_Permission WHERE code = 'DOG_ADMIN' LIMIT 1);
|
||||
SET v_id_permission_user := (SELECT id_permission FROM fetchmetrics.DOG_Permission WHERE code = 'USER_VIEW' LIMIT 1);
|
||||
SET v_id_permission_user_admin := (SELECT id_permission FROM fetchmetrics.DOG_Permission WHERE code = 'USER_ADMIN' LIMIT 1);
|
||||
@@ -164,6 +168,7 @@ BEGIN
|
||||
, can_admin BIT
|
||||
, can_admin_dog BIT
|
||||
, can_admin_user BIT
|
||||
, can_edit_company BIT
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_User_Access (
|
||||
@@ -538,6 +543,63 @@ BEGIN
|
||||
CALL fetchmetrics.p_dog_clear_calc_user_access( v_guid, FALSE );
|
||||
END IF;
|
||||
|
||||
-- Can edit company
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN fetchmetrics.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid -- guid
|
||||
, a_get_all_user -- get_all_user
|
||||
, a_get_inactive_user -- get_inactive_user
|
||||
, a_ids_user -- ids_user
|
||||
, a_auth0_ids_user -- a_auth0_ids_user
|
||||
, a_names_user -- a_names_user
|
||||
, a_emails_user -- a_emails_user
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_company_edit -- ids_permission
|
||||
, v_id_access_level_edit -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
;
|
||||
SELECT * FROM fetchmetrics.DOG_Calc_User_Access_Temp;
|
||||
END IF;
|
||||
|
||||
CALL fetchmetrics.p_dog_calc_user_access(
|
||||
v_guid -- guid
|
||||
, a_get_all_user -- get_all_user
|
||||
, a_get_inactive_user -- get_inactive_user
|
||||
, a_ids_user -- ids_user
|
||||
, a_auth0_ids_user -- a_auth0_ids_user
|
||||
, a_names_user -- a_names_user
|
||||
, a_emails_user -- a_emails_user
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_company_edit -- ids_permission
|
||||
, v_id_access_level_edit -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
UPDATE tmp_User t_USER
|
||||
INNER JOIN fetchmetrics.DOG_Calc_User_Access_Temp CALC_USER_T
|
||||
ON CALC_USER_T.id_user = t_USER.id_user
|
||||
AND CALC_USER_T.guid = v_guid
|
||||
LEFT JOIN tmp_Company t_COMPANY ON t_USER.id_company = t_COMPANY.id_company
|
||||
SET t_USER.can_edit_company = IFNULL(CALC_USER_T.has_access, 0)
|
||||
WHERE t_COMPANY.id_company IS NOT NULL
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * FROM tmp_User;
|
||||
END IF;
|
||||
|
||||
CALL fetchmetrics.p_dog_clear_calc_user_access( v_guid, FALSE );
|
||||
END IF;
|
||||
|
||||
|
||||
IF EXISTS(SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN fetchmetrics.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
@@ -564,6 +626,7 @@ BEGIN
|
||||
, t_USER.priority_access_level_user AS priority_access_level
|
||||
, t_USER.can_admin_dog
|
||||
, t_USER.can_admin_user
|
||||
, t_USER.can_edit_company
|
||||
FROM tmp_User t_USER
|
||||
-- INNER JOIN tmp_User_Access t_USER_ACCESS
|
||||
INNER JOIN fetchmetrics.DOG_User USERS ON t_USER.id_user = USERS.id_user
|
||||
@@ -622,9 +685,9 @@ CALL fetchmetrics.p_dog_get_many_user(
|
||||
, 'auth0|6582b95c895d09a70ba10fef' -- :a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, '' -- a_ids_company
|
||||
, 0 -- a_get_all_company
|
||||
, 1 -- a_get_all_company
|
||||
, 0 -- a_get_inactive_company
|
||||
, '' -- a_ids_company
|
||||
, 1 -- :a_require_all_id_search_filters_met,
|
||||
, 1 -- :a_require_any_id_search_filters_met,
|
||||
, 0 -- :a_require_all_non_id_search_filters_met,
|
||||
|
||||
@@ -262,6 +262,8 @@ BEGIN
|
||||
AND CALC_USER_T.id_user = a_id_user
|
||||
AND CALC_USER_T.id_permission_required = v_id_permission_user_edit
|
||||
;
|
||||
|
||||
CALL fetchmetrics.p_dog_clear_calc_user_access( a_guid, 0 );
|
||||
|
||||
IF (
|
||||
v_is_super_user = 0
|
||||
@@ -388,7 +390,37 @@ BEGIN
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL fetchmetrics.p_dog_clear_calc_user_access( a_guid, 0 );
|
||||
-- Attempt to change id, is_super_user, or created_on without admin permission
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_User_Save_User t_USER
|
||||
LEFT JOIN fetchmetrics.DOG_User USER ON t_USER.id_user = USER.id_user
|
||||
WHERE
|
||||
USER.id_user IS NULL
|
||||
OR USER.id_user_auth0 <> t_USER.id_user_auth0
|
||||
OR USER.id_user <> t_USER.id_user
|
||||
OR USER.id_user <> t_USER.id_user
|
||||
OR USER.id_user <> t_USER.id_user
|
||||
OR USER.id_user <> t_USER.id_user
|
||||
LIMIT 1
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_code_type_error_bad_data
|
||||
, CONCAT('The following User(s) have role(s) you cannot access: ', GROUP_CONCAT(t_USER.name_error SEPARATOR ', ')) AS msg
|
||||
FROM tmp_User_Save_User t_USER
|
||||
INNER JOIN fetchmetrics.DOG_User USER ON t_USER.id_user = USER.id_user
|
||||
INNER JOIN fetchmetrics.DOG_User_Role_Link USER_ROLE_LINK ON t_USER.id_user = USER_ROLE_LINK.id_user
|
||||
INNER JOIN fetchmetrics.DOG_Role ROLES ON USER_ROLE_LINK.id_role = ROLES.id_role
|
||||
INNER JOIN fetchmetrics.DOG_Access_Level ACCESS_LEVEL ON ROLES.id_access_level_required = ACCESS_LEVEL.id_access_level
|
||||
WHERE ACCESS_LEVEL.priority < v_priority_access_level_user
|
||||
;
|
||||
END IF;
|
||||
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN
|
||||
|
||||
@@ -296,16 +296,16 @@ BEGIN
|
||||
|
||||
-- Outputs
|
||||
SELECT
|
||||
DOG_T.id_dog
|
||||
, DOG_T.name
|
||||
, DOG_T.appearance
|
||||
, DOG_T.mass_kg
|
||||
, DOG_T.notes
|
||||
, DOG_T.active
|
||||
t_DOG.id_dog
|
||||
, t_DOG.name
|
||||
, t_DOG.appearance
|
||||
, t_DOG.mass_kg
|
||||
, t_DOG.notes
|
||||
, t_DOG.active
|
||||
|
||||
, DOG_T.does_meet_id_filters
|
||||
, DOG_T.does_meet_non_id_filters
|
||||
FROM fetchmetrics.DOG_Dog_Temp DOG_T
|
||||
, t_DOG.does_meet_id_filters
|
||||
, t_DOG.does_meet_non_id_filters
|
||||
FROM tmp_Dog t_DOG
|
||||
;
|
||||
|
||||
-- Errors
|
||||
|
||||
@@ -183,6 +183,7 @@ script, link {
|
||||
.container-input > input,
|
||||
.container-input > textarea {
|
||||
border: 2px solid var(--colour-accent);
|
||||
border-radius: 0.5vh;
|
||||
padding: 1vh 1vw;
|
||||
}
|
||||
|
||||
|
||||
16
static/css/pages/user/company.css
Normal file
16
static/css/pages/user/company.css
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
#formFilters {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.container-input {
|
||||
margin: 0 auto;
|
||||
}
|
||||
.container-input input {
|
||||
max-width: 250px;
|
||||
padding: 1vh 1vw;
|
||||
}
|
||||
|
||||
.container-input textarea {
|
||||
width: 300px;
|
||||
}
|
||||
@@ -2,6 +2,15 @@
|
||||
#formFilters {
|
||||
display: none;
|
||||
}
|
||||
.company-name {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.container.save.button-cancel {
|
||||
position: fixed;
|
||||
top: 10vh;
|
||||
right: 10vh;
|
||||
}
|
||||
|
||||
.container-input {
|
||||
margin: 0 auto;
|
||||
@@ -10,5 +19,12 @@ label {
|
||||
font-weight: bold;
|
||||
}
|
||||
.container-input input {
|
||||
width: 250px;
|
||||
max-width: 250px;
|
||||
}
|
||||
|
||||
input.dirty,
|
||||
textarea.dirty,
|
||||
select.dirty {
|
||||
border-color: var(--colour-primary);
|
||||
background-color: var(--colour-page-background-2);
|
||||
}
|
||||
1
static/dist/css/main.bundle.css
vendored
1
static/dist/css/main.bundle.css
vendored
@@ -183,6 +183,7 @@ script, link {
|
||||
.container-input > input,
|
||||
.container-input > textarea {
|
||||
border: 2px solid var(--colour-accent);
|
||||
border-radius: 0.5vh;
|
||||
padding: 1vh 1vw;
|
||||
}
|
||||
|
||||
|
||||
2
static/dist/css/main.bundle.css.map
vendored
2
static/dist/css/main.bundle.css.map
vendored
File diff suppressed because one or more lines are too long
17
static/dist/css/user_account.bundle.css
vendored
17
static/dist/css/user_account.bundle.css
vendored
@@ -69,6 +69,15 @@
|
||||
#formFilters {
|
||||
display: none;
|
||||
}
|
||||
.company-name {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.container.save.button-cancel {
|
||||
position: fixed;
|
||||
top: 10vh;
|
||||
right: 10vh;
|
||||
}
|
||||
|
||||
.container-input {
|
||||
margin: 0 auto;
|
||||
@@ -77,8 +86,14 @@ label {
|
||||
font-weight: bold;
|
||||
}
|
||||
.container-input input {
|
||||
width: 250px;
|
||||
max-width: 250px;
|
||||
}
|
||||
|
||||
input.dirty,
|
||||
textarea.dirty,
|
||||
select.dirty {
|
||||
border-color: var(--colour-primary);
|
||||
background-color: var(--colour-page-background-2);
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=user_account.bundle.css.map*/
|
||||
2
static/dist/css/user_account.bundle.css.map
vendored
2
static/dist/css/user_account.bundle.css.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"css/user_account.bundle.css","mappings":";;AAEA;IACI,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;AAClB;;;AAGA,iBAAiB;AACjB;IACI,sBAAsB;AAC1B;;AAEA,eAAe;AACf;IACI,gBAAgB;IAChB,cAAc;IACd,SAAS;IACT,SAAS;IACT,qBAAqB;IACrB,2BAA2B;IAC3B,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,gBAAgB;IAChB,kBAAkB;IAClB,kBAAkB;IAClB,WAAW;IACX,yBAAyB;AAC7B;;;AAGA,WAAW;AACX;IACI,gBAAgB;IAChB,kBAAkB;IAClB,SAAS;IACT,eAAe;IACf,gBAAgB;IAChB,sCAAsC;IACtC,kBAAkB;IAClB,SAAS;IACT,WAAW;AACf;;AAEA;IACI;QACI,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,WAAW;QACX,eAAe;IACnB;IACA;QACI,eAAe;IACnB;IACA;QACI,cAAc;IAClB;AACJ;;AAEA;IACI,UAAU;IACV,SAAS;AACb,C;;;AChEA;IACI,aAAa;AACjB;;AAEA;IACI,cAAc;AAClB;AACA;IACI,iBAAiB;AACrB;AACA;IACI,YAAY;AAChB","sources":["webpack://app/./static/css/sections/dog.css","webpack://app/./static/css/pages/user/user.css"],"sourcesContent":["\n\n.container-input > input {\n padding: 0vh 1vh;\n border-radius: 0.5vh;\n max-width: 7vh;\n}\n\n\n/* Right column */\n.rightcolumn {\n min-width: fit-content;\n}\n\n/* Main Table */\n#pageBody {\n max-height: 88vh;\n padding: 0 5vw;\n margin: 0;\n border: 0;\n align-content: center;\n justify-content: flex-start;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n overflow-y: auto;\n overflow-x: hidden;\n position: absolute;\n width: 90vw;\n color: var(--colour-text);\n}\n\n\n/* Footer */\n.footer {\n padding: 1vh 1vw;\n text-align: center;\n margin: 0;\n max-height: 5vh;\n overflow-y: auto;\n background-color: var(--colour-accent);\n position: absolute;\n bottom: 0;\n width: 98vw;\n}\n\n@media screen and (max-width: 400px) {\n .footer {\n max-height: 8vh;\n padding: 0.75vh 2vw;\n font-size: 10px; \n width: 96vw;\n max-width: 96vw;\n }\n .footer > h4 {\n font-size: 10px;\n }\n .footer > h5 {\n font-size: 9px;\n }\n}\n\n.footer > h4, h5 {\n padding: 0;\n margin: 0;\n}","\n#formFilters {\n display: none;\n}\n\n.container-input {\n margin: 0 auto;\n}\nlabel {\n font-weight: bold;\n}\n.container-input input {\n width: 250px;\n}\n"],"names":[],"sourceRoot":""}
|
||||
{"version":3,"file":"css/user_account.bundle.css","mappings":";;AAEA;IACI,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;AAClB;;;AAGA,iBAAiB;AACjB;IACI,sBAAsB;AAC1B;;AAEA,eAAe;AACf;IACI,gBAAgB;IAChB,cAAc;IACd,SAAS;IACT,SAAS;IACT,qBAAqB;IACrB,2BAA2B;IAC3B,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,gBAAgB;IAChB,kBAAkB;IAClB,kBAAkB;IAClB,WAAW;IACX,yBAAyB;AAC7B;;;AAGA,WAAW;AACX;IACI,gBAAgB;IAChB,kBAAkB;IAClB,SAAS;IACT,eAAe;IACf,gBAAgB;IAChB,sCAAsC;IACtC,kBAAkB;IAClB,SAAS;IACT,WAAW;AACf;;AAEA;IACI;QACI,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,WAAW;QACX,eAAe;IACnB;IACA;QACI,eAAe;IACnB;IACA;QACI,cAAc;IAClB;AACJ;;AAEA;IACI,UAAU;IACV,SAAS;AACb,C;;;AChEA;IACI,aAAa;AACjB;AACA;IACI,iBAAiB;AACrB;;AAEA;IACI,eAAe;IACf,SAAS;IACT,WAAW;AACf;;AAEA;IACI,cAAc;AAClB;AACA;IACI,iBAAiB;AACrB;AACA;IACI,gBAAgB;AACpB;;AAEA;;;IAGI,mCAAmC;IACnC,iDAAiD;AACrD,C","sources":["webpack://app/./static/css/sections/dog.css","webpack://app/./static/css/pages/user/user.css"],"sourcesContent":["\n\n.container-input > input {\n padding: 0vh 1vh;\n border-radius: 0.5vh;\n max-width: 7vh;\n}\n\n\n/* Right column */\n.rightcolumn {\n min-width: fit-content;\n}\n\n/* Main Table */\n#pageBody {\n max-height: 88vh;\n padding: 0 5vw;\n margin: 0;\n border: 0;\n align-content: center;\n justify-content: flex-start;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n overflow-y: auto;\n overflow-x: hidden;\n position: absolute;\n width: 90vw;\n color: var(--colour-text);\n}\n\n\n/* Footer */\n.footer {\n padding: 1vh 1vw;\n text-align: center;\n margin: 0;\n max-height: 5vh;\n overflow-y: auto;\n background-color: var(--colour-accent);\n position: absolute;\n bottom: 0;\n width: 98vw;\n}\n\n@media screen and (max-width: 400px) {\n .footer {\n max-height: 8vh;\n padding: 0.75vh 2vw;\n font-size: 10px; \n width: 96vw;\n max-width: 96vw;\n }\n .footer > h4 {\n font-size: 10px;\n }\n .footer > h5 {\n font-size: 9px;\n }\n}\n\n.footer > h4, h5 {\n padding: 0;\n margin: 0;\n}","\n#formFilters {\n display: none;\n}\n.company-name {\n font-size: 2.5rem;\n}\n\n.container.save.button-cancel {\n position: fixed;\n top: 10vh;\n right: 10vh;\n}\n\n.container-input {\n margin: 0 auto;\n}\nlabel {\n font-weight: bold;\n}\n.container-input input {\n max-width: 250px;\n}\n\ninput.dirty, \ntextarea.dirty, \nselect.dirty {\n border-color: var(--colour-primary);\n background-color: var(--colour-page-background-2);\n}"],"names":[],"sourceRoot":""}
|
||||
85
static/dist/css/user_company.bundle.css
vendored
Normal file
85
static/dist/css/user_company.bundle.css
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
|
||||
|
||||
.container-input > input {
|
||||
padding: 0vh 1vh;
|
||||
border-radius: 0.5vh;
|
||||
max-width: 7vh;
|
||||
}
|
||||
|
||||
|
||||
/* Right column */
|
||||
.rightcolumn {
|
||||
min-width: fit-content;
|
||||
}
|
||||
|
||||
/* Main Table */
|
||||
#pageBody {
|
||||
max-height: 88vh;
|
||||
padding: 0 5vw;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
align-content: center;
|
||||
justify-content: flex-start;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: absolute;
|
||||
width: 90vw;
|
||||
color: var(--colour-text);
|
||||
}
|
||||
|
||||
|
||||
/* Footer */
|
||||
.footer {
|
||||
padding: 1vh 1vw;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
max-height: 5vh;
|
||||
overflow-y: auto;
|
||||
background-color: var(--colour-accent);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 98vw;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 400px) {
|
||||
.footer {
|
||||
max-height: 8vh;
|
||||
padding: 0.75vh 2vw;
|
||||
font-size: 10px;
|
||||
width: 96vw;
|
||||
max-width: 96vw;
|
||||
}
|
||||
.footer > h4 {
|
||||
font-size: 10px;
|
||||
}
|
||||
.footer > h5 {
|
||||
font-size: 9px;
|
||||
}
|
||||
}
|
||||
|
||||
.footer > h4, h5 {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
#formFilters {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.container-input {
|
||||
margin: 0 auto;
|
||||
}
|
||||
.container-input input {
|
||||
max-width: 250px;
|
||||
padding: 1vh 1vw;
|
||||
}
|
||||
|
||||
.container-input textarea {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=user_company.bundle.css.map*/
|
||||
1
static/dist/css/user_company.bundle.css.map
vendored
Normal file
1
static/dist/css/user_company.bundle.css.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"css/user_company.bundle.css","mappings":";;AAEA;IACI,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;AAClB;;;AAGA,iBAAiB;AACjB;IACI,sBAAsB;AAC1B;;AAEA,eAAe;AACf;IACI,gBAAgB;IAChB,cAAc;IACd,SAAS;IACT,SAAS;IACT,qBAAqB;IACrB,2BAA2B;IAC3B,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,gBAAgB;IAChB,kBAAkB;IAClB,kBAAkB;IAClB,WAAW;IACX,yBAAyB;AAC7B;;;AAGA,WAAW;AACX;IACI,gBAAgB;IAChB,kBAAkB;IAClB,SAAS;IACT,eAAe;IACf,gBAAgB;IAChB,sCAAsC;IACtC,kBAAkB;IAClB,SAAS;IACT,WAAW;AACf;;AAEA;IACI;QACI,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,WAAW;QACX,eAAe;IACnB;IACA;QACI,eAAe;IACnB;IACA;QACI,cAAc;IAClB;AACJ;;AAEA;IACI,UAAU;IACV,SAAS;AACb,C;;;AChEA;IACI,aAAa;AACjB;;AAEA;IACI,cAAc;AAClB;AACA;IACI,gBAAgB;IAChB,gBAAgB;AACpB;;AAEA;IACI,YAAY;AAChB,C","sources":["webpack://app/./static/css/sections/dog.css","webpack://app/./static/css/pages/user/company.css"],"sourcesContent":["\n\n.container-input > input {\n padding: 0vh 1vh;\n border-radius: 0.5vh;\n max-width: 7vh;\n}\n\n\n/* Right column */\n.rightcolumn {\n min-width: fit-content;\n}\n\n/* Main Table */\n#pageBody {\n max-height: 88vh;\n padding: 0 5vw;\n margin: 0;\n border: 0;\n align-content: center;\n justify-content: flex-start;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n overflow-y: auto;\n overflow-x: hidden;\n position: absolute;\n width: 90vw;\n color: var(--colour-text);\n}\n\n\n/* Footer */\n.footer {\n padding: 1vh 1vw;\n text-align: center;\n margin: 0;\n max-height: 5vh;\n overflow-y: auto;\n background-color: var(--colour-accent);\n position: absolute;\n bottom: 0;\n width: 98vw;\n}\n\n@media screen and (max-width: 400px) {\n .footer {\n max-height: 8vh;\n padding: 0.75vh 2vw;\n font-size: 10px; \n width: 96vw;\n max-width: 96vw;\n }\n .footer > h4 {\n font-size: 10px;\n }\n .footer > h5 {\n font-size: 9px;\n }\n}\n\n.footer > h4, h5 {\n padding: 0;\n margin: 0;\n}","\n#formFilters {\n display: none;\n}\n\n.container-input {\n margin: 0 auto;\n}\n.container-input input {\n max-width: 250px;\n padding: 1vh 1vw;\n}\n\n.container-input textarea {\n width: 300px;\n}"],"names":[],"sourceRoot":""}
|
||||
408
static/dist/js/main.bundle.js
vendored
408
static/dist/js/main.bundle.js
vendored
@@ -657,6 +657,7 @@ var API = /*#__PURE__*/function () {
|
||||
*/
|
||||
|
||||
// User
|
||||
// user
|
||||
}, {
|
||||
key: "loginUser",
|
||||
value: function () {
|
||||
@@ -695,7 +696,7 @@ var API = /*#__PURE__*/function () {
|
||||
dataRequest[flagUser] = users;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context3.next = 6;
|
||||
return API.request(hashSaveDogUser, 'POST', dataRequest);
|
||||
return API.request(hashSaveUserUser, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context3.abrupt("return", _context3.sent);
|
||||
case 7:
|
||||
@@ -708,22 +709,21 @@ var API = /*#__PURE__*/function () {
|
||||
return _saveUsers.apply(this, arguments);
|
||||
}
|
||||
return saveUsers;
|
||||
}() // dog
|
||||
// Command categories
|
||||
}() // company
|
||||
}, {
|
||||
key: "saveCommandCategories",
|
||||
key: "saveCompanies",
|
||||
value: function () {
|
||||
var _saveCommandCategories = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(commandCategories, formFilters, comment) {
|
||||
var _saveCompanies = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(companies, formFilters, comment) {
|
||||
var dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
||||
while (1) switch (_context4.prev = _context4.next) {
|
||||
case 0:
|
||||
dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagCommandCategory] = commandCategories;
|
||||
dataRequest[flagCompany] = companies;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context4.next = 6;
|
||||
return API.request(hashSaveDogCommandCategory, 'POST', dataRequest);
|
||||
return API.request(hashSaveDogCompany, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context4.abrupt("return", _context4.sent);
|
||||
case 7:
|
||||
@@ -732,25 +732,26 @@ var API = /*#__PURE__*/function () {
|
||||
}
|
||||
}, _callee4);
|
||||
}));
|
||||
function saveCommandCategories(_x5, _x6, _x7) {
|
||||
return _saveCommandCategories.apply(this, arguments);
|
||||
function saveCompanies(_x5, _x6, _x7) {
|
||||
return _saveCompanies.apply(this, arguments);
|
||||
}
|
||||
return saveCommandCategories;
|
||||
}() // Commands
|
||||
return saveCompanies;
|
||||
}() // dog
|
||||
// Command categories
|
||||
}, {
|
||||
key: "saveCommands",
|
||||
key: "saveCommandCategories",
|
||||
value: function () {
|
||||
var _saveCommands = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(commands, formFilters, comment) {
|
||||
var _saveCommandCategories = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(commandCategories, formFilters, comment) {
|
||||
var dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
||||
while (1) switch (_context5.prev = _context5.next) {
|
||||
case 0:
|
||||
dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagCommand] = commands;
|
||||
dataRequest[flagCommandCategory] = commandCategories;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context5.next = 6;
|
||||
return API.request(hashSaveDogCommand, 'POST', dataRequest);
|
||||
return API.request(hashSaveDogCommandCategory, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context5.abrupt("return", _context5.sent);
|
||||
case 7:
|
||||
@@ -759,25 +760,25 @@ var API = /*#__PURE__*/function () {
|
||||
}
|
||||
}, _callee5);
|
||||
}));
|
||||
function saveCommands(_x8, _x9, _x10) {
|
||||
return _saveCommands.apply(this, arguments);
|
||||
function saveCommandCategories(_x8, _x9, _x10) {
|
||||
return _saveCommandCategories.apply(this, arguments);
|
||||
}
|
||||
return saveCommands;
|
||||
}() // Dog Command Links
|
||||
return saveCommandCategories;
|
||||
}() // Commands
|
||||
}, {
|
||||
key: "saveDogCommandLinks",
|
||||
key: "saveCommands",
|
||||
value: function () {
|
||||
var _saveDogCommandLinks = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(dogCommandLinks, formFilters, comment) {
|
||||
var _saveCommands = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(commands, formFilters, comment) {
|
||||
var dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
||||
while (1) switch (_context6.prev = _context6.next) {
|
||||
case 0:
|
||||
dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagDogCommandLink] = dogCommandLinks;
|
||||
dataRequest[flagCommand] = commands;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context6.next = 6;
|
||||
return API.request(hashSaveDogDogCommandLink, 'POST', dataRequest);
|
||||
return API.request(hashSaveDogCommand, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context6.abrupt("return", _context6.sent);
|
||||
case 7:
|
||||
@@ -786,25 +787,25 @@ var API = /*#__PURE__*/function () {
|
||||
}
|
||||
}, _callee6);
|
||||
}));
|
||||
function saveDogCommandLinks(_x11, _x12, _x13) {
|
||||
return _saveDogCommandLinks.apply(this, arguments);
|
||||
function saveCommands(_x11, _x12, _x13) {
|
||||
return _saveCommands.apply(this, arguments);
|
||||
}
|
||||
return saveDogCommandLinks;
|
||||
}() // Locations
|
||||
return saveCommands;
|
||||
}() // Dog Command Links
|
||||
}, {
|
||||
key: "saveLocations",
|
||||
key: "saveDogCommandLinks",
|
||||
value: function () {
|
||||
var _saveLocations = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(locations, formFilters, comment) {
|
||||
var _saveDogCommandLinks = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(dogCommandLinks, formFilters, comment) {
|
||||
var dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
||||
while (1) switch (_context7.prev = _context7.next) {
|
||||
case 0:
|
||||
dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagLocation] = locations;
|
||||
dataRequest[flagDogCommandLink] = dogCommandLinks;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context7.next = 6;
|
||||
return API.request(hashSaveDogLocation, 'POST', dataRequest);
|
||||
return API.request(hashSaveDogDogCommandLink, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context7.abrupt("return", _context7.sent);
|
||||
case 7:
|
||||
@@ -813,25 +814,25 @@ var API = /*#__PURE__*/function () {
|
||||
}
|
||||
}, _callee7);
|
||||
}));
|
||||
function saveLocations(_x14, _x15, _x16) {
|
||||
return _saveLocations.apply(this, arguments);
|
||||
function saveDogCommandLinks(_x14, _x15, _x16) {
|
||||
return _saveDogCommandLinks.apply(this, arguments);
|
||||
}
|
||||
return saveLocations;
|
||||
}() // Button Icons
|
||||
return saveDogCommandLinks;
|
||||
}() // Locations
|
||||
}, {
|
||||
key: "saveButtonIcons",
|
||||
key: "saveLocations",
|
||||
value: function () {
|
||||
var _saveButtonIcons = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(buttonIcons, formFilters, comment) {
|
||||
var _saveLocations = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(locations, formFilters, comment) {
|
||||
var dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
||||
while (1) switch (_context8.prev = _context8.next) {
|
||||
case 0:
|
||||
dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagButtonIcon] = buttonIcons;
|
||||
dataRequest[flagLocation] = locations;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context8.next = 6;
|
||||
return API.request(hashSaveDogButtonIcon, 'POST', dataRequest);
|
||||
return API.request(hashSaveDogLocation, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context8.abrupt("return", _context8.sent);
|
||||
case 7:
|
||||
@@ -840,25 +841,25 @@ var API = /*#__PURE__*/function () {
|
||||
}
|
||||
}, _callee8);
|
||||
}));
|
||||
function saveButtonIcons(_x17, _x18, _x19) {
|
||||
return _saveButtonIcons.apply(this, arguments);
|
||||
function saveLocations(_x17, _x18, _x19) {
|
||||
return _saveLocations.apply(this, arguments);
|
||||
}
|
||||
return saveButtonIcons;
|
||||
}() // Command Button Links
|
||||
return saveLocations;
|
||||
}() // Button Icons
|
||||
}, {
|
||||
key: "saveCommandButtonLinks",
|
||||
key: "saveButtonIcons",
|
||||
value: function () {
|
||||
var _saveCommandButtonLinks = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(links, formFilters, comment) {
|
||||
var _saveButtonIcons = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(buttonIcons, formFilters, comment) {
|
||||
var dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
||||
while (1) switch (_context9.prev = _context9.next) {
|
||||
case 0:
|
||||
dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagCommandButtonLink] = links;
|
||||
dataRequest[flagButtonIcon] = buttonIcons;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context9.next = 6;
|
||||
return API.request(hashSaveDogCommandButtonLink, 'POST', dataRequest);
|
||||
return API.request(hashSaveDogButtonIcon, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context9.abrupt("return", _context9.sent);
|
||||
case 7:
|
||||
@@ -867,25 +868,25 @@ var API = /*#__PURE__*/function () {
|
||||
}
|
||||
}, _callee9);
|
||||
}));
|
||||
function saveCommandButtonLinks(_x20, _x21, _x22) {
|
||||
return _saveCommandButtonLinks.apply(this, arguments);
|
||||
function saveButtonIcons(_x20, _x21, _x22) {
|
||||
return _saveButtonIcons.apply(this, arguments);
|
||||
}
|
||||
return saveCommandButtonLinks;
|
||||
}() // Assessments
|
||||
return saveButtonIcons;
|
||||
}() // Command Button Links
|
||||
}, {
|
||||
key: "saveAssessments",
|
||||
key: "saveCommandButtonLinks",
|
||||
value: function () {
|
||||
var _saveAssessments = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(assessments, formFilters, comment) {
|
||||
var _saveCommandButtonLinks = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(links, formFilters, comment) {
|
||||
var dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
||||
while (1) switch (_context10.prev = _context10.next) {
|
||||
case 0:
|
||||
dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagAssessment] = assessments;
|
||||
dataRequest[flagCommandButtonLink] = links;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context10.next = 6;
|
||||
return API.request(hashSaveDogAssessment, 'POST', dataRequest);
|
||||
return API.request(hashSaveDogCommandButtonLink, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context10.abrupt("return", _context10.sent);
|
||||
case 7:
|
||||
@@ -894,7 +895,34 @@ var API = /*#__PURE__*/function () {
|
||||
}
|
||||
}, _callee10);
|
||||
}));
|
||||
function saveAssessments(_x23, _x24, _x25) {
|
||||
function saveCommandButtonLinks(_x23, _x24, _x25) {
|
||||
return _saveCommandButtonLinks.apply(this, arguments);
|
||||
}
|
||||
return saveCommandButtonLinks;
|
||||
}() // Assessments
|
||||
}, {
|
||||
key: "saveAssessments",
|
||||
value: function () {
|
||||
var _saveAssessments = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(assessments, formFilters, comment) {
|
||||
var dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
||||
while (1) switch (_context11.prev = _context11.next) {
|
||||
case 0:
|
||||
dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagAssessment] = assessments;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context11.next = 6;
|
||||
return API.request(hashSaveDogAssessment, 'POST', dataRequest);
|
||||
case 6:
|
||||
return _context11.abrupt("return", _context11.sent);
|
||||
case 7:
|
||||
case "end":
|
||||
return _context11.stop();
|
||||
}
|
||||
}, _callee11);
|
||||
}));
|
||||
function saveAssessments(_x26, _x27, _x28) {
|
||||
return _saveAssessments.apply(this, arguments);
|
||||
}
|
||||
return saveAssessments;
|
||||
@@ -902,10 +930,10 @@ var API = /*#__PURE__*/function () {
|
||||
}, {
|
||||
key: "saveAssessmentsDistractionsAndResponses",
|
||||
value: function () {
|
||||
var _saveAssessmentsDistractionsAndResponses = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(assessments, formFilters, comment) {
|
||||
var _saveAssessmentsDistractionsAndResponses = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(assessments, formFilters, comment) {
|
||||
var filtersJson, dataRequest;
|
||||
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
||||
while (1) switch (_context11.prev = _context11.next) {
|
||||
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
||||
while (1) switch (_context12.prev = _context12.next) {
|
||||
case 0:
|
||||
filtersJson = DOM.convertForm2JSON(formFilters);
|
||||
filtersJson[attrIdAssessment] = null;
|
||||
@@ -913,17 +941,17 @@ var API = /*#__PURE__*/function () {
|
||||
dataRequest[flagFormFilters] = filtersJson;
|
||||
dataRequest[flagAssessment] = assessments;
|
||||
dataRequest[flagComment] = comment;
|
||||
_context11.next = 8;
|
||||
_context12.next = 8;
|
||||
return API.request(hashSaveDogAssessmentDistractionAndResponse, 'POST', dataRequest);
|
||||
case 8:
|
||||
return _context11.abrupt("return", _context11.sent);
|
||||
return _context12.abrupt("return", _context12.sent);
|
||||
case 9:
|
||||
case "end":
|
||||
return _context11.stop();
|
||||
return _context12.stop();
|
||||
}
|
||||
}, _callee11);
|
||||
}, _callee12);
|
||||
}));
|
||||
function saveAssessmentsDistractionsAndResponses(_x26, _x27, _x28) {
|
||||
function saveAssessmentsDistractionsAndResponses(_x29, _x30, _x31) {
|
||||
return _saveAssessmentsDistractionsAndResponses.apply(this, arguments);
|
||||
}
|
||||
return saveAssessmentsDistractionsAndResponses;
|
||||
@@ -6550,6 +6578,115 @@ var PageDogDogCommandLinks = /*#__PURE__*/function (_TableBasePage) {
|
||||
dog_command_links_defineProperty(PageDogDogCommandLinks, "hash", hashPageDogDogCommandLinks);
|
||||
dog_command_links_defineProperty(PageDogDogCommandLinks, "attrIdRowObject", attrIdDogCommandLink);
|
||||
|
||||
;// ./static/js/pages/dog/dogs.js
|
||||
function dogs_typeof(o) { "@babel/helpers - typeof"; return dogs_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, dogs_typeof(o); }
|
||||
function dogs_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
||||
function dogs_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, dogs_toPropertyKey(o.key), o); } }
|
||||
function dogs_createClass(e, r, t) { return r && dogs_defineProperties(e.prototype, r), t && dogs_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
||||
function dogs_callSuper(t, o, e) { return o = dogs_getPrototypeOf(o), dogs_possibleConstructorReturn(t, dogs_isNativeReflectConstruct() ? Reflect.construct(o, e || [], dogs_getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
||||
function dogs_possibleConstructorReturn(t, e) { if (e && ("object" == dogs_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return dogs_assertThisInitialized(t); }
|
||||
function dogs_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
||||
function dogs_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (dogs_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
||||
function dogs_superPropGet(t, o, e, r) { var p = dogs_get(dogs_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
||||
function dogs_get() { return dogs_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = dogs_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, dogs_get.apply(null, arguments); }
|
||||
function dogs_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = dogs_getPrototypeOf(t));); return t; }
|
||||
function dogs_getPrototypeOf(t) { return dogs_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, dogs_getPrototypeOf(t); }
|
||||
function dogs_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && dogs_setPrototypeOf(t, e); }
|
||||
function dogs_setPrototypeOf(t, e) { return dogs_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, dogs_setPrototypeOf(t, e); }
|
||||
function dogs_defineProperty(e, r, t) { return (r = dogs_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function dogs_toPropertyKey(t) { var i = dogs_toPrimitive(t, "string"); return "symbol" == dogs_typeof(i) ? i : i + ""; }
|
||||
function dogs_toPrimitive(t, r) { if ("object" != dogs_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != dogs_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var PageDogDogs = /*#__PURE__*/function (_TableBasePage) {
|
||||
function PageDogDogs(router) {
|
||||
var _this;
|
||||
dogs_classCallCheck(this, PageDogDogs);
|
||||
_this = dogs_callSuper(this, PageDogDogs, [router]);
|
||||
dogs_defineProperty(_this, "callSaveTableContent", API.saveDogs);
|
||||
_this.dogMixin = new DogTableMixinPage(_this);
|
||||
return _this;
|
||||
}
|
||||
dogs_inherits(PageDogDogs, _TableBasePage);
|
||||
return dogs_createClass(PageDogDogs, [{
|
||||
key: "initialize",
|
||||
value: function initialize() {
|
||||
this.sharedInitialize();
|
||||
}
|
||||
}, {
|
||||
key: "hookupFilters",
|
||||
value: function hookupFilters() {
|
||||
this.sharedHookupFilters();
|
||||
this.hookupFilterActive();
|
||||
}
|
||||
}, {
|
||||
key: "loadRowTable",
|
||||
value: function loadRowTable(rowJson) {
|
||||
if (rowJson == null) return;
|
||||
if (_verbose) {
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment("applying data row: ", rowJson);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "getJsonRow",
|
||||
value: function getJsonRow(row) {
|
||||
if (row == null) return;
|
||||
var inputName = row.querySelector('td.' + flagName + ' .' + flagName);
|
||||
var inputAppearance = row.querySelector('td.' + flagAppearance + ' .' + flagAppearance);
|
||||
var inputMassKg = row.querySelector('td.' + flagMassKg + ' .' + flagMassKg);
|
||||
var buttonActive = row.querySelector('td.' + flagActive + ' .' + flagActive);
|
||||
var jsonRow = {};
|
||||
jsonRow[attrIdDog] = row.getAttribute(attrIdDog);
|
||||
jsonRow[flagName] = DOM.getElementAttributeValueCurrent(inputName);
|
||||
jsonRow[flagAppearance] = DOM.getElementAttributeValueCurrent(inputAppearance);
|
||||
jsonRow[flagMassKg] = DOM.getElementAttributeValueCurrent(inputMassKg);
|
||||
jsonRow[flagActive] = buttonActive.classList.contains(flagDelete);
|
||||
console.log("jsonRow");
|
||||
console.log(jsonRow);
|
||||
return jsonRow;
|
||||
}
|
||||
}, {
|
||||
key: "initialiseRowNew",
|
||||
value: function initialiseRowNew(tbody, row) {}
|
||||
}, {
|
||||
key: "postInitialiseRowNewCallback",
|
||||
value: function postInitialiseRowNewCallback(tbody) {}
|
||||
}, {
|
||||
key: "hookupTableMain",
|
||||
value: function hookupTableMain() {
|
||||
dogs_superPropGet(PageDogDogs, "hookupTableMain", this, 3)([]);
|
||||
this.hookupFieldsNameTable();
|
||||
this.hookupFieldsAppearance();
|
||||
this.hookupFieldsMassKg();
|
||||
this.hookupFieldsNotesTable();
|
||||
this.hookupFieldsActive();
|
||||
}
|
||||
}, {
|
||||
key: "hookupFieldsAppearance",
|
||||
value: function hookupFieldsAppearance() {
|
||||
this.hookupChangeHandlerTableCells(flagAppearance);
|
||||
}
|
||||
}, {
|
||||
key: "hookupFieldsMassKg",
|
||||
value: function hookupFieldsMassKg() {
|
||||
this.hookupChangeHandlerTableCells(flagMassKg);
|
||||
}
|
||||
}, {
|
||||
key: "leave",
|
||||
value: function leave() {
|
||||
dogs_superPropGet(PageDogDogs, "leave", this, 3)([]);
|
||||
}
|
||||
}]);
|
||||
}(TableBasePage);
|
||||
dogs_defineProperty(PageDogDogs, "hash", hashPageDogDogs);
|
||||
dogs_defineProperty(PageDogDogs, "attrIdRowObject", attrIdDog);
|
||||
|
||||
;// ./static/js/pages/dog/locations.js
|
||||
function locations_typeof(o) { "@babel/helpers - typeof"; return locations_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, locations_typeof(o); }
|
||||
function locations_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
||||
@@ -8344,16 +8481,90 @@ function user_defineProperty(e, r, t) { return (r = user_toPropertyKey(r)) in e
|
||||
function user_toPropertyKey(t) { var i = user_toPrimitive(t, "string"); return "symbol" == user_typeof(i) ? i : i + ""; }
|
||||
function user_toPrimitive(t, r) { if ("object" != user_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != user_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
|
||||
var PageUser = /*#__PURE__*/function (_BasePage) {
|
||||
|
||||
|
||||
|
||||
var PageUser = /*#__PURE__*/function (_TableBasePage) {
|
||||
function PageUser(router) {
|
||||
var _this;
|
||||
user_classCallCheck(this, PageUser);
|
||||
return user_callSuper(this, PageUser, [router]);
|
||||
_this = user_callSuper(this, PageUser, [router]);
|
||||
user_defineProperty(_this, "callSaveTableContent", API.saveUsers);
|
||||
_this.dogMixin = new DogTableMixinPage(_this);
|
||||
return _this;
|
||||
}
|
||||
user_inherits(PageUser, _BasePage);
|
||||
user_inherits(PageUser, _TableBasePage);
|
||||
return user_createClass(PageUser, [{
|
||||
key: "initialize",
|
||||
value: function initialize() {
|
||||
this.sharedInitialize();
|
||||
this.hookupTableMain();
|
||||
}
|
||||
}, {
|
||||
key: "hookupFilters",
|
||||
value: function hookupFilters() {}
|
||||
}, {
|
||||
key: "loadRowTable",
|
||||
value: function loadRowTable(rowJson) {
|
||||
if (rowJson == null) return;
|
||||
if (_verbose) {
|
||||
Utils.consoleLogIfNotProductionEnvironment("applying data row: ", rowJson);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "getTableRecords",
|
||||
value: function getTableRecords() {
|
||||
var dirtyOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
dirtyOnly = true;
|
||||
var container = document.querySelector('.' + flagCard + '.' + flagUser);
|
||||
return [this.getJsonRow(container)];
|
||||
}
|
||||
}, {
|
||||
key: "getJsonRow",
|
||||
value: function getJsonRow(container) {
|
||||
console.log("getJsonRow: ", container);
|
||||
if (container == null) return;
|
||||
var inputFirstname = container.querySelector(' #' + flagFirstname);
|
||||
var inputSurname = container.querySelector(' #' + flagSurname);
|
||||
var inputEmail = container.querySelector(' #' + flagEmail);
|
||||
var divRole = container.querySelector('.' + flagRole);
|
||||
var idUser = container.getAttribute(attrIdUser);
|
||||
var jsonRow = user_defineProperty(user_defineProperty(user_defineProperty(user_defineProperty(user_defineProperty(user_defineProperty(user_defineProperty(user_defineProperty(user_defineProperty({}, attrIdUserAuth0, null), flagEmail, null), flagIsEmailVerified, null), attrIdCompany, company[attrIdCompany]), flagIsSuperUser, null), flagCanAdminDog, null), flagCanAdminUser, null), flagCompany, null), flagRole, null);
|
||||
jsonRow[attrIdUser] = idUser;
|
||||
jsonRow[attrIdRole] = DOM.getElementAttributeValueCurrent(divRole);
|
||||
jsonRow[flagFirstname] = DOM.getElementAttributeValueCurrent(inputFirstname);
|
||||
jsonRow[flagSurname] = DOM.getElementAttributeValueCurrent(inputSurname);
|
||||
jsonRow[flagEmail] = DOM.getElementAttributeValueCurrent(inputEmail);
|
||||
return jsonRow;
|
||||
}
|
||||
}, {
|
||||
key: "initialiseRowNew",
|
||||
value: function initialiseRowNew(tbody, row) {}
|
||||
}, {
|
||||
key: "postInitialiseRowNewCallback",
|
||||
value: function postInitialiseRowNewCallback(tbody) {}
|
||||
}, {
|
||||
key: "hookupTableMain",
|
||||
value: function hookupTableMain() {
|
||||
user_superPropGet(PageUser, "hookupTableMain", this, 3)([]);
|
||||
this.hookupFieldsFirstname();
|
||||
this.hookupFieldsSurname();
|
||||
this.hookupFieldsEmail();
|
||||
}
|
||||
}, {
|
||||
key: "hookupFieldsFirstname",
|
||||
value: function hookupFieldsFirstname() {
|
||||
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagFirstname);
|
||||
}
|
||||
}, {
|
||||
key: "hookupFieldsSurname",
|
||||
value: function hookupFieldsSurname() {
|
||||
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagSurname);
|
||||
}
|
||||
}, {
|
||||
key: "hookupFieldsEmail",
|
||||
value: function hookupFieldsEmail() {
|
||||
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagEmail);
|
||||
}
|
||||
}, {
|
||||
key: "leave",
|
||||
@@ -8361,8 +8572,9 @@ var PageUser = /*#__PURE__*/function (_BasePage) {
|
||||
user_superPropGet(PageUser, "leave", this, 3)([]);
|
||||
}
|
||||
}]);
|
||||
}(BasePage);
|
||||
}(TableBasePage);
|
||||
user_defineProperty(PageUser, "hash", hashPageUserAccount);
|
||||
user_defineProperty(PageUser, "attrIdRowObject", attrIdUser);
|
||||
|
||||
;// ./static/js/pages/user/users.js
|
||||
function users_typeof(o) { "@babel/helpers - typeof"; return users_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, users_typeof(o); }
|
||||
@@ -8493,6 +8705,45 @@ var PageUsers = /*#__PURE__*/function (_TableBasePage) {
|
||||
users_defineProperty(PageUsers, "hash", hashPageUserAccounts);
|
||||
users_defineProperty(PageUsers, "attrIdRowObject", attrIdUser);
|
||||
|
||||
;// ./static/js/pages/user/company.js
|
||||
function company_typeof(o) { "@babel/helpers - typeof"; return company_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, company_typeof(o); }
|
||||
function company_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
||||
function company_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, company_toPropertyKey(o.key), o); } }
|
||||
function company_createClass(e, r, t) { return r && company_defineProperties(e.prototype, r), t && company_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
||||
function company_callSuper(t, o, e) { return o = company_getPrototypeOf(o), company_possibleConstructorReturn(t, company_isNativeReflectConstruct() ? Reflect.construct(o, e || [], company_getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
||||
function company_possibleConstructorReturn(t, e) { if (e && ("object" == company_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return company_assertThisInitialized(t); }
|
||||
function company_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
||||
function company_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (company_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
||||
function company_superPropGet(t, o, e, r) { var p = company_get(company_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
||||
function company_get() { return company_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = company_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, company_get.apply(null, arguments); }
|
||||
function company_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = company_getPrototypeOf(t));); return t; }
|
||||
function company_getPrototypeOf(t) { return company_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, company_getPrototypeOf(t); }
|
||||
function company_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && company_setPrototypeOf(t, e); }
|
||||
function company_setPrototypeOf(t, e) { return company_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, company_setPrototypeOf(t, e); }
|
||||
function company_defineProperty(e, r, t) { return (r = company_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function company_toPropertyKey(t) { var i = company_toPrimitive(t, "string"); return "symbol" == company_typeof(i) ? i : i + ""; }
|
||||
function company_toPrimitive(t, r) { if ("object" != company_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != company_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
|
||||
var PageUserCompany = /*#__PURE__*/function (_BasePage) {
|
||||
function PageUserCompany(router) {
|
||||
company_classCallCheck(this, PageUserCompany);
|
||||
return company_callSuper(this, PageUserCompany, [router]);
|
||||
}
|
||||
company_inherits(PageUserCompany, _BasePage);
|
||||
return company_createClass(PageUserCompany, [{
|
||||
key: "initialize",
|
||||
value: function initialize() {
|
||||
this.sharedInitialize();
|
||||
}
|
||||
}, {
|
||||
key: "leave",
|
||||
value: function leave() {
|
||||
company_superPropGet(PageUserCompany, "leave", this, 3)([]);
|
||||
}
|
||||
}]);
|
||||
}(BasePage);
|
||||
company_defineProperty(PageUserCompany, "hash", hashPageUserCompany);
|
||||
|
||||
;// ./static/js/router.js
|
||||
function router_typeof(o) { "@babel/helpers - typeof"; return router_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, router_typeof(o); }
|
||||
function router_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
||||
@@ -8512,7 +8763,7 @@ function router_toPrimitive(t, r) { if ("object" != router_typeof(t) || !t) retu
|
||||
|
||||
|
||||
|
||||
// import PageDogDogs from './pages/dog/dogs.js';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8533,6 +8784,7 @@ function router_toPrimitive(t, r) { if ("object" != router_typeof(t) || !t) retu
|
||||
|
||||
|
||||
|
||||
|
||||
var Router = /*#__PURE__*/function () {
|
||||
function Router() {
|
||||
var _this = this;
|
||||
@@ -8577,7 +8829,10 @@ var Router = /*#__PURE__*/function () {
|
||||
name: 'PageDogDogCommandLinks',
|
||||
module: PageDogDogCommandLinks
|
||||
};
|
||||
// this.pages[hashPageDogDogs] = { name: 'PageDogDogs', module: PageDogDogs };
|
||||
this.pages[hashPageDogDogs] = {
|
||||
name: 'PageDogDogs',
|
||||
module: PageDogDogs
|
||||
};
|
||||
this.pages[hashPageDogLocations] = {
|
||||
name: 'PageDogLocations',
|
||||
module: PageDogLocations
|
||||
@@ -8630,6 +8885,10 @@ var Router = /*#__PURE__*/function () {
|
||||
name: 'PageUsers',
|
||||
module: PageUsers
|
||||
};
|
||||
this.pages[hashPageUserCompany] = {
|
||||
name: 'PageUserCompany',
|
||||
module: PageUserCompany
|
||||
};
|
||||
// Routes
|
||||
this.routes = {};
|
||||
// Core
|
||||
@@ -8670,7 +8929,10 @@ var Router = /*#__PURE__*/function () {
|
||||
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
return _this.navigateToHash(hashPageDogDogCommandLinks, isPopState);
|
||||
};
|
||||
// this.routes[hashPageDogDogs] = (isPopState = false) => this.navigateToHash(hashPageDogDogs, isPopState);
|
||||
this.routes[hashPageDogDogs] = function () {
|
||||
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
return _this.navigateToHash(hashPageDogDogs, isPopState);
|
||||
};
|
||||
this.routes[hashPageDogLocations] = function () {
|
||||
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
return _this.navigateToHash(hashPageDogLocations, isPopState);
|
||||
@@ -8723,6 +8985,10 @@ var Router = /*#__PURE__*/function () {
|
||||
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
return _this.navigateToHash(hashPageUserAccounts, isPopState);
|
||||
};
|
||||
this.routes[hashPageUserCompany] = function () {
|
||||
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
return _this.navigateToHash(hashPageUserCompany, isPopState);
|
||||
};
|
||||
this.initialize();
|
||||
}
|
||||
return router_createClass(Router, [{
|
||||
|
||||
2
static/dist/js/main.bundle.js.map
vendored
2
static/dist/js/main.bundle.js.map
vendored
File diff suppressed because one or more lines are too long
23
static/dist/js/user_company.bundle.js
vendored
Normal file
23
static/dist/js/user_company.bundle.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
|
||||
(() => {
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
})();
|
||||
|
||||
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
|
||||
(() => {
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
})();
|
||||
|
||||
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
|
||||
(() => {
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
})();
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=user_company.bundle.js.map
|
||||
1
static/dist/js/user_company.bundle.js.map
vendored
Normal file
1
static/dist/js/user_company.bundle.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"js/user_company.bundle.js","mappings":";;;;AAAA;;;;;;ACAA;;;;;;ACAA","sources":["webpack://app/./static/css/sections/dog.css?a9d0","webpack://app/./static/css/sections/user.css","webpack://app/./static/css/pages/user/company.css?bfbb"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};"],"names":[],"sourceRoot":""}
|
||||
@@ -66,6 +66,7 @@ export default class API {
|
||||
*/
|
||||
|
||||
// User
|
||||
// user
|
||||
static async loginUser() {
|
||||
let callback = {};
|
||||
callback[flagCallback] = DOM.getHashPageCurrent();
|
||||
@@ -76,7 +77,15 @@ export default class API {
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagUser] = users;
|
||||
dataRequest[flagComment] = comment;
|
||||
return await API.request(hashSaveDogUser, 'POST', dataRequest);
|
||||
return await API.request(hashSaveUserUser, 'POST', dataRequest);
|
||||
}
|
||||
// company
|
||||
static async saveCompanies(companies, formFilters, comment) {
|
||||
let dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagCompany] = companies;
|
||||
dataRequest[flagComment] = comment;
|
||||
return await API.request(hashSaveDogCompany, 'POST', dataRequest);
|
||||
}
|
||||
|
||||
|
||||
|
||||
77
static/js/pages/dog/dogs.js
Normal file
77
static/js/pages/dog/dogs.js
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
import API from "../../api.js";
|
||||
import BusinessObjects from "../../lib/business_objects/business_objects.js";
|
||||
import DOM from "../../dom.js";
|
||||
import Events from "../../lib/events.js";
|
||||
import TableBasePage from "../base_table.js";
|
||||
import Utils from "../../lib/utils.js";
|
||||
import Validation from "../../lib/validation.js";
|
||||
import DogTableMixinPage from "./mixin_table.js";
|
||||
|
||||
export default class PageDogDogs extends TableBasePage {
|
||||
static hash = hashPageDogDogs;
|
||||
static attrIdRowObject = attrIdDog;
|
||||
callSaveTableContent = API.saveDogs;
|
||||
|
||||
constructor(router) {
|
||||
super(router);
|
||||
this.dogMixin = new DogTableMixinPage(this);
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.sharedInitialize();
|
||||
}
|
||||
|
||||
hookupFilters() {
|
||||
this.sharedHookupFilters();
|
||||
this.hookupFilterActive();
|
||||
}
|
||||
|
||||
loadRowTable(rowJson) {
|
||||
if (rowJson == null) return;
|
||||
if (_verbose) { Utils.consoleLogIfNotProductionEnvironment("applying data row: ", rowJson); }
|
||||
}
|
||||
getJsonRow(row) {
|
||||
if (row == null) return;
|
||||
let inputName = row.querySelector('td.' + flagName + ' .' + flagName);
|
||||
let inputAppearance = row.querySelector('td.' + flagAppearance + ' .' + flagAppearance);
|
||||
let inputMassKg = row.querySelector('td.' + flagMassKg + ' .' + flagMassKg);
|
||||
let buttonActive = row.querySelector('td.' + flagActive + ' .' + flagActive);
|
||||
|
||||
let jsonRow = {};
|
||||
jsonRow[attrIdDog] = row.getAttribute(attrIdDog);
|
||||
jsonRow[flagName] = DOM.getElementAttributeValueCurrent(inputName);
|
||||
jsonRow[flagAppearance] = DOM.getElementAttributeValueCurrent(inputAppearance);
|
||||
jsonRow[flagMassKg] = DOM.getElementAttributeValueCurrent(inputMassKg);
|
||||
jsonRow[flagActive] = buttonActive.classList.contains(flagDelete);
|
||||
|
||||
console.log("jsonRow");
|
||||
console.log(jsonRow);
|
||||
|
||||
return jsonRow;
|
||||
}
|
||||
initialiseRowNew(tbody, row) {
|
||||
}
|
||||
postInitialiseRowNewCallback(tbody) {
|
||||
}
|
||||
|
||||
hookupTableMain() {
|
||||
super.hookupTableMain();
|
||||
this.hookupFieldsNameTable();
|
||||
this.hookupFieldsAppearance();
|
||||
this.hookupFieldsMassKg();
|
||||
this.hookupFieldsNotesTable();
|
||||
this.hookupFieldsActive();
|
||||
}
|
||||
hookupFieldsAppearance() {
|
||||
this.hookupChangeHandlerTableCells(flagAppearance);
|
||||
}
|
||||
hookupFieldsMassKg() {
|
||||
this.hookupChangeHandlerTableCells(flagMassKg);
|
||||
}
|
||||
|
||||
leave() {
|
||||
super.leave();
|
||||
}
|
||||
}
|
||||
|
||||
18
static/js/pages/user/company.js
Normal file
18
static/js/pages/user/company.js
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import BasePage from "../base.js";
|
||||
|
||||
export default class PageUserCompany extends BasePage {
|
||||
static hash = hashPageUserCompany;
|
||||
|
||||
constructor(router) {
|
||||
super(router);
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.sharedInitialize();
|
||||
}
|
||||
|
||||
leave() {
|
||||
super.leave();
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,86 @@
|
||||
|
||||
import BasePage from "../base.js";
|
||||
import API from "../../api.js";
|
||||
import DogTableMixinPage from "../dog/mixin_table.js";
|
||||
import DOM from "../../dom.js";
|
||||
import TableBasePage from "../base_table.js";
|
||||
|
||||
export default class PageUser extends BasePage {
|
||||
export default class PageUser extends TableBasePage {
|
||||
static hash = hashPageUserAccount;
|
||||
static attrIdRowObject = attrIdUser;
|
||||
callSaveTableContent = API.saveUsers;
|
||||
|
||||
constructor(router) {
|
||||
super(router);
|
||||
this.dogMixin = new DogTableMixinPage(this);
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.sharedInitialize();
|
||||
this.hookupTableMain();
|
||||
}
|
||||
|
||||
|
||||
hookupFilters() {
|
||||
}
|
||||
|
||||
loadRowTable(rowJson) {
|
||||
if (rowJson == null) return;
|
||||
if (_verbose) { Utils.consoleLogIfNotProductionEnvironment("applying data row: ", rowJson); }
|
||||
}
|
||||
getTableRecords(dirtyOnly = false) {
|
||||
dirtyOnly = true;
|
||||
let container = document.querySelector('.' + flagCard + '.' + flagUser);
|
||||
return [this.getJsonRow(container)];
|
||||
}
|
||||
getJsonRow(container) {
|
||||
console.log("getJsonRow: ", container);
|
||||
if (container == null) return;
|
||||
let inputFirstname = container.querySelector(' #' + flagFirstname);
|
||||
let inputSurname = container.querySelector(' #' + flagSurname);
|
||||
let inputEmail = container.querySelector(' #' + flagEmail);
|
||||
let divRole = container.querySelector('.' + flagRole);
|
||||
|
||||
let idUser = container.getAttribute(attrIdUser);
|
||||
|
||||
let jsonRow = {
|
||||
[attrIdUserAuth0]: null
|
||||
, [flagEmail]: null
|
||||
, [flagIsEmailVerified]: null
|
||||
, [attrIdCompany]: company[attrIdCompany]
|
||||
, [flagIsSuperUser]: null
|
||||
, [flagCanAdminDog]: null
|
||||
, [flagCanAdminUser]: null
|
||||
, [flagCompany]: null
|
||||
, [flagRole]: null
|
||||
};
|
||||
|
||||
jsonRow[attrIdUser] = idUser;
|
||||
jsonRow[attrIdRole] = DOM.getElementAttributeValueCurrent(divRole);
|
||||
jsonRow[flagFirstname] = DOM.getElementAttributeValueCurrent(inputFirstname);
|
||||
jsonRow[flagSurname] = DOM.getElementAttributeValueCurrent(inputSurname);
|
||||
jsonRow[flagEmail] = DOM.getElementAttributeValueCurrent(inputEmail);
|
||||
return jsonRow;
|
||||
}
|
||||
|
||||
initialiseRowNew(tbody, row) {
|
||||
}
|
||||
postInitialiseRowNewCallback(tbody) {
|
||||
}
|
||||
|
||||
hookupTableMain() {
|
||||
super.hookupTableMain();
|
||||
this.hookupFieldsFirstname();
|
||||
this.hookupFieldsSurname();
|
||||
this.hookupFieldsEmail();
|
||||
}
|
||||
hookupFieldsFirstname() {
|
||||
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagFirstname);
|
||||
}
|
||||
hookupFieldsSurname() {
|
||||
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagSurname);
|
||||
}
|
||||
hookupFieldsEmail() {
|
||||
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagEmail);
|
||||
}
|
||||
|
||||
leave() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import PageDogHome from './pages/dog/home.js';
|
||||
import PageDogCommandCategories from './pages/dog/command_categories.js';
|
||||
import PageDogCommands from './pages/dog/commands.js';
|
||||
import PageDogDogCommandLinks from './pages/dog/dog_command_links.js';
|
||||
// import PageDogDogs from './pages/dog/dogs.js';
|
||||
import PageDogDogs from './pages/dog/dogs.js';
|
||||
import PageDogLocations from './pages/dog/locations.js';
|
||||
import PageDogButtonIcons from './pages/dog/button_icons.js';
|
||||
import PageDogCommandButtonLinks from './pages/dog/command_button_links.js';
|
||||
@@ -29,6 +29,7 @@ import PageRetentionSchedule from './pages/legal/retention_schedule.js';
|
||||
// import PageUserLogout from './pages/user/logout.js';
|
||||
import PageUser from './pages/user/user.js';
|
||||
import PageUsers from './pages/user/users.js';
|
||||
import PageUserCompany from './pages/user/company.js';
|
||||
|
||||
import API from './api.js';
|
||||
import DOM from './dom.js';
|
||||
@@ -50,7 +51,7 @@ export default class Router {
|
||||
this.pages[hashPageDogCommandCategories] = { name: 'PageDogCommands', module: PageDogCommandCategories };
|
||||
this.pages[hashPageDogCommands] = { name: 'PageDogCommands', module: PageDogCommands };
|
||||
this.pages[hashPageDogDogCommandLinks] = { name: 'PageDogDogCommandLinks', module: PageDogDogCommandLinks };
|
||||
// this.pages[hashPageDogDogs] = { name: 'PageDogDogs', module: PageDogDogs };
|
||||
this.pages[hashPageDogDogs] = { name: 'PageDogDogs', module: PageDogDogs };
|
||||
this.pages[hashPageDogLocations] = { name: 'PageDogLocations', module: PageDogLocations };
|
||||
this.pages[hashPageDogButtonIcons] = { name: 'PageDogButtonIcons', module: PageDogButtonIcons };
|
||||
this.pages[hashPageDogCommandButtonLinks] = { name: 'PageDogCommandButtonLinks', module: PageDogCommandButtonLinks };
|
||||
@@ -67,6 +68,7 @@ export default class Router {
|
||||
// this.pages[hashPageUserLogout] = { name: 'PageUserLogout', module: PageUserLogout }; // pathModule: './pages/user/logout.js' };
|
||||
this.pages[hashPageUserAccount] = { name: 'PageUser', module: PageUser };
|
||||
this.pages[hashPageUserAccounts] = { name: 'PageUsers', module: PageUsers };
|
||||
this.pages[hashPageUserCompany] = { name: 'PageUserCompany', module: PageUserCompany };
|
||||
// Routes
|
||||
this.routes = {};
|
||||
// Core
|
||||
@@ -80,7 +82,7 @@ export default class Router {
|
||||
this.routes[hashPageDogCommandCategories] = (isPopState = false) => this.navigateToHash(hashPageDogCommandCategories, isPopState);
|
||||
this.routes[hashPageDogCommands] = (isPopState = false) => this.navigateToHash(hashPageDogCommands, isPopState);
|
||||
this.routes[hashPageDogDogCommandLinks] = (isPopState = false) => this.navigateToHash(hashPageDogDogCommandLinks, isPopState);
|
||||
// this.routes[hashPageDogDogs] = (isPopState = false) => this.navigateToHash(hashPageDogDogs, isPopState);
|
||||
this.routes[hashPageDogDogs] = (isPopState = false) => this.navigateToHash(hashPageDogDogs, isPopState);
|
||||
this.routes[hashPageDogLocations] = (isPopState = false) => this.navigateToHash(hashPageDogLocations, isPopState);
|
||||
this.routes[hashPageDogButtonIcons] = (isPopState = false) => this.navigateToHash(hashPageDogButtonIcons, isPopState);
|
||||
this.routes[hashPageDogCommandButtonLinks] = (isPopState = false) => this.navigateToHash(hashPageDogCommandButtonLinks, isPopState);
|
||||
@@ -97,6 +99,7 @@ export default class Router {
|
||||
// this.routes[hashPageUserLogout] = (isPopState = false) => this.navigateToHash(hashPageUserLogout, isPopState);
|
||||
this.routes[hashPageUserAccount] = (isPopState = false) => this.navigateToHash(hashPageUserAccount, isPopState);
|
||||
this.routes[hashPageUserAccounts] = (isPopState = false) => this.navigateToHash(hashPageUserAccounts, isPopState);
|
||||
this.routes[hashPageUserCompany] = (isPopState = false) => this.navigateToHash(hashPageUserCompany, isPopState);
|
||||
this.initialize();
|
||||
}
|
||||
loadPage(hashPage, isPopState = false) {
|
||||
|
||||
45
templates/components/dog/_row_dog.html
Normal file
45
templates/components/dog/_row_dog.html
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
{% if is_blank_row %}
|
||||
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_DOG }}" {{ model.ATTR_ID_DOG }}>
|
||||
<td class="{{ model.FLAG_NAME }}">
|
||||
<input type="text" class="{{ model.FLAG_NAME }}"
|
||||
{{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
<td class="{{ model.FLAG_APPEARANCE }}">
|
||||
<textarea class="{{ model.FLAG_APPEARANCE }}"
|
||||
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
|
||||
></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_MASS_KG }}">
|
||||
<input type="number" min="0" step="0.001" class="{{ model.FLAG_MASS_KG }}"
|
||||
{{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
{% include 'components/dog/_td_notes.html' %}
|
||||
{% set active = True %}
|
||||
{% include 'components/dog/_td_active.html' %}
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr class="{{ model.FLAG_DOG }}" {{ model.ATTR_ID_DOG }}="{{ dog.id_dog }}">
|
||||
<td class="{{ model.FLAG_NAME }}">
|
||||
<input type="text" class="{{ model.FLAG_NAME }}"
|
||||
{{ model.ATTR_VALUE_CURRENT }}="{{ model.format_null_string_as_blank(dog.name)|escape }}"
|
||||
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_null_string_as_blank(dog.name)|escape }}"
|
||||
value="{{ model.format_null_string_as_blank(dog.name) }}" />
|
||||
</td>
|
||||
<td class="{{ model.FLAG_APPEARANCE }}">
|
||||
<textarea class="{{ model.FLAG_APPEARANCE }}"
|
||||
{{ model.ATTR_VALUE_CURRENT }}="{{ model.format_null_string_as_blank(dog.appearance)|escape }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_null_string_as_blank(dog.appearance)|escape }}"
|
||||
>{{ model.format_null_string_as_blank(dog.appearance) }}</textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_MASS_KG }}">
|
||||
<input type="number" min="0" step="0.001" class="{{ model.FLAG_MASS_KG }}"
|
||||
{{ model.ATTR_VALUE_CURRENT }}="{{ dog.mass_kg }}"
|
||||
{{ model.ATTR_VALUE_PREVIOUS }}="{{ dog.mass_kg }}"
|
||||
value="{{ dog.mass_kg }}" />
|
||||
</td>
|
||||
{% set notes = dog.notes %}
|
||||
{% include 'components/dog/_td_notes.html' %}
|
||||
{% set active = dog.active %}
|
||||
{% include 'components/dog/_td_active.html' %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
@@ -30,6 +30,7 @@
|
||||
var attrIdWeather = "{{ model.ATTR_ID_WEATHER }}";
|
||||
var attrIdUser = "{{ model.ATTR_ID_USER }}";
|
||||
var attrIdUserAuth0 = "{{ model.ATTR_ID_USER_AUTH0 }}";
|
||||
var flagAppearance = "{{ model.FLAG_APPEARANCE }}";
|
||||
var flagAssessment = "{{ model.FLAG_ASSESSMENT }}";
|
||||
var flagAssessmentCommandModalityLink = "{{ model.FLAG_ASSESSMENT_COMMAND_MODALITY_LINK }}";
|
||||
var flagAssessmentResponse = "{{ model.FLAG_ASSESSMENT_RESPONSE }}";
|
||||
@@ -53,6 +54,7 @@
|
||||
var flagLightingLevel = "{{ model.FLAG_LIGHTING_LEVEL }}";
|
||||
var flagLocation = "{{ model.FLAG_LOCATION }}";
|
||||
var flagLocationParent = "{{ model.FLAG_LOCATION_PARENT }}";
|
||||
var flagMassKg = "{{ model.FLAG_MASS_KG }}";
|
||||
var flagObedienceLevel = "{{ model.FLAG_OBEDIENCE_LEVEL }}";
|
||||
var flagResponseQualityMetric = "{{ model.FLAG_RESPONSE_QUALITY_METRIC }}";
|
||||
var flagRole = "{{ model.FLAG_ROLE }}";
|
||||
@@ -67,6 +69,8 @@
|
||||
var hashSaveDogCommandButtonLink = "{{ model.HASH_SAVE_DOG_COMMAND_BUTTON_LINK }}";
|
||||
var hashSaveDogCommandCategory = "{{ model.HASH_SAVE_DOG_COMMAND_CATEGORY }}";
|
||||
var hashSaveDogDogCommandLink = "{{ model.HASH_SAVE_DOG_DOG_COMMAND_LINK }}";
|
||||
var hashSaveDogDogs = "{{ model.HASH_SAVE_DOG_DOGS }}";
|
||||
var hashSaveDogLocation = "{{ model.HASH_SAVE_DOG_LOCATION }}";
|
||||
var hashSaveDogUser = "{{ model.HASH_SAVE_DOG_USER }}";
|
||||
var hashSaveUserCompany = "{{ model.HASH_SAVE_USER_COMPANY }}";
|
||||
var hashSaveUserUser = "{{ model.HASH_SAVE_USER_USER }}";
|
||||
</script>
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
var flagNavDogLocations = "{{ model.FLAG_NAV_DOG_LOCATIONS }}";
|
||||
var flagNavUserAccount = "{{ model.FLAG_NAV_USER_ACCOUNT }}";
|
||||
var flagNavUserAccounts = "{{ model.FLAG_NAV_USER_ACCOUNTS }}";
|
||||
var flagNavUserCompany = "{{ model.FLAG_NAV_USER_COMPANY }}";
|
||||
var flagNavUserLogin = "{{ model.FLAG_NAV_USER_LOGIN }}";
|
||||
var flagNavUserLogout = "{{ model.FLAG_NAV_USER_LOGOUT }}";
|
||||
var flagNotes = "{{ model.FLAG_NOTES }}";
|
||||
@@ -146,6 +147,7 @@
|
||||
var hashPagePrivacyPolicy = "{{ model.HASH_PAGE_PRIVACY_POLICY }}";
|
||||
var hashPageUserAccount = "{{ model.HASH_PAGE_USER_ACCOUNT }}";
|
||||
var hashPageUserAccounts = "{{ model.HASH_PAGE_USER_ACCOUNTS }}";
|
||||
var hashPageUserCompany = "{{ model.HASH_PAGE_USER_COMPANY }}";
|
||||
var hashPageUserLogin = "{{ model.HASH_PAGE_USER_LOGIN }}";
|
||||
var hashPageUserLogout = "{{ model.HASH_PAGE_USER_LOGOUT }}";
|
||||
var idButtonApplyFilters = "#{{ model.ID_BUTTON_APPLY_FILTERS }}";
|
||||
|
||||
73
templates/pages/dog/_dogs.html
Normal file
73
templates/pages/dog/_dogs.html
Normal file
@@ -0,0 +1,73 @@
|
||||
{% extends 'layouts/layout_dog.html' %}
|
||||
|
||||
{% block page_body %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/dog_dogs.bundle.css') }}">
|
||||
|
||||
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
|
||||
{{ model.form_filters.hidden_tag() }}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.FLAG_SEARCH }}">
|
||||
{{ model.form_filters.search.label }}
|
||||
{{ model.form_filters.search() }}
|
||||
{% for error in model.form_filters.search.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.FLAG_ACTIVE_ONLY }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.form_filters.active_only.data }}">
|
||||
{{ model.form_filters.active_only.label }}
|
||||
{{ model.form_filters.active_only() }}
|
||||
{% for error in model.form_filters.active_only.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
{% set class_name = model.FLAG_FILTER + ' ' + model.FLAG_ACTIVE_ONLY + ' ' + model.FLAG_CHECKBOX %}
|
||||
{% include 'components/common/buttons/_icon_checkbox.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% set block_id = 'buttons_table_default' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</form>
|
||||
|
||||
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_TABLE_MAIN }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }} {{ model.FLAG_DOG }}">
|
||||
<thead>
|
||||
<tr class="{{ model.FLAG_DOG }}">
|
||||
<th class="{{ model.FLAG_NAME }}">Name</th>
|
||||
<th class="{{ model.FLAG_APPEARANCE }}">Appearance</th>
|
||||
<th class="{{ model.FLAG_MASS_KG }}">Mass (kg)</th>
|
||||
<th class="{{ model.FLAG_NOTES }}">Notes</th>
|
||||
<th class="{{ model.FLAG_ACTIVE }}">
|
||||
{% set class_name = model.FLAG_ACTIVE %}
|
||||
{% set attribute_text = '' %}
|
||||
{% include 'components/common/buttons/_icon_add.html' %}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set is_blank_row = False %}
|
||||
{% for dog in model.dogs %}
|
||||
{% include 'components/dog/_row_dog.html' %}
|
||||
{% endfor %}
|
||||
|
||||
{% set is_blank_row = True %}
|
||||
{% include 'components/dog/_row_dog.html' %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% include 'components/common/temporary/_overlay_confirm.html' %}
|
||||
{% include 'components/common/temporary/_overlay_error.html' %}
|
||||
|
||||
<div id="{{ model.ID_CONTAINER_TEMPLATE_ELEMENTS }}">
|
||||
<!-- Active column -->
|
||||
<!-- Delete -->
|
||||
{% set class_name = '' %}
|
||||
{% include 'components/common/buttons/_icon_trash.html' %}
|
||||
<!-- Undelete -->
|
||||
{% set class_name = model.FLAG_ACTIVE %}
|
||||
{% set attribute_text = '' %}
|
||||
{% include 'components/common/buttons/_icon_add.html' %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -7,17 +7,15 @@
|
||||
|
||||
<div class="{{ model.FLAG_CARD }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<h2 class="home-hero-title">Dog Training!</h2>
|
||||
<!-- <h2 class="home-hero-title">Dog Training!</h2> -->
|
||||
{% if not model.user.get_is_logged_in() %}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a class="{{ model.FLAG_NAV_USER_LOGIN }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Login</a>
|
||||
</div>
|
||||
{% elif True or model.user.can_admin_dog %}
|
||||
{#
|
||||
{% else %}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_DOG_DOGS }}" class="{{ model.FLAG_NAV_DOG_DOGS }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Dogs</a>
|
||||
</div>
|
||||
#}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_DOG_COMMAND_CATEGORIES }}" class="{{ model.FLAG_NAV_DOG_COMMAND_CATEGORIES }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Command Categories</a>
|
||||
</div>
|
||||
@@ -42,26 +40,22 @@
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_DOG_ASSESSMENTS }}" class="{{ model.FLAG_NAV_DOG_ASSESSMENTS }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Assessments</a>
|
||||
</div>
|
||||
{#
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_DOG_DISTRACTIONS }}" class="{{ model.FLAG_NAV_DOG_DISTRACTIONS }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Distractions</a>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_DOG_ASSESSMENT_COMMAND_MODALITY_LINKS }}" class="{{ model.FLAG_NAV_DOG_ASSESSMENT_COMMAND_MODALITY_LINKS }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Assessment Command Modality Links</a>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_DOG_ASSESSMENT_RESPONSES}}" class="{{ model.FLAG_NAV_DOG_ASSESSMENT_RESPONSES }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Assessment Responses</a>
|
||||
</div>
|
||||
#}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_DOG_CALENDAR_ENTRIES }}" class="{{ model.FLAG_NAV_DOG_CALENDAR_ENTRIES }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Overdue Bills</a>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_USER_ACCOUNT }}" class="{{ model.FLAG_NAV_USER_ACCOUNT }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">User Account</a>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_USER_ACCOUNTS }}" class="{{ model.FLAG_NAV_USER_ACCOUNTS }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">User Accounts</a>
|
||||
</div>
|
||||
{% if model.user.can_admin_user %}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_USER_ACCOUNTS }}" class="{{ model.FLAG_NAV_USER_ACCOUNTS }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">User Accounts</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if model.user.can_edit_company %}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<a href="{{ model.HASH_PAGE_USER_COMPANY }}" class="{{ model.FLAG_NAV_USER_COMPANY }} {{ model.FLAG_BUTTON }} {{ model.FLAG_BUTTON_PRIMARY }}">Company</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
84
templates/pages/user/_company.html
Normal file
84
templates/pages/user/_company.html
Normal file
@@ -0,0 +1,84 @@
|
||||
{% extends 'layouts/layout_dog.html' %}
|
||||
|
||||
{% block page_body %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/user_company.bundle.css') }}">
|
||||
|
||||
{% set company = model.companies[0] %}
|
||||
|
||||
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
|
||||
{{ model.form_filters.hidden_tag() }}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.FLAG_SEARCH }}">
|
||||
{{ model.form_filters.search.label }}
|
||||
{{ model.form_filters.search() }}
|
||||
{% for error in model.form_filters.search.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.FLAG_ACTIVE_ONLY }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.form_filters.active_only.data }}">
|
||||
{{ model.form_filters.active_only.label }}
|
||||
{{ model.form_filters.active_only() }}
|
||||
{% for error in model.form_filters.active_only.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
{% set class_name = model.FLAG_FILTER + ' ' + model.FLAG_ACTIVE_ONLY + ' ' + model.FLAG_CHECKBOX %}
|
||||
{% include 'components/common/buttons/_icon_checkbox.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="{{ model.FLAG_SAVE }} {{ model.FLAG_CANCEL }} {{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
|
||||
{% set block_id = 'button_save' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
|
||||
{% set block_id = 'button_cancel' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="{{ model.FLAG_USER }} {{ model.FLAG_CARD }} {{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}" {{ model.ATTR_ID_COMPANY }}="{{ company.id_company }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }}">
|
||||
<label for="{{ model.FLAG_NAME }}">Name</label>
|
||||
<input type="text" id="{{ model.FLAG_NAME }}" name="{{ model.FLAG_NAME }}" value="{{ company.name }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }}">
|
||||
<label for="{{ model.FLAG_WEBSITE }}">Website</label>
|
||||
<textarea id="{{ model.FLAG_WEBSITE }}" name="{{ model.FLAG_WEBSITE }}" rows="4"
|
||||
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_null_string_as_blank(company.website)|escape }}" {{ model.ATTR_VALUE_CURRENT }}="{{ model.format_null_string_as_blank(company.website)|escape }}"
|
||||
>{{ model.format_null_string_as_blank(company.website) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include 'components/common/temporary/_overlay_confirm.html' %}
|
||||
{% include 'components/common/temporary/_overlay_error.html' %}
|
||||
|
||||
<div id="{{ model.ID_CONTAINER_TEMPLATE_ELEMENTS }}">
|
||||
<!-- Active column -->
|
||||
<!-- Delete -->
|
||||
{% set class_name = '' %}
|
||||
{% include 'components/common/buttons/_icon_trash.html' %}
|
||||
<!-- Undelete -->
|
||||
{% set class_name = model.FLAG_ACTIVE %}
|
||||
{% set attribute_text = '' %}
|
||||
{% include 'components/common/buttons/_icon_add.html' %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -37,24 +37,41 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="{{ model.FLAG_SAVE }} {{ model.FLAG_CANCEL }} {{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
|
||||
{% set block_id = 'button_save' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
|
||||
{% set block_id = 'button_cancel' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="{{ model.FLAG_USER }} {{ model.FLAG_CARD }} {{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}" {{ model.ATTR_ID_USER }}="{{ user.id_user }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }}">
|
||||
<label for="{{ model.FLAG_FIRSTNAME }}">Firstname</label>
|
||||
<input type="text" id="{{ model.FLAG_FIRSTNAME }}" name="{{ model.FLAG_FIRSTNAME }}" value="{{ user.firstname }}" />
|
||||
<input type="text" id="{{ model.FLAG_FIRSTNAME }}" name="{{ model.FLAG_FIRSTNAME }}" value="{{ user.firstname|escape }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ user.firstname|escape }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }}">
|
||||
<label for="{{ model.FLAG_SURNAME }}">Surname</label>
|
||||
<input type="text" id="{{ model.FLAG_SURNAME }}" name="{{ model.FLAG_SURNAME }}" value="{{ user.surname }}" />
|
||||
<input type="text" id="{{ model.FLAG_SURNAME }}" name="{{ model.FLAG_SURNAME }}" value="{{ user.surname|escape }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ user.surname|escape }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }}">
|
||||
<label for="{{ model.FLAG_EMAIL }}">Email</label>
|
||||
<input type="email" id="{{ model.FLAG_EMAIL }}" name="{{ model.FLAG_EMAIL }}" value="{{ user.email }}" />
|
||||
<input type="email" id="{{ model.FLAG_EMAIL }}" name="{{ model.FLAG_EMAIL }}" value="{{ user.email|escape }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ user.email|escape }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
@@ -94,14 +111,10 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
{#
|
||||
var assessments = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.assessments) | tojson | safe }};
|
||||
var filterLightingLevels = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_lighting_levels) | tojson | safe }};
|
||||
var filterLocations = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_locations) | tojson | safe }};
|
||||
var filterUserHandlers = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_user_handlers) | tojson | safe }};
|
||||
var filterWeathers = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_weathers) | tojson | safe }};
|
||||
var flagTemperatureCelcius = "{{ model.FLAG_TEMPERATURE_CELCIUS }}";
|
||||
var flagUserHandler = "{{ model.FLAG_USER_HANDLER }}";
|
||||
#}
|
||||
var company = {{ model.user.company.to_json() | tojson | safe }};
|
||||
var flagCanAdminDog = "{{ model.FLAG_CAN_ADMIN_DOG }}";
|
||||
var flagCanAdminUser = "{{ model.FLAG_CAN_ADMIN_USER }}";
|
||||
var flagIsEmailVerified = "{{ model.FLAG_IS_EMAIL_VERIFIED }}";
|
||||
var flagIsSuperUser = "{{ model.FLAG_IS_SUPER_USER }}";
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
2
todo.txt
2
todo.txt
@@ -5,7 +5,7 @@ Fix:
|
||||
- Location save and UI logic for tree structure
|
||||
- Dogs missing from Assessments table?
|
||||
- DB field id_user_created_by must not be null
|
||||
|
||||
- User section - either separate or merge into dog section
|
||||
|
||||
Features:
|
||||
|
||||
|
||||
@@ -125,6 +125,11 @@ module.exports = {
|
||||
path.resolve(__dirname, 'static/css/sections/dog.css'),
|
||||
path.resolve(__dirname, 'static/css/pages/user/users.css')
|
||||
],
|
||||
user_company: [
|
||||
path.resolve(__dirname, 'static/css/sections/dog.css'),
|
||||
path.resolve(__dirname, 'static/css/sections/user.css'),
|
||||
path.resolve(__dirname, 'static/css/pages/user/company.css')
|
||||
],
|
||||
},
|
||||
output: {
|
||||
filename: 'js/[name].bundle.js',
|
||||
|
||||
Reference in New Issue
Block a user