From c019f3ad3e0c149d1460595ffd511e81fddfb527 Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 31 May 2023 11:29:10 +0200 Subject: [PATCH] (ui) integration --- .../components/family-account/child-form.tsx | 167 ++++++++++-------- .../components/family-account/child-item.tsx | 31 ++-- ...ildren-list.tsx => children-dashboard.tsx} | 28 +-- .../components/form/form-file-upload.tsx | 7 +- .../supporting-documents-types-list.tsx | 59 +++---- .../components/user/members-list-item.tsx | 102 +++++++++++ .../components/user/members-list.tsx | 37 ++++ app/frontend/src/javascript/models/member.ts | 47 +++++ app/frontend/src/stylesheets/application.scss | 5 +- .../modules/base/edit-destroy-buttons.scss | 3 + .../stylesheets/modules/base/fab-modal.scss | 1 + .../modules/family-account/child-form.scss | 43 +++++ .../modules/family-account/child-item.scss | 62 ++++++- .../family-account/children-dashboard.scss | 20 +++ .../modules/form/form-file-upload.scss | 2 + .../src/stylesheets/modules/members.scss | 105 +++++++++++ .../supporting-documents-types-list.scss | 35 ++-- .../modules/user/user-validation.scss | 4 + .../templates/admin/members/edit.html | 2 +- .../templates/admin/members/members.html | 47 +---- .../templates/dashboard/children.html | 2 +- app/frontend/templates/events/show.html | 19 +- .../templates/shared/_member_select.html | 9 +- config/locales/app.admin.en.yml | 10 +- config/locales/app.public.en.yml | 18 +- config/locales/app.public.fr.yml | 2 +- config/locales/app.shared.en.yml | 9 +- 27 files changed, 654 insertions(+), 222 deletions(-) rename app/frontend/src/javascript/components/family-account/{children-list.tsx => children-dashboard.tsx} (76%) create mode 100644 app/frontend/src/javascript/components/user/members-list-item.tsx create mode 100644 app/frontend/src/javascript/components/user/members-list.tsx create mode 100644 app/frontend/src/javascript/models/member.ts create mode 100644 app/frontend/src/stylesheets/modules/family-account/child-form.scss create mode 100644 app/frontend/src/stylesheets/modules/family-account/children-dashboard.scss diff --git a/app/frontend/src/javascript/components/family-account/child-form.tsx b/app/frontend/src/javascript/components/family-account/child-form.tsx index 02234f827..bc7ab29c1 100644 --- a/app/frontend/src/javascript/components/family-account/child-form.tsx +++ b/app/frontend/src/javascript/components/family-account/child-form.tsx @@ -10,6 +10,7 @@ import { FileType } from '../../models/file'; import { SupportingDocumentType } from '../../models/supporting-document-type'; import { User } from '../../models/user'; import { SupportingDocumentsRefusalModal } from '../supporting-documents/supporting-documents-refusal-modal'; +import { FabAlert } from '../base/fab-alert'; interface ChildFormProps { child: Child; @@ -65,92 +66,114 @@ export const ChildForm: React.FC = ({ child, onSubmit, supportin return (
{!isPrivileged() && -
- {t('app.public.child_form.child_form_info')} -
+ +

{t('app.public.child_form.child_form_info')}

+
}
- - - moment(value).isAfter(moment().subtract(18, 'year')) }} - formState={formState} - label={t('app.public.child_form.birthday')} - type="date" - max={moment().format('YYYY-MM-DD')} - min={moment().subtract(18, 'year').format('YYYY-MM-DD')} - /> - +
+ + +
+
+ moment(value).isAfter(moment().subtract(18, 'year')) }} + formState={formState} + label={t('app.public.child_form.birthday')} + type="date" + max={moment().format('YYYY-MM-DD')} + min={moment().subtract(18, 'year').format('YYYY-MM-DD')} + /> + +
- {output.supporting_document_files_attributes.map((sf, index) => { - if (isPrivileged()) { + + {!isPrivileged() && <> +

{t('app.public.child_form.supporting_documents')}

+ {output.supporting_document_files_attributes.map((sf, index) => { return ( -
-
{getSupportingDocumentsTypeName(sf.supporting_document_type_id)}
- {sf.attachment_url && ( - - {sf.attachment} - - - )} - {!sf.attachment_url && ( -
{t('app.public.child_form.to_complete')}
- )} -
+ ); - } - return ( - - ); - })} + })} + }
- + {t('app.public.child_form.save')} - {isPrivileged() && -
- {t('app.public.child_form.refuse_documents')} - -
- }
+ + {isPrivileged() && <> +

{t('app.public.child_form.supporting_documents')}

+
+ {output.supporting_document_files_attributes.map((sf, index) => { + return ( +
+ {getSupportingDocumentsTypeName(sf.supporting_document_type_id)} + {sf.attachment_url && ( +
+

{sf.attachment}

+ + + +
+ )} + {!sf.attachment_url && ( +
+

{t('app.public.child_form.to_complete')}

+
+ )} +
+ ); + })} +
+ } + + {isPrivileged() && <> + +

{t('app.public.child_form.refuse_documents_info')}

+
+
+ {t('app.public.child_form.refuse_documents')} + +
+ }
); diff --git a/app/frontend/src/javascript/components/family-account/child-item.tsx b/app/frontend/src/javascript/components/family-account/child-item.tsx index 1f0134808..62de02e9e 100644 --- a/app/frontend/src/javascript/components/family-account/child-item.tsx +++ b/app/frontend/src/javascript/components/family-account/child-item.tsx @@ -5,9 +5,11 @@ import { FabButton } from '../base/fab-button'; import FormatLib from '../../lib/format'; import { DeleteChildModal } from './delete-child-modal'; import ChildAPI from '../../api/child'; +import { PencilSimple, Trash, UserSquare } from 'phosphor-react'; interface ChildItemProps { child: Child; + size: 'sm' | 'lg'; onEdit: (child: Child) => void; onDelete: (error: string) => void; onError: (error: string) => void; @@ -16,7 +18,7 @@ interface ChildItemProps { /** * A child item. */ -export const ChildItem: React.FC = ({ child, onEdit, onDelete, onError }) => { +export const ChildItem: React.FC = ({ child, size, onEdit, onDelete, onError }) => { const { t } = useTranslation('public'); const [isOpenDeleteChildModal, setIsOpenDeleteChildModal] = React.useState(false); @@ -38,22 +40,29 @@ export const ChildItem: React.FC = ({ child, onEdit, onDelete, o }; return ( -
-
+
+
+ +
+
{t('app.public.child_item.last_name')} -
{child.last_name}
+

{child.last_name}

-
+
{t('app.public.child_item.first_name')} -
{child.first_name}
+

{child.first_name}

-
+
{t('app.public.child_item.birthday')} -
{FormatLib.date(child.birthday)}
+

{FormatLib.date(child.birthday)}

-
- } onClick={() => onEdit(child)} className="edit-button" /> - } onClick={toggleDeleteChildModal} className="delete-button" /> +
+ onEdit(child)} className="edit-btn"> + + + + +
diff --git a/app/frontend/src/javascript/components/family-account/children-list.tsx b/app/frontend/src/javascript/components/family-account/children-dashboard.tsx similarity index 76% rename from app/frontend/src/javascript/components/family-account/children-list.tsx rename to app/frontend/src/javascript/components/family-account/children-dashboard.tsx index 875555ddd..30d950068 100644 --- a/app/frontend/src/javascript/components/family-account/children-list.tsx +++ b/app/frontend/src/javascript/components/family-account/children-dashboard.tsx @@ -14,9 +14,10 @@ import SupportingDocumentTypeAPI from '../../api/supporting-document-type'; declare const Application: IApplication; -interface ChildrenListProps { +interface ChildrenDashboardProps { user: User; operator: User; + adminPanel?: boolean; onSuccess: (error: string) => void; onError: (error: string) => void; } @@ -24,7 +25,7 @@ interface ChildrenListProps { /** * A list of children belonging to the current user. */ -export const ChildrenList: React.FC = ({ user, operator, onError, onSuccess }) => { +export const ChildrenDashboard: React.FC = ({ user, operator, adminPanel, onError, onSuccess }) => { const { t } = useTranslation('public'); const [children, setChildren] = useState>([]); @@ -92,19 +93,24 @@ export const ChildrenList: React.FC = ({ user, operator, onEr }; return ( -
+
-

{t('app.public.children_list.heading')}

+ {adminPanel + ?

{t('app.public.children_dashboard.heading')}

+ :

{t('app.public.children_dashboard.member_heading')}

+ } {!isPrivileged() && ( - - {t('app.public.children_list.add_child')} - +
+ + {t('app.public.children_dashboard.add_child')} + +
)}
{children.map(child => ( - + ))}
setIsOpenChildModal(false)} onSuccess={handleSaveChildSuccess} onError={onError} supportingDocumentsTypes={supportingDocumentsTypes} operator={operator} /> @@ -112,12 +118,12 @@ export const ChildrenList: React.FC = ({ user, operator, onEr ); }; -const ChildrenListWrapper: React.FC = (props) => { +const ChildrenDashboardWrapper: React.FC = (props) => { return ( - + ); }; -Application.Components.component('childrenList', react2angular(ChildrenListWrapper, ['user', 'operator', 'onSuccess', 'onError'])); +Application.Components.component('childrenDashboard', react2angular(ChildrenDashboardWrapper, ['user', 'operator', 'adminPanel', 'onSuccess', 'onError'])); diff --git a/app/frontend/src/javascript/components/form/form-file-upload.tsx b/app/frontend/src/javascript/components/form/form-file-upload.tsx index 18d25fbae..22b58a252 100644 --- a/app/frontend/src/javascript/components/form/form-file-upload.tsx +++ b/app/frontend/src/javascript/components/form/form-file-upload.tsx @@ -75,9 +75,10 @@ export const FormFileUpload = ({ id, label, re return (
- {hasFile() && ( - {file.attachment_name} - )} + {hasFile() + ? {file.attachment_name} + : {t('app.shared.form_file_upload.placeholder')} + }
{file?.id && file?.attachment_url && ( {getGroupsNames(poit.group_ids)} {poit.name} -
+
- + - +
@@ -292,38 +293,26 @@ const SupportingDocumentsTypesList: React.FC onSuccess={onDestroySuccess} onError={onError}/> - - - - - - - - - {supportingDocumentsTypes.map(poit => { - return ( - - - - - ); - })} - -
- - {t('app.admin.settings.account.supporting_documents_types_list.name')} - - -
{poit.name} -
- - - - - - -
-
+
+ {supportingDocumentsTypes.map(poit => { + return ( +
+
+

{poit.name}

+
+ + + + + + +
+
+
+ ); + })} +
+ {!hasTypes() && (

diff --git a/app/frontend/src/javascript/components/user/members-list-item.tsx b/app/frontend/src/javascript/components/user/members-list-item.tsx new file mode 100644 index 000000000..19041b4e9 --- /dev/null +++ b/app/frontend/src/javascript/components/user/members-list-item.tsx @@ -0,0 +1,102 @@ +import React, { useEffect, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { Member } from '../../models/member'; +import { Child } from '../../models/child'; +import ChildAPI from '../../api/child'; +import { FabButton } from '../base/fab-button'; +import { CaretDown, User, Users } from 'phosphor-react'; +import { ChildItem } from '../family-account/child-item'; +import { EditDestroyButtons } from '../base/edit-destroy-buttons'; + +interface MembersListItemProps { + member: Member, + onError: (message: string) => void, + onSuccess: (message: string) => void +} + +/** + * Members list + */ +export const MembersListItem: React.FC = ({ member, onError, onSuccess }) => { + const { t } = useTranslation('admin'); + + const [children, setChildren] = useState>([]); + const [childrenList, setChildrenList] = useState(false); + + useEffect(() => { + ChildAPI.index({ user_id: member.id }).then(setChildren); + }, [member]); + + /** + * Redirect to the given user edition page + */ + const toMemberEdit = (memberId: number): void => { + window.location.href = `/#!/admin/members/${memberId}/edit`; + }; + + return ( +

+
+
+ {(children.length > 0) + ? + : + } +
+ {(children.length > 0) && + setChildrenList(!childrenList)} className={`toggle ${childrenList ? 'open' : ''}`}> + + + } +
+ +
+
+
+ {t('app.admin.members_list_item.surname')} +

{member.profile.last_name}

+
+
+ {t('app.admin.members_list_item.first_name')} +

{member.profile.first_name}

+
+
+ {t('app.admin.members_list_item.phone')} +

{member.profile.phone || '---'}

+
+
+ {t('app.admin.members_list_item.email')} +

{member.email}

+
+
+ {t('app.admin.members_list_item.group')} +

{member.group.name}

+
+
+ {t('app.admin.members_list_item.subscription')} +

{member.subscribed_plan?.name || '---'}

+
+
+ +
+ {/* TODO: */} + toMemberEdit(member.id)} + onDeleteSuccess={() => onSuccess} + itemId={member.id} + itemType={t('app.admin.members_list_item.item_type')} + destroy={() => new Promise(() => console.log(`Delete member ${member.id}`))} /> +
+
+ + { (children.length > 0) && +
+
+ {children.map(child => ( + console.log('edit child')} onDelete={() => console.log('delete child')} onError={onError} /> + ))} +
+ } +
+ ); +}; diff --git a/app/frontend/src/javascript/components/user/members-list.tsx b/app/frontend/src/javascript/components/user/members-list.tsx new file mode 100644 index 000000000..939db4632 --- /dev/null +++ b/app/frontend/src/javascript/components/user/members-list.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { IApplication } from '../../models/application'; +import { Loader } from '../base/loader'; +import { react2angular } from 'react2angular'; +import { Member } from '../../models/member'; +import { MembersListItem } from './members-list-item'; + +declare const Application: IApplication; + +interface MembersListProps { + members: Member[], + onError: (message: string) => void, + onSuccess: (message: string) => void +} + +/** + * Members list + */ +export const MembersList: React.FC = ({ members, onError, onSuccess }) => { + return ( +
+ {members.map(member => ( + + ))} +
+ ); +}; + +const MembersListWrapper: React.FC = (props) => { + return ( + + + + ); +}; + +Application.Components.component('membersList', react2angular(MembersListWrapper, ['members', 'onError', 'onSuccess'])); diff --git a/app/frontend/src/javascript/models/member.ts b/app/frontend/src/javascript/models/member.ts new file mode 100644 index 000000000..b163c3814 --- /dev/null +++ b/app/frontend/src/javascript/models/member.ts @@ -0,0 +1,47 @@ +import { TDateISO } from '../typings/date-iso'; + +export interface Member { + maxMembers: number + id: number + username: string + email: string + profile: { + first_name: string + last_name: string + phone: string + } + need_completion?: boolean + group: { + name: string + } + subscribed_plan?: Plan + validated_at: TDateISO +} + +interface Plan { + id: number + base_name: string + name: string + amount: number + interval: string + interval_count: number + training_credit_nb: number + training_credits: [ + { + training_id: number + }, + { + training_id: number + } + ] + machine_credits: [ + { + machine_id: number + hours: number + }, + { + machine_id: number + hours: number + } + ] +} diff --git a/app/frontend/src/stylesheets/application.scss b/app/frontend/src/stylesheets/application.scss index e9416affb..cf9ff38aa 100644 --- a/app/frontend/src/stylesheets/application.scss +++ b/app/frontend/src/stylesheets/application.scss @@ -52,6 +52,9 @@ @import "modules/events/event-form"; @import "modules/events/update-recurrent-modal"; @import "modules/events/events-settings.scss"; +@import "modules/family-account/child-form"; +@import "modules/family-account/child-item"; +@import "modules/family-account/children-dashboard"; @import "modules/form/abstract-form-item"; @import "modules/form/form-input"; @import "modules/form/form-multi-file-upload"; @@ -181,8 +184,6 @@ @import "modules/tour"; @import "modules/wallet-info"; -@import "modules/family-account/child-item"; - @import "app.responsive"; @import "overrides"; diff --git a/app/frontend/src/stylesheets/modules/base/edit-destroy-buttons.scss b/app/frontend/src/stylesheets/modules/base/edit-destroy-buttons.scss index 6adaece60..2fa61210a 100644 --- a/app/frontend/src/stylesheets/modules/base/edit-destroy-buttons.scss +++ b/app/frontend/src/stylesheets/modules/base/edit-destroy-buttons.scss @@ -1,6 +1,9 @@ .edit-destroy-buttons { + width: fit-content; + flex-shrink: 0; border-radius: var(--border-radius-sm); overflow: hidden; + button { @include btn; border-radius: 0; diff --git a/app/frontend/src/stylesheets/modules/base/fab-modal.scss b/app/frontend/src/stylesheets/modules/base/fab-modal.scss index fb34b42c8..777b29999 100644 --- a/app/frontend/src/stylesheets/modules/base/fab-modal.scss +++ b/app/frontend/src/stylesheets/modules/base/fab-modal.scss @@ -30,6 +30,7 @@ animation: 0.3s ease-out slideInFromTop; position: relative; top: 90px; + max-width: 100vw; margin: auto; opacity: 1; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); diff --git a/app/frontend/src/stylesheets/modules/family-account/child-form.scss b/app/frontend/src/stylesheets/modules/family-account/child-form.scss new file mode 100644 index 000000000..b1ed219d4 --- /dev/null +++ b/app/frontend/src/stylesheets/modules/family-account/child-form.scss @@ -0,0 +1,43 @@ +.child-form { + .grp { + display: flex; + flex-direction: column; + @media (min-width: 640px) {flex-direction: row; } + + .form-item:first-child { margin-right: 2.4rem; } + } + + hr { width: 100%; } + .actions { + align-self: flex-end; + } + + .document-list { + margin-bottom: 1.6rem; + display: flex; + flex-direction: column; + gap: 1.6rem; + + &-item { + display: flex; + flex-direction: column; + gap: 0.8rem; + .type { + @include text-sm; + } + .file, + .missing { + padding: 0.8rem 0.8rem 0.8rem 1.6rem; + display: flex; + justify-content: space-between; + align-items: center; + border: 1px solid var(--gray-soft-dark); + border-radius: var(--border-radius); + p { margin: 0; } + } + .missing { + background-color: var(--gray-soft-light); + } + } + } +} \ No newline at end of file diff --git a/app/frontend/src/stylesheets/modules/family-account/child-item.scss b/app/frontend/src/stylesheets/modules/family-account/child-item.scss index 40706e12b..f505a73bd 100644 --- a/app/frontend/src/stylesheets/modules/family-account/child-item.scss +++ b/app/frontend/src/stylesheets/modules/family-account/child-item.scss @@ -1,12 +1,62 @@ .child-item { width: 100%; display: grid; - grid-template-rows: repeat(3, min-content); - grid-template-columns: 1fr 1fr; + grid-template-columns: min-content 1fr; + align-items: flex-start; gap: 1.6rem 2.4rem; - align-items: center; - padding: 1.6rem; - border: 1px solid var(--gray-soft-dark); - border-radius: var(--border-radius); background-color: var(--gray-soft-lightest); + &.lg { + padding: 1.6rem; + border: 1px solid var(--gray-soft-dark); + border-radius: var(--border-radius); + } + &.sm { + .actions button { + height: 3rem !important; + min-height: auto; + } + } + + & > div:not(.actions) { + display: flex; + flex-direction: column; + span { + @include text-xs; + color: var(--gray-hard-light); + } + } + p { + margin: 0; + @include text-base(600); + } + &.sm p { + @include text-sm(500); + } + + .status { + grid-row: 1/5; + align-self: stretch; + display: flex; + align-items: center; + } + &.is-validated .status svg { + color: var(--success-dark); + } + + .actions { + align-self: center; + justify-self: flex-end; + } + + @media (min-width: 768px) { + grid-template-columns: min-content repeat(3, 1fr); + .status { grid-row: auto; } + .actions { + grid-column-end: -1; + display: flex; + } + } + @media (min-width: 1024px) { + grid-template-columns: min-content repeat(3, 1fr) max-content; + } } diff --git a/app/frontend/src/stylesheets/modules/family-account/children-dashboard.scss b/app/frontend/src/stylesheets/modules/family-account/children-dashboard.scss new file mode 100644 index 000000000..bed5aae61 --- /dev/null +++ b/app/frontend/src/stylesheets/modules/family-account/children-dashboard.scss @@ -0,0 +1,20 @@ +.children-dashboard { + max-width: 1600px; + margin: 0 auto; + padding-bottom: 6rem; + @include grid-col(12); + gap: 3.2rem; + align-items: flex-start; + + header { + @include header(); + padding-bottom: 0; + grid-column: 2 / -2; + } + .children-list { + grid-column: 2 / -2; + display: flex; + flex-direction: column; + gap: 1.6rem; + } +} \ No newline at end of file diff --git a/app/frontend/src/stylesheets/modules/form/form-file-upload.scss b/app/frontend/src/stylesheets/modules/form/form-file-upload.scss index 5707bbc45..b1bad6758 100644 --- a/app/frontend/src/stylesheets/modules/form/form-file-upload.scss +++ b/app/frontend/src/stylesheets/modules/form/form-file-upload.scss @@ -13,6 +13,8 @@ margin-bottom: 1.6rem; } + .placeholder { color: var(--gray-soft-darkest); } + .actions { margin-left: auto; display: flex; diff --git a/app/frontend/src/stylesheets/modules/members.scss b/app/frontend/src/stylesheets/modules/members.scss index 34a9209f9..dc30f4c6f 100644 --- a/app/frontend/src/stylesheets/modules/members.scss +++ b/app/frontend/src/stylesheets/modules/members.scss @@ -1,4 +1,109 @@ .promote-member img { width: 16px; height: 21px; +} + +.members-list { + width: 100%; + margin: 2.4rem 0; + display: flex; + flex-direction: column; + gap: 2.4rem; + + &-item { + width: 100%; + padding: 1.6rem; + display: grid; + grid-template-columns: 48px 1fr; + gap: 1.6rem 2.4rem; + border: 1px solid var(--gray-soft-dark); + border-radius: var(--border-radius); + background-color: var(--gray-soft-lightest); + &.is-validated .left-col .status svg { color: var(--success-dark); } + &.is-incomplet .left-col .status svg { color: var(--alert); } + + .left-col { + grid-row: span 2; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + .status { + display: flex; + align-items: center; + } + + .toggle { + height: fit-content; + background-color: var(--gray-soft); + border: none; + svg { transition: transform 0.5s ease-in-out; } + &.open svg { transform: rotate(-180deg); } + } + } + + .member { + display: flex; + flex-direction: column; + gap: 2.4rem; + &-infos { + flex: 1; + display: grid; + gap: 1.6rem; + + & > div:not(.actions) { + display: flex; + flex-direction: column; + span { + @include text-xs; + color: var(--gray-hard-light); + } + } + p { + margin: 0; + @include text-base(600); + line-height: 1.5; + } + + } + &-actions { + align-self: flex-end; + } + } + + .member-children { + max-height: 0; + display: flex; + flex-direction: column; + gap: 1.6rem; + overflow-y: hidden; + transition: max-height 0.5s ease-in-out; + &.open { + max-height: 17rem; + overflow-y: auto; + } + + hr { margin: 0; } + .child-item:last-of-type { padding-bottom: 0; } + } + + @media (min-width: 768px) { + .member-infos { + grid-template-columns: repeat(2, 1fr); + } + } + @media (min-width: 1024px) { + .member { + flex-direction: row; + &-actions { + align-self: center; + } + } + } + @media (min-width: 1220px) { + .member-infos { + grid-template-columns: repeat(3, 1fr); + } + } + } } \ No newline at end of file diff --git a/app/frontend/src/stylesheets/modules/supporting-documents/supporting-documents-types-list.scss b/app/frontend/src/stylesheets/modules/supporting-documents/supporting-documents-types-list.scss index b9fca3534..2448c0dc3 100644 --- a/app/frontend/src/stylesheets/modules/supporting-documents/supporting-documents-types-list.scss +++ b/app/frontend/src/stylesheets/modules/supporting-documents/supporting-documents-types-list.scss @@ -37,6 +37,7 @@ } .title { + margin-bottom: 1.6rem; display: flex; flex-direction: row; justify-content: space-between; @@ -54,22 +55,26 @@ } } - table { - thead > tr { - th.group-name, - th.name { - width: 40% - } - th.actions { - width: 20%; - } - } + .document-list { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(min-content, 50rem)); + gap: 1.6rem; - tbody { - .buttons { - .edit-btn { - margin-right: 5px; - } + &-item { + display: flex; + flex-direction: column; + gap: 0.8rem; + .type { + @include text-sm; + } + .file { + padding: 0.8rem 0.8rem 0.8rem 1.6rem; + display: flex; + justify-content: space-between; + align-items: center; + border: 1px solid var(--gray-soft-dark); + border-radius: var(--border-radius); + p { margin: 0; } } } } diff --git a/app/frontend/src/stylesheets/modules/user/user-validation.scss b/app/frontend/src/stylesheets/modules/user/user-validation.scss index 2c160f181..3c9e1b2b6 100644 --- a/app/frontend/src/stylesheets/modules/user/user-validation.scss +++ b/app/frontend/src/stylesheets/modules/user/user-validation.scss @@ -9,3 +9,7 @@ vertical-align: middle; } } +.child-validation { + margin: 0 0 2rem; + text-align: center; +} \ No newline at end of file diff --git a/app/frontend/templates/admin/members/edit.html b/app/frontend/templates/admin/members/edit.html index 8dbbffcdb..752bffe3a 100644 --- a/app/frontend/templates/admin/members/edit.html +++ b/app/frontend/templates/admin/members/edit.html @@ -63,7 +63,7 @@ - + diff --git a/app/frontend/templates/admin/members/members.html b/app/frontend/templates/admin/members/members.html index b0be69229..36d1e43a5 100644 --- a/app/frontend/templates/admin/members/members.html +++ b/app/frontend/templates/admin/members/members.html @@ -17,11 +17,12 @@
+
- -
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ 'app.admin.members.username' | translate }} {{ 'app.admin.members.surname' | translate }} {{ 'app.admin.members.first_name' | translate }}
- - {{ m.username }}{{ m.profile.last_name }}{{ m.profile.first_name }} -
- - - {{ 'app.shared.user_admin.incomplete_profile' }} -
-
+ +
diff --git a/app/frontend/templates/dashboard/children.html b/app/frontend/templates/dashboard/children.html index 9f81ef21c..022cfa3a0 100644 --- a/app/frontend/templates/dashboard/children.html +++ b/app/frontend/templates/dashboard/children.html @@ -7,5 +7,5 @@
- +
diff --git a/app/frontend/templates/events/show.html b/app/frontend/templates/events/show.html index 0b4aeb048..cf44f2333 100644 --- a/app/frontend/templates/events/show.html +++ b/app/frontend/templates/events/show.html @@ -49,7 +49,7 @@
-
+
{{event.event_files_attributes.length}}

{{ 'app.public.events_show.downloadable_documents' }}

@@ -72,8 +72,11 @@
+
+ {{ 'app.public.events_show.event_type.nominative' }} + {{ 'app.public.events_show.event_type.family' }} +
-
{{event.category.name}}
{{theme.name}} @@ -136,17 +139,17 @@ class="form-control"> - -

+ + {{ 'app.shared.cart.child_validation_required_alert' }} -

+
- -

+ + {{ 'app.shared.cart.child_birthday_must_be_under_18_years_ago_alert' }} -

+
diff --git a/app/frontend/templates/shared/_member_select.html b/app/frontend/templates/shared/_member_select.html index b508c96fe..730f5de4a 100644 --- a/app/frontend/templates/shared/_member_select.html +++ b/app/frontend/templates/shared/_member_select.html @@ -12,8 +12,11 @@ {{member}} -
- {{ 'app.shared.member_select.member_not_validated' }} -
+ + + + {{ 'app.shared.member_select.member_not_validated' }} + +
diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index d949f3c57..7a9adb526 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -1189,6 +1189,14 @@ en: member_filter_all: "All" member_filter_not_confirmed: "Unconfirmed" member_filter_inactive_for_3_years: "Inactive for 3 years" + members_list_item: + item_type: "member" + surname: "Surname" + first_name: "First name" + phone: "Phone" + email: "Email" + group: "Group" + subscription: "Subscription" #add a member members_new: add_a_member: "Add a member" @@ -1885,7 +1893,7 @@ en: no_groups_info: "Supporting documents are necessarily applied to groups.
If you do not have any group yet, you can create one from the \"Users/Groups\" page (button on the right)." create_groups: "Create groups" supporting_documents_type_title: "Supporting documents requests" - add_type: "New supporting documents request" + add_type: "Add new document" group_name: "Group" name: "Supporting documents" no_types: "You do not have any supporting documents requests.
Make sure you have created at least one group in order to add a request." diff --git a/config/locales/app.public.en.yml b/config/locales/app.public.en.yml index a7255728f..8ac4efcbe 100644 --- a/config/locales/app.public.en.yml +++ b/config/locales/app.public.en.yml @@ -312,6 +312,9 @@ en: event_description: "Event description" downloadable_documents: "Downloadable documents" information_and_booking: "Information and booking" + event_type: + family: "Family event" + nominative: "Nominative event" dates: "Dates" beginning: "Beginning:" ending: "Ending:" @@ -477,25 +480,28 @@ en: member_select: select_a_member: "Select a member" start_typing: "Start typing..." - children_list: - heading: "My children" + children_dashboard: + heading: "Children" + member_heading: "My Children" add_child: "Add a child" child_modal: edit_child: "Edit child" new_child: "New child" child_form: - child_form_info: "Note that you can only add your children under 18 years old. Supporting documents are requested by your administrator, they will be useful to validate your child's account and authorize the reservation of events." + child_form_info: "Please note that you can only add a child under the age of 18. Supporting documents are requested by your administrator, they will be useful to validate your child's account and authorize the reservation of events." first_name: "First name" last_name: "Last name" birthday: "Birthday" email: "Email" phone: "Phone" save: "Save" + supporting_documents: "Supporting documents" to_complete: "To complete" - refuse_documents: "Refusing the documents" + refuse_documents_info: "You can refuse a selection of documents by clicking on the following button." + refuse_documents: "Refuse documents" child_item: - first_name: "First name of the child" - last_name: "Last name of the child" + first_name: "Child first name" + last_name: "Child last name" birthday: "Birthday" deleted: "The child has been deleted." unable_to_delete: "Unable to delete the child." diff --git a/config/locales/app.public.fr.yml b/config/locales/app.public.fr.yml index 5108e4388..872c5c3b6 100644 --- a/config/locales/app.public.fr.yml +++ b/config/locales/app.public.fr.yml @@ -477,7 +477,7 @@ fr: member_select: select_a_member: "Sélectionnez un membre" start_typing: "Commencez à écrire..." - children_list: + children_dashboard: heading: "Mes enfants" add_child: "Ajouter un enfant" child_modal: diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml index 0d08f0d8a..89d498897 100644 --- a/config/locales/app.shared.en.yml +++ b/config/locales/app.shared.en.yml @@ -165,7 +165,7 @@ en: member_select: select_a_member: "Select a member" start_typing: "Start typing..." - member_not_validated: "Warning:
The member was not validated." + member_not_validated: "This member has not yet been validated." #payment modal abstract_payment_modal: online_payment: "Online payment" @@ -368,9 +368,9 @@ en: slot_tags: "Slot tags" user_tags: "User tags" no_tags: "No tags" - user_validation_required_alert: "Warning!
Your administrator must validate your account. Then, you'll then be able to access all the booking features." - child_validation_required_alert: "Warning!
Your administrator must validate your child account. Then, you'll then be able to book the event." - child_birthday_must_be_under_18_years_ago_alert: "Warning!
Your child must be under 18 years ago. Then, you'll then be able to book the event." + user_validation_required_alert: "Your administrator must validate your account. Then, you'll then be able to access all the booking features." + child_validation_required_alert: "Your administrator must validate your child account. Then, you'll then be able to book the event." + child_birthday_must_be_under_18_years_ago_alert: "Your child must be under 18. Then, you'll then be able to book the event." # feature-tour modal tour: previous: "Previous" @@ -443,6 +443,7 @@ en: select_all: "Select all" unselect_all: "Unselect all" form_file_upload: + placeholder: "Add a file" browse: "Browse" edit: "Edit" form_image_upload: