diff --git a/fittrackee_client/src/components/Admin/AdminDashboard.jsx b/fittrackee_client/src/components/Admin/AdminDashboard.jsx index cbae1f7d..d8450854 100644 --- a/fittrackee_client/src/components/Admin/AdminDashboard.jsx +++ b/fittrackee_client/src/components/Admin/AdminDashboard.jsx @@ -1,23 +1,38 @@ import React from 'react' +import { Link } from 'react-router-dom' import { Helmet } from 'react-helmet' import AdminStats from './AdminStats' +import { capitalize } from '../../utils' + +const menuItems = ['application', 'sports', 'users'] export default function AdminDashboard(props) { const { t } = props return ( -
+ <> {t('administration:FitTrackee administration')}
-
- {t('administration:FitTrackee administration')} -
+
{t('administration:Administration')}
+
    + {menuItems.map(item => ( +
  • + + {t(`administration:${capitalize(item)}`)} + +
  • + ))} +
-
+ ) } diff --git a/fittrackee_client/src/components/Admin/AdminMenu.jsx b/fittrackee_client/src/components/Admin/AdminMenu.jsx deleted file mode 100644 index 780ee9a6..00000000 --- a/fittrackee_client/src/components/Admin/AdminMenu.jsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react' -import { Link } from 'react-router-dom' - -import { capitalize } from '../../utils/index' - -const menuItems = ['application', 'sports', 'users'] - -export default function AdminMenu(props) { - const { t } = props - return ( -
- -
- ) -} diff --git a/fittrackee_client/src/components/Admin/Application/Config.jsx b/fittrackee_client/src/components/Admin/Application/Config.jsx index 42392c78..80f6ac79 100644 --- a/fittrackee_client/src/components/Admin/Application/Config.jsx +++ b/fittrackee_client/src/components/Admin/Application/Config.jsx @@ -14,61 +14,59 @@ export default function Config({ appConfig, message, t, updateIsInEdition }) { -
-
-
-
-
- {t('administration:Application configuration')} -
-
-
-
- - - - - - - - - - - - - - - - - - - -
- {t( - // eslint-disable-next-line max-len - 'administration:Max. number of active users (if 0, no limitation)' - )} - : - {appConfig.max_users}
- {t('administration:Max. size of uploaded files')}: - {getFileSize(appConfig.max_single_file_size)}
- {t('administration:Max. size of zip archive')}: - {getFileSize(appConfig.max_zip_file_size)}
- {t('administration:Max. files of zip archive')}: - {appConfig.gpx_limit_import}
- updateIsInEdition()} - value={t('common:Edit')} - /> - history.push('/admin')} - value={t('common:Back')} - /> -
+
+
+
+
+ {t('administration:Application configuration')} +
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ {t( + // eslint-disable-next-line max-len + 'administration:Max. number of active users (if 0, no limitation)' + )} + : + {appConfig.max_users}
+ {t('administration:Max. size of uploaded files')}: + {getFileSize(appConfig.max_single_file_size)}
+ {t('administration:Max. size of zip archive')}: + {getFileSize(appConfig.max_zip_file_size)}
+ {t('administration:Max. files of zip archive')}: + {appConfig.gpx_limit_import}
+ updateIsInEdition()} + value={t('common:Edit')} + /> + history.push('/admin')} + value={t('common:Back')} + />
diff --git a/fittrackee_client/src/components/Admin/Application/ConfigForm.jsx b/fittrackee_client/src/components/Admin/Application/ConfigForm.jsx index c5ea3a17..6cc7419c 100644 --- a/fittrackee_client/src/components/Admin/Application/ConfigForm.jsx +++ b/fittrackee_client/src/components/Admin/Application/ConfigForm.jsx @@ -57,113 +57,110 @@ class AdminApplication extends React.Component { {message && } {Object.keys(formData).length > 0 && ( -
-
-
-
-
- {t('administration:Application configuration')} -
-
-
{ - event.preventDefault() - onHandleConfigFormSubmit(formData) - updateIsInEdition() - }} - > -
- - this.handleFormChange(e)} - /> -
-
- - this.handleFormChange(e)} - /> -
-
- - this.handleFormChange(e)} - /> -
-
- - this.handleFormChange(e)} - /> -
+
+
+
+
+ {t('administration:Application configuration')} +
+
+ { + event.preventDefault() + onHandleConfigFormSubmit(formData) + updateIsInEdition() + }} + > +
+ this.handleFormChange(e)} /> +
+
+ updateIsInEdition()} - value={t('common:Cancel')} + className="col-sm-5" + id="max_single_file_size" + name="max_single_file_size" + type="number" + step="0.1" + min="0" + value={formData.max_single_file_size} + onChange={e => this.handleFormChange(e)} /> - -
+
+
+ + this.handleFormChange(e)} + /> +
+
+ + this.handleFormChange(e)} + /> +
+ + updateIsInEdition()} + value={t('common:Cancel')} + /> +
diff --git a/fittrackee_client/src/components/Admin/Sports/index.jsx b/fittrackee_client/src/components/Admin/Sports/index.jsx index b38fe287..0ed3d3b5 100644 --- a/fittrackee_client/src/components/Admin/Sports/index.jsx +++ b/fittrackee_client/src/components/Admin/Sports/index.jsx @@ -19,12 +19,13 @@ class AdminSports extends React.Component { FitTrackee - {t('administration:Administration')} {message && } -
-
-
+
+
+
+
{t('administration:Sports')}
{sports.length > 0 && ( - +
@@ -93,7 +94,7 @@ class AdminSports extends React.Component { )} history.push('/admin/')} value={t('administration:Back')} /> diff --git a/fittrackee_client/src/components/Admin/Users/index.jsx b/fittrackee_client/src/components/Admin/Users/index.jsx index f4cc7507..aae4962f 100644 --- a/fittrackee_client/src/components/Admin/Users/index.jsx +++ b/fittrackee_client/src/components/Admin/Users/index.jsx @@ -26,7 +26,7 @@ class AdminUsers extends React.Component {
-
{t('administration:id')}
+
@@ -103,7 +103,7 @@ class AdminUsers extends React.Component {
#
history.push('/admin/')} value={t('administration:Back')} /> diff --git a/fittrackee_client/src/components/Admin/index.jsx b/fittrackee_client/src/components/Admin/index.jsx index 782781b9..86983eab 100644 --- a/fittrackee_client/src/components/Admin/index.jsx +++ b/fittrackee_client/src/components/Admin/index.jsx @@ -2,11 +2,10 @@ import React from 'react' import { Helmet } from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' -import { Link, Route, Switch } from 'react-router-dom' +import { Route, Switch } from 'react-router-dom' import AdminApplication from './Application' import AdminDashboard from './AdminDashboard' -import AdminMenu from './AdminMenu' import AdminSports from './Sports' import AdminUsers from './Users' import NotFound from './../Others/NotFound' @@ -14,60 +13,40 @@ import NotFound from './../Others/NotFound' function Admin(props) { const { t, user } = props return ( -
+ <> FitTrackee - {t('administration:Administration')}
{user.admin ? ( -
-
-
-
- - {t('administration:Administration')} - -
-
- -
-
-
-
- - } - /> - } - /> - } - /> - } - /> - - -
-
+ + } + /> + } + /> + } + /> + } + /> + + ) : ( )}
-
+ ) } diff --git a/fittrackee_client/src/components/App.css b/fittrackee_client/src/components/App.css index 59e75b19..4e79d847 100644 --- a/fittrackee_client/src/components/App.css +++ b/fittrackee_client/src/components/App.css @@ -187,6 +187,10 @@ label { font-weight: bold; } +.btn { + margin-right: 10px; +} + .card { text-align: left; } @@ -286,6 +290,9 @@ label { font-weight: bold; } +.dashboard { + height: 100%; +} .dashboard, .history { margin-top: 30px; } @@ -316,6 +323,10 @@ label { content: " ✔"; } +.error-message { + margin-top: 10px; +} + .fa-as-link { cursor:pointer; color: #40578a; diff --git a/fittrackee_client/src/components/Common/Message.jsx b/fittrackee_client/src/components/Common/Message.jsx index 6d772b14..b9aba5ba 100644 --- a/fittrackee_client/src/components/Common/Message.jsx +++ b/fittrackee_client/src/components/Common/Message.jsx @@ -12,7 +12,7 @@ export default class Message extends React.PureComponent { )}` : t(`messages:${message}`) return ( - <> +
{singleMessage !== '' && {singleMessage}} {messages && messages.length > 0 && ( @@ -23,7 +23,7 @@ export default class Message extends React.PureComponent { )} - +
) } } diff --git a/fittrackee_client/src/components/User/Form.jsx b/fittrackee_client/src/components/User/Form.jsx index b674a36e..77e369b8 100644 --- a/fittrackee_client/src/components/User/Form.jsx +++ b/fittrackee_client/src/components/User/Form.jsx @@ -19,7 +19,6 @@ export default function Form(props) {
-

{props.formType === 'register' && !props.isRegistrationAllowed ? (
diff --git a/fittrackee_client/src/components/User/ProfileEdit.jsx b/fittrackee_client/src/components/User/ProfileEdit.jsx index 78217051..108b58a5 100644 --- a/fittrackee_client/src/components/User/ProfileEdit.jsx +++ b/fittrackee_client/src/components/User/ProfileEdit.jsx @@ -74,7 +74,6 @@ class ProfileEdit extends React.Component { FitTrackee - {t('user:Profile Edition')} - {formData.isAuthenticated && (
{displayModal && ( @@ -266,23 +265,27 @@ class ProfileEdit extends React.Component {
- + {t('common:Submit')} + + + +