Exemplo n.º 1
0
def ChangeUserPasswordCard(username):
    return dbc.Card([
        dbc.CardBody([
            html.H3("Change %s's password" % username, className="card-text", style={'text-align': "center"}),
            html.Hr(),
            html.Br(),
            components.PasswordInput(id='old-password-input', addon='Old', placeholder='password'),
            components.PasswordInput(id='new-password-input', addon='New', placeholder='password'),
            html.Br(),
            dbc.Spinner(html.Div(id='success-change-password-alert-div')),
            html.Br(),
            dbc.Button("Change", color="primary", block=True, id='user-change-password-button'),
            html.Br(),
        ])
    ])
Exemplo n.º 2
0
def RecoveryPortalCard():
    return dbc.Card([
        dbc.CardHeader(dbc.Col(html.H1('ConPlot', style={'font-size': '7vh', 'text-align': 'center'}))),
        dbc.CardBody([
            html.H3('Account recovery portal', className="card-text", style={'text-align': "center"}),
            html.Hr(),
            html.Br(),
            dbc.Spinner(html.Div([
                components.UserNameInput('recovery-portal-username-input'),
                components.EmailInput('recovery-portal-email-input', show_tooltip=False),
                components.VerificationCodeInput(id='recovery-portal-secret-input'),
                components.PasswordInput(id='recovery-portal-password-1-input', addon='New Password'),
                components.PasswordInput(id='recovery-portal-password-2-input', addon='Repeat Password'),
                html.Br(),
                html.Div(id='recovery-portal-modal-div'),
                dbc.Button("Recover", color="primary", block=True, id='recover-account-button')
            ], id='recovery-portal-div')),
            html.Br(),
        ])
    ])
Exemplo n.º 3
0
def UserPortalCardBody(username):
    if username is not None:
        return [
            html.H6('You are currently logged in as %s. Do you want to logout?' % username,
                    style={'text-align': "center"}),
            html.Div([
                components.UserNameInput('login-username-input'),
                components.PasswordInput('login-password-input'),
                components.InvalidLoginCollapse(id='user-portal-invalid-login-collapse'),
            ], id='place-holder-user-portal', style={'display': 'none'}),
            html.Br(),
            dbc.Button("Logout", color="primary", block=True, id={'type': 'user-portal-button', 'idx': 'logout'}),
        ]
    else:
        return [
            components.UserNameInput('login-username-input'),
            components.PasswordInput('login-password-input'),
            components.InvalidLoginCollapse(id='user-portal-invalid-login-collapse'),
            html.Br(),
            dbc.Button("Login", color="primary", block=True, id={'type': 'user-portal-button', 'idx': 'login'})
        ]
Exemplo n.º 4
0
def UserLoginCard():
    return dbc.Card([
        dbc.CardBody([
            html.H3('User login', className="card-text", style={'text-align': "center", 'color': 'red'}),
            html.Hr(),
            html.H5('You must login before accessing the members only area',
                    style={'text-align': "center", 'color': 'red'}),
            html.Br(),
            components.UserNameInput(),
            components.PasswordInput(),
            components.InvalidLoginCollapse(),
            html.Br(),
            dbc.Spinner(html.Div(id='success-login-alert-div')),
            html.Br(),
            dbc.Button("Login", color="primary", block=True, id='require-user-login-button'),
            html.Br(),
        ])
    ])
Exemplo n.º 5
0
def CreateUserCard():
    return dbc.Card([
        dbc.CardBody([
            html.Div(id='create-user-modal-div'),
            html.H3('Create a new user', className="card-text", style={'text-align': "center"}),
            html.Hr(),
            html.Br(),
            components.UserNameInput('create-username-input'),
            components.PasswordInput('create-password-input'),
            components.EmailInput('create-email-input'),
            components.InvalidNewUserCollapse(),
            html.Br(),
            components.GdprAgreementCheckbox(),
            html.Br(),
            dbc.Button([
                dbc.Spinner(html.Div("Create new user", id='create-user-button-div'), size='sm')
            ], color="primary", block=True, id='create-user-button', disabled=True)
        ]),
    ])