Client - minor style change

This commit is contained in:
Sam 2020-05-02 19:32:38 +02:00
parent ba9290bcd8
commit e28d609013
12 changed files with 179 additions and 158 deletions

View File

@ -1,6 +1,5 @@
import React from 'react' import React from 'react'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { Helmet } from 'react-helmet'
import Message from '../Common/Message' import Message from '../Common/Message'
import { updateAppConfig } from '../../actions/application' import { updateAppConfig } from '../../actions/application'
@ -56,16 +55,15 @@ class AdminApplication extends React.Component {
const { formData, isInEdition } = this.state const { formData, isInEdition } = this.state
return ( return (
<div> <div>
<Helmet>
FitTrackee - {t('administration:Application configuration')}
</Helmet>
{message && <Message message={message} t={t} />} {message && <Message message={message} t={t} />}
{Object.keys(formData).length > 0 && ( {Object.keys(formData).length > 0 && (
<div className="row"> <div className="row">
<div className="col-md-12"> <div className="col-md-12">
<div className="card"> <div className="card">
<div className="card-header"> <div className="card-header">
<strong>
{t('administration:Application configuration')} {t('administration:Application configuration')}
</strong>
</div> </div>
<div className="card-body"> <div className="card-body">
<form <form

View File

@ -1,18 +1,15 @@
import React from 'react' import React from 'react'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { Helmet } from 'react-helmet'
import AdminStats from './AdminStats' import AdminStats from './AdminStats'
export default function AdminDashboard(props) { export default function AdminDashboard(props) {
const { t } = props const { t } = props
return ( return (
<>
<Helmet>
<title>{t('administration:FitTrackee administration')}</title>
</Helmet>
<div className="card activity-card"> <div className="card activity-card">
<div className="card-header">{t('administration:Administration')}</div> <div className="card-header">
<strong>{t('administration:Administration')}</strong>
</div>
<div className="card-body"> <div className="card-body">
<AdminStats /> <AdminStats />
<br /> <br />
@ -62,6 +59,5 @@ export default function AdminDashboard(props) {
</dl> </dl>
</div> </div>
</div> </div>
</>
) )
} }

View File

@ -1,6 +1,5 @@
import React from 'react' import React from 'react'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { Helmet } from 'react-helmet'
import Message from '../Common/Message' import Message from '../Common/Message'
import { getOrUpdateData } from '../../actions' import { getOrUpdateData } from '../../actions'
@ -15,14 +14,13 @@ class AdminSports extends React.Component {
const { message, sports, t, updateSport } = this.props const { message, sports, t, updateSport } = this.props
return ( return (
<div> <div>
<Helmet>
<title>FitTrackee - {t('administration:Administration')}</title>
</Helmet>
{message && <Message message={message} t={t} />} {message && <Message message={message} t={t} />}
<div className="row"> <div className="row">
<div className="col"> <div className="col">
<div className="card"> <div className="card">
<div className="card-header">{t('administration:Sports')}</div> <div className="card-header">
<strong>{t('administration:Sports')}</strong>
</div>
<div className="card-body"> <div className="card-body">
{sports.length > 0 && ( {sports.length > 0 && (
<table className="table"> <table className="table">

View File

@ -1,7 +1,6 @@
import { format } from 'date-fns' import { format } from 'date-fns'
import React from 'react' import React from 'react'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { Helmet } from 'react-helmet'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import Message from '../Common/Message' import Message from '../Common/Message'
@ -70,15 +69,14 @@ class AdminUsers extends React.Component {
const translatedSortOrders = translateValues(t, sortOrders) const translatedSortOrders = translateValues(t, sortOrders)
return ( return (
<div> <div>
<Helmet>
<title>FitTrackee - {t('administration:Administration')}</title>
</Helmet>
{message && <Message message={message} t={t} />} {message && <Message message={message} t={t} />}
<div className="container"> <div className="container">
<div className="row"> <div className="row">
<div className="col"> <div className="col">
<div className="card"> <div className="card">
<div className="card-header">{t('administration:Users')}</div> <div className="card-header">
<strong>{t('administration:Users')}</strong>
</div>
<div className="card-body"> <div className="card-body">
<div className="row user-filters"> <div className="row user-filters">
<div className="col-lg-4 col-md-6 col-sm-12"> <div className="col-lg-4 col-md-6 col-sm-12">

View File

@ -428,7 +428,7 @@ label {
} }
.no-picture { .no-picture {
color: #40578a; color: #405976;
} }
.page-title { .page-title {
@ -524,11 +524,33 @@ label {
.user-filters { .user-filters {
font-size: 0.9em; font-size: 0.9em;
margin-bottom: 5px; margin-bottom: 10px;
} }
.user-label {
font-weight: bold;
}
.weather-img {
max-width: 35px;
max-height: 35px;
}
.weather-img-small {
max-width: 20px;
max-height: 20px;
}
.weather-table {
margin-bottom: 0;
}
.weather-table table, .weather-table th, .weather-table td{
font-size: 0.9em;
padding: 0.1em;
}
/* responsive table */
/* adapted from https://uglyduck.ca/making-tables-responsive-with-minimal-css/ */ /* adapted from https://uglyduck.ca/making-tables-responsive-with-minimal-css/ */
.heading-span { .heading-span {
background: #eee; background: #eee;
@ -569,29 +591,6 @@ label {
} }
} }
.weather-img {
max-width: 35px;
max-height: 35px;
}
.weather-img-small {
max-width: 20px;
max-height: 20px;
}
.weather-table {
margin-bottom: 0;
}
.weather-table table, .weather-table th, .weather-table td{
font-size: 0.9em;
padding: 0.1em;
}
.user-table {
font-size: 0.9em;
}
/* calendar */ /* calendar */
:root { :root {
--main-color: #1a8fff; --main-color: #1a8fff;

View File

@ -49,6 +49,7 @@ class DashBoard extends React.Component {
<Message message={message} t={t} /> <Message message={message} t={t} />
) : ( ) : (
activities && activities &&
user.total_duration &&
sports.length > 0 && ( sports.length > 0 && (
<div className="container dashboard"> <div className="container dashboard">
<UserStatistics user={user} t={t} /> <UserStatistics user={user} t={t} />

View File

@ -117,14 +117,20 @@ class NavBar extends React.PureComponent {
</Link> </Link>
</li> </li>
)} )}
{picture === true && ( {isAuthenticated && (
<>
{picture === true ? (
<img <img
alt="Avatar" alt="Avatar"
src={`${apiUrl}users/${username}/picture?${Date.now()}`} src={`${apiUrl}users/${username}/picture?${Date.now()}`}
className="img-fluid App-nav-profile-img" className="img-fluid App-nav-profile-img"
/> />
) : (
<i
className="fa fa-user-circle-o fa-2x no-picture"
aria-hidden="true"
/>
)} )}
{isAuthenticated && (
<li className="nav-item"> <li className="nav-item">
<Link <Link
className="nav-link" className="nav-link"
@ -135,8 +141,6 @@ class NavBar extends React.PureComponent {
{username} {username}
</Link> </Link>
</li> </li>
)}
{isAuthenticated && (
<li className="nav-item"> <li className="nav-item">
<Link <Link
className="nav-link" className="nav-link"
@ -147,6 +151,7 @@ class NavBar extends React.PureComponent {
{t('common:Logout')} {t('common:Logout')}
</Link> </Link>
</li> </li>
</>
)} )}
<li><LanguageDropdown /></li> <li><LanguageDropdown /></li>
</ul> </ul>

View File

@ -3,7 +3,6 @@ import React from 'react'
import { Helmet } from 'react-helmet' import { Helmet } from 'react-helmet'
import { withTranslation } from 'react-i18next' import { withTranslation } from 'react-i18next'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import Message from '../Common/Message' import Message from '../Common/Message'
import { deletePicture, uploadPicture } from '../../actions/user' import { deletePicture, uploadPicture } from '../../actions/user'
@ -40,57 +39,64 @@ function ProfileDetail({
<div className="col-md-12"> <div className="col-md-12">
<div className="card"> <div className="card">
<div className="card-header userName"> <div className="card-header userName">
{user.username}{' '} <strong>{user.username}</strong>
{editable && (
<Link
to={{
pathname: '/profile/edit',
}}
>
<i className="fa fa-pencil-square-o" aria-hidden="true" />
</Link>
)}{' '}
{isDeletable && (
<i
className="fa fa-user-times fa-as-link"
aria-hidden="true"
onClick={() => displayModal(true)}
/>
)}
</div> </div>
<div className="card-body"> <div className="card-body">
<div className="row"> <div className="row">
<div className="col-md-8"> <div className="col-md-8">
<p> <p>
{t('user:Email')}: {user.email} {/* eslint-disable-next-line max-len */}
<span className="user-label">
{t('user:Email')}
</span>: {user.email}
</p> </p>
<p> <p>
{t('user:Registration Date')}: {createdAt} <span className="user-label">
{t('user:Registration Date')}
</span>
: {createdAt}
</p> </p>
<p> <p>
{t('user:First Name')}: {user.first_name} <span className="user-label">{t('user:First Name')}</span>
: {user.first_name}
</p> </p>
<p> <p>
{t('user:Last Name')}: {user.last_name} {/* eslint-disable-next-line max-len */}
<span className="user-label">
{t('user:Last Name')}
</span>: {user.last_name}
</p> </p>
<p> <p>
{t('user:Birth Date')}: {birthDate} <span className="user-label">{t('user:Birth Date')}</span>
: {birthDate}
</p> </p>
<p> <p>
{t('user:Location')}: {user.location} {/* eslint-disable-next-line max-len */}
<span className="user-label">
{t('user:Location')}
</span>: {user.location}
</p> </p>
<p> <p>
{t('user:Bio')}: {user.bio} <span className="user-label">{t('user:Bio')}</span>:{' '}
{user.bio}
</p> </p>
<p> <p>
{t('user:Language')}: {user.language} {/* eslint-disable-next-line max-len */}
<span className="user-label">
{t('user:Language')}
</span>: {user.language}
</p> </p>
<p> <p>
{t('user:Timezone')}: {user.timezone} {/* eslint-disable-next-line max-len */}
<span className="user-label">
{t('user:Timezone')}
</span>: {user.timezone}
</p> </p>
<p> <p>
{t('user:First day of week')}:{' '} <span className="user-label">
{user.weekm ? t('user:Monday') : t('user:Sunday')} {t('user:First day of week')}
</span>
: {user.weekm ? t('user:Monday') : t('user:Sunday')}
</p> </p>
</div> </div>
<div className="col-md-4"> <div className="col-md-4">
@ -136,12 +142,28 @@ function ProfileDetail({
)}{' '} )}{' '}
</div> </div>
</div> </div>
<input {editable && (
type="submit" <button
className="btn btn-primary"
onClick={() => history.push('/profile/edit')}
>
{t('common:Edit')}
</button>
)}
{isDeletable && (
<button
className="btn btn-danger"
onClick={() => displayModal(true)}
>
{t('user:Delete user account')}
</button>
)}
<button
className="btn btn-secondary" className="btn btn-secondary"
onClick={() => history.go(-1)} onClick={() => history.push('/')}
value={t('common:Back')} >
/> {t('common:Back to home')}
</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -4,6 +4,7 @@
"admin rights": "admin rights", "admin rights": "admin rights",
"ascending": "ascending", "ascending": "ascending",
"Back": "Back", "Back": "Back",
"Back to home": "Back to home",
"Cancel": "Cancel", "Cancel": "Cancel",
"Confirmation": "Confirmation", "Confirmation": "Confirmation",
"Dashboard": "Dashboard", "Dashboard": "Dashboard",

View File

@ -6,6 +6,7 @@
"Birth Date": "Birth Date", "Birth Date": "Birth Date",
"Delete my account": "Delete my account", "Delete my account": "Delete my account",
"Delete picture": "Delete picture", "Delete picture": "Delete picture",
"Delete user account": "Delete user account",
"Edit Profile": "Edit Profile", "Edit Profile": "Edit Profile",
"Email": "Email", "Email": "Email",
"Enter a username": "Enter a username", "Enter a username": "Enter a username",

View File

@ -4,6 +4,7 @@
"admin rights": "droits d'admin", "admin rights": "droits d'admin",
"ascending": "ascendant", "ascending": "ascendant",
"Back": "Revenir à la page précédente", "Back": "Revenir à la page précédente",
"Back to home": "Retour à l'accueil",
"Cancel": "Annuler", "Cancel": "Annuler",
"Confirmation": "Confirmation", "Confirmation": "Confirmation",
"Dashboard": "Tableau de Bord", "Dashboard": "Tableau de Bord",

View File

@ -6,6 +6,7 @@
"Birth Date": "Date de naissance", "Birth Date": "Date de naissance",
"Delete my account": "Supprimer mon compte", "Delete my account": "Supprimer mon compte",
"Delete picture": "Supprimer l'image", "Delete picture": "Supprimer l'image",
"Delete user account": "Supprimer le compte",
"Edit Profile": "Editer le profil", "Edit Profile": "Editer le profil",
"Email": "Email", "Email": "Email",
"Enter a username": "Saisir un nom", "Enter a username": "Saisir un nom",