Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Julien Jerphanion
Rex Dri
Commits
557fe751
Commit
557fe751
authored
Sep 06, 2018
by
Florent Chehab
Browse files
University page added, other components updated to redirect correctly
parent
a065c242
Changes
6
Show whitespace changes
Inline
Side-by-side
frontend/src/components/App.js
View file @
557fe751
...
...
@@ -33,6 +33,7 @@ import {
import
PageMap
from
'
./pages/PageMap
'
;
import
PageHome
from
'
./pages/PageHome
'
;
import
PageUniversity
from
'
./pages/PageUniversity
'
;
import
PageFilter
from
'
./pages/PageFilter
'
;
import
PageSearch
from
'
./pages/PageSearch
'
;
import
PageSettings
from
'
./pages/PageSettings
'
;
...
...
@@ -162,6 +163,7 @@ class App extends MyComponent {
<
Route
path
=
"
/app/
"
exact
=
{
true
}
component
=
{
PageHome
}
/
>
<
Route
path
=
"
/app/search
"
component
=
{
PageSearch
}
/
>
<
Route
path
=
"
/app/map
"
component
=
{
PageMap
}
/
>
<
Route
path
=
"
/app/university/:id
"
component
=
{
PageUniversity
}
/
>
<
Route
path
=
"
/app/filter
"
component
=
{
PageFilter
}
/
>
<
Route
path
=
"
/app/settings
"
component
=
{
PageSettings
}
/
>
<
/main
>
...
...
frontend/src/components/map/UnivMakers.js
View file @
557fe751
...
...
@@ -49,6 +49,7 @@ class UnivMarkers extends MyComponent {
logo
=
{
el
.
univ_logo
}
city
=
{
el
.
univ_city
}
country
=
{
el
.
univ_country
}
univId
=
{
el
.
id
}
/
>
<
/Popup
>
<
/Marker
>
...
...
frontend/src/components/map/UnivPopupContent.js
View file @
557fe751
...
...
@@ -10,6 +10,7 @@ import Typography from '@material-ui/core/Typography';
import
Divider
from
'
@material-ui/core/Divider
'
;
import
IconAdd
from
'
@material-ui/icons/Add
'
;
import
IconClose
from
'
@material-ui/icons/Close
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
MyCardMedia
from
'
./MyCardMedia
'
;
import
{
withLeaflet
}
from
'
react-leaflet
'
;
...
...
@@ -31,7 +32,7 @@ const styles = {
class
UnivPopupContent
extends
Component
{
render
()
{
const
{
classes
,
logo
,
name
,
city
,
country
,
leaflet
}
=
this
.
props
;
const
{
classes
,
logo
,
name
,
city
,
country
,
leaflet
,
univId
}
=
this
.
props
;
let
height
=
(
this
.
props
.
logo
!==
""
?
"
140
"
:
"
0
"
);
let
closeIt
=
()
=>
leaflet
.
map
.
closePopup
();
return
(
...
...
@@ -55,10 +56,12 @@ class UnivPopupContent extends Component {
<
/CardContent
>
<
/CardActionArea
>
<
CardActions
>
<
Link
to
=
{
"
/app/university/
"
+
univId
}
>
<
Button
variant
=
"
contained
"
size
=
"
small
"
color
=
"
primary
"
>
<
IconAdd
/>
En
savoir
plus
<
/Button
>
<
/Link
>
<
Button
size
=
"
small
"
color
=
"
secondary
"
onClick
=
{()
=>
closeIt
()}
>
<
IconClose
/>
Fermer
...
...
frontend/src/components/pages/PageUniversity.js
0 → 100644
View file @
557fe751
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
withStyles
}
from
'
@material-ui/core/styles
'
;
import
Typography
from
'
@material-ui/core/Typography
'
;
import
Paper
from
'
@material-ui/core/Paper
'
;
const
styles
=
theme
=>
({
myPaper
:
{
padding
:
16
}
});
class
PageUniversity
extends
React
.
Component
{
render
()
{
const
{
classes
,
match
}
=
this
.
props
;
return
(
<
Paper
className
=
{
classes
.
myPaper
}
>
<
Typography
variant
=
"
display1
"
>
Université
{
match
.
params
.
id
}
<
/Typography
>
<
/Paper
>
);
}
}
PageUniversity
.
propTypes
=
{
classes
:
PropTypes
.
object
.
isRequired
,
};
export
default
withStyles
(
styles
)(
PageUniversity
);
frontend/src/components/search/UnivList.js
View file @
557fe751
...
...
@@ -2,11 +2,8 @@ import React from 'react';
import
PropTypes
from
'
prop-types
'
;
import
{
withStyles
}
from
'
@material-ui/core/styles
'
;
import
MobileStepper
from
'
@material-ui/core/MobileStepper
'
;
import
Paper
from
'
@material-ui/core/Paper
'
;
import
Typography
from
'
@material-ui/core/Typography
'
;
import
List
from
'
@material-ui/core/List
'
;
import
ListItem
from
'
@material-ui/core/ListItem
'
;
import
ListItemIcon
from
'
@material-ui/core/ListItemIcon
'
;
import
_
from
'
underscore
'
;
import
ListItemText
from
'
@material-ui/core/ListItemText
'
;
import
Divider
from
'
@material-ui/core/Divider
'
;
...
...
@@ -14,6 +11,7 @@ import Button from '@material-ui/core/Button';
import
KeyboardArrowLeft
from
'
@material-ui/icons/KeyboardArrowLeft
'
;
import
KeyboardArrowRight
from
'
@material-ui/icons/KeyboardArrowRight
'
;
import
SwipeableViews
from
'
react-swipeable-views
'
;
import
{
Link
}
from
'
react-router-dom
'
;
const
styles
=
theme
=>
({
...
...
@@ -87,9 +85,11 @@ class UnivList extends React.Component {
<
Divider
/>
{
_
.
map
(
_
.
range
((
page
)
*
itemsPerPage
,
Math
.
min
((
page
+
1
)
*
itemsPerPage
,
numberOfItems
)),
univ_ind
=>
(
<
Link
to
=
{
'
/app/university/
'
+
universitiesToList
[
univ_ind
].
id
}
>
<
ListItem
button
divider
=
{
true
}
key
=
{
univ_ind
}
>
<
ListItemText
primary
=
{
universitiesToList
[
univ_ind
].
name
}
/
>
<
/ListItem
>
<
/Link
>
))
}
<
/List
>
...
...
frontend/src/components/template/listItems.js
View file @
557fe751
...
...
@@ -53,12 +53,14 @@ export const mainListItems = (
<
/ListItem
>
<
/NavLink
>
<
NavLink
to
=
{
'
/app/university/undefined
'
}
>
<
ListItem
button
>
<
ListItemIcon
>
<
LocationCityIcon
/>
<
/ListItemIcon
>
<
ListItemText
primary
=
"
Université
"
/>
<
/ListItem
>
<
/NavLink
>
<
NavLink
to
=
{
'
/app/settings/
'
}
>
<
ListItem
button
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment