Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Köpeczi-Bócz Gergely
kszkepzes-frontend
Commits
6e73501e
Commit
6e73501e
authored
5 years ago
by
Rafael László
Browse files
Options
Downloads
Patches
Plain Diff
responsive event detail
parent
634f47b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/pages/EventDetail.js
+23
-16
23 additions, 16 deletions
src/components/pages/EventDetail.js
src/components/pages/Schedule.js
+3
-3
3 additions, 3 deletions
src/components/pages/Schedule.js
src/components/pages/TraineeTableRow.js
+27
-23
27 additions, 23 deletions
src/components/pages/TraineeTableRow.js
with
53 additions
and
42 deletions
src/components/pages/EventDetail.js
+
23
−
16
View file @
6e73501e
...
...
@@ -7,10 +7,12 @@ import {
Form
,
Header
,
Table
,
Segment
,
Icon
,
Checkbox
,
Popup
,
Grid
,
Divider
,
}
from
'
semantic-ui-react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
moment
from
'
moment
'
;
...
...
@@ -37,8 +39,8 @@ class EventDetail extends Component {
renderTrainees
()
{
const
event
=
this
.
props
.
selectedEvent
;
const
note
=
this
.
props
.
actualNote
;
return
this
.
props
.
trainees
.
map
((
item
)
=>
{
const
notes
=
this
.
props
.
eventNotes
.
filter
(
note
=>
note
.
profile
===
item
.
id
);
return
this
.
props
.
trainees
?
.
map
((
item
)
=>
{
const
notes
=
this
.
props
.
eventNotes
?
.
filter
(
note
=>
note
.
profile
===
item
.
id
);
return
(
<
TraineeTableRow
selectedEvent
=
{
event
}
...
...
@@ -48,19 +50,28 @@ class EventDetail extends Component {
/
>
);
});
return
null
}
renderEvent
()
{
const
{
name
,
date
,
description
}
=
this
.
props
.
selectedEvent
;
return
(
<
Item
>
<
Item
.
Header
as
=
'
h2
'
>
{
name
}
<
/Item.Header
>
<
Item
.
Header
as
=
'
h3
'
>
Dátum
:
{
moment
(
date
).
format
(
'
LL
'
)}
<
/Item.Header
>
<
Container
textAlign
=
'
justified
'
>
<
Item
.
Header
as
=
'
h3
'
>
Leírás
<
/Item.Header
>
<
Item
.
Content
>
{
description
}
<
/Item.Content
>
<
/Container
>
<
/Item
>
<
Segment
>
<
Item
>
<
Divider
style
=
{{
fontSize
:
'
2em
'
}}
horizontal
>
<
Header
as
=
'
h1
'
>
{
name
}
<
Item
.
Header
as
=
'
h5
'
>
{
moment
(
date
).
format
(
'
LL
'
)}
<
/Item.Header
>
<
/Header
>
<
/Divider
>
<
Container
textAlign
=
'
justified
'
>
<
Item
.
Header
as
=
'
h3
'
>
Leírás
<
/Item.Header
>
<
Item
.
Content
>
{
description
}
<
/Item.Content
>
<
/Container
>
<
/Item
>
<
/Segment
>
);
}
...
...
@@ -89,11 +100,7 @@ class EventDetail extends Component {
const
event
=
this
.
props
.
selectedEvent
;
const
note
=
this
.
props
.
actualNote
;
return
(
<
Container
style
=
{{
padding
:
'
80px
'
}}
>
<
Container
style
=
{{
paddingTop
:
'
1em
'
,
paddingBottom
:
'
7em
'
}}
>
<
Container
textAlign
=
'
center
'
>
{
this
.
props
.
selectedEvent
&&
this
.
props
.
trainees
?
this
.
renderEvent
()
...
...
@@ -103,7 +110,7 @@ class EventDetail extends Component {
<
/Container
>
<
Table
celled
centered
unstackable
>
<
Table
.
Header
>
<
Table
.
Row
>
<
Table
.
Row
textAlign
=
'
center
'
>
<
Table
.
HeaderCell
>
Név
<
/Table.HeaderCell
>
<
Table
.
HeaderCell
>
Jelen
volt
<
/Table.HeaderCell
>
<
Table
.
HeaderCell
>
Megjegyzések
<
/Table.HeaderCell
>
...
...
This diff is collapsed.
Click to expand it.
src/components/pages/Schedule.js
+
3
−
3
View file @
6e73501e
import
React
,
{
Component
}
from
'
react
'
;
import
{
Container
,
Accordion
,
Icon
,
Grid
,
Header
}
from
'
semantic-ui-react
'
;
import
{
Container
,
Accordion
,
Icon
,
Grid
,
Header
,
Segment
}
from
'
semantic-ui-react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
moment
from
'
moment
'
;
import
'
moment/locale/hu
'
;
...
...
@@ -43,9 +43,9 @@ class Schedule extends Component {
<
/h2
>
<
/Accordion.Title
>
<
Accordion
.
Content
active
=
{
activeIndex
===
event
.
id
}
>
<
p
>
<
Segment
>
{
event
.
description
}
<
/
p
>
<
/
Segment
>
<
/Accordion.Content
>
<
/Accordion
>
));
...
...
This diff is collapsed.
Click to expand it.
src/components/pages/TraineeTableRow.js
+
27
−
23
View file @
6e73501e
...
...
@@ -47,7 +47,7 @@ class TraineeTableRow extends Component {
const
isAbsent
=
selectedEvent
.
absent
.
includes
(
trainee
.
id
);
return
(
<
Table
.
Row
>
<
Table
.
Cell
>
<
Table
.
Cell
textAlign
=
'
center
'
>
{
trainee
.
full_name
}
<
/Table.Cell
>
{
!
this
.
props
.
edit
?
...
...
@@ -75,14 +75,14 @@ class TraineeTableRow extends Component {
<
Table
.
Cell
>
<
Grid
>
<
Grid
.
Row
>
<
Grid
.
Column
floated
=
'
left
'
width
=
{
8
}
textAlign
=
'
left
'
>
<
Grid
.
Column
floated
=
'
left
'
width
=
{
8
}
>
{
notes
.
length
>
0
?
<
Comment
>
<
Comment
.
Content
>
<
Comment
.
Author
>
{
notes
[
0
].
created_by_name
}
<
/Comment.Author
>
<
Comment
.
Author
>
<
b
>
{
notes
[
0
].
created_by_name
}
:
<
/b>
</
Comment
.
Author
>
<
Comment
.
Text
>
{
notes
[
0
].
note
.
length
>
5
0
?
notes
[
0
].
note
.
slice
(
0
,
50
).
concat
(
'
...
'
)
{
notes
[
0
].
note
.
length
>
3
0
?
notes
[
0
].
note
.
slice
(
0
,
50
).
concat
(
'
...
'
)
:
notes
[
0
].
note
}
<
/Comment.Text
>
...
...
@@ -92,25 +92,27 @@ class TraineeTableRow extends Component {
null
}
<
/Grid.Column
>
<
Grid
.
Column
floated
=
'
right
'
width
=
{
3
}
textAlign
=
'
right
'
>
<
Grid
.
Column
floated
=
'
right
'
width
=
{
6
}
textAlign
=
'
right
'
>
{
notes
.
length
>
0
?
<
Popup
basic
open
=
{
this
.
state
.
showMorePopup
}
trigger
=
{
<
Button
icon
=
'
comment alternate outline
'
onClick
=
{
this
.
triggerMore
}
/>
}
trigger
=
{
<
Button
icon
=
'
comment alternate outline
'
onClick
=
{
this
.
triggerMore
}
/>
}
content
=
{
notes
.
map
((
note
)
=>
{
return
(
<
Comment
.
Content
>
<
Comment
.
Author
>
{
note
.
created_by_name
}
<
/Comment.Author
>
<
Comment
.
Text
>
{
note
.
note
}
<
/Comment.Text
>
<
/Comment.Content
>
);
})}
return
(
<
Comment
.
Content
>
<
Comment
.
Author
>
{
note
.
created_by_name
}
<
/Comment.Author
>
<
Comment
.
Text
>
{
note
.
note
}
<
/Comment.Text
>
<
/Comment.Content
>
);
})}
/
>
:
null
}
:
null
}
<
Popup
trigger
=
{
<
Button
icon
=
'
plus
'
onClick
=
{
this
.
triggerAdd
}
/>
}
basic
...
...
@@ -123,12 +125,14 @@ class TraineeTableRow extends Component {
/
>
<
Button
onClick
=
{()
=>
{
this
.
props
.
postEventNote
({
eventid
:
selectedEvent
.
id
,
userid
:
trainee
.
id
,
note
:
note
.
note
});
this
.
props
.
clearWrite
();
}
}
this
.
triggerAdd
()
this
.
props
.
postEventNote
({
eventid
:
selectedEvent
.
id
,
userid
:
trainee
.
id
,
note
:
note
.
note
})
this
.
props
.
clearWrite
()
}}
content
=
'
Megjegyzés hozzáadása
'
labelPosition
=
'
left
'
icon
=
'
edit
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment