Client/admin page #44

Merged
KevinMidboe merged 4 commits from client/admin-page into master 2017-10-21 07:50:33 +00:00
Showing only changes of commit a0565f79d2 - Show all commits

View File

@@ -3,12 +3,23 @@ import { Link } from 'react-router-dom';
class SidebarComponent extends Component { class SidebarComponent extends Component {
generateListElements(index, item) {
if (index == this.props.listItemSelected)
return (
<td>{item.name}</td>
)
else
return (
<td><Link to={{ pathname: '/admin/'+String(index)}}>{item.name}</Link></td>
)
}
displayRequestedElementsInfo() { displayRequestedElementsInfo() {
if (this.props.requested_objects) { if (this.props.requested_objects) {
let element = this.props.requested_objects.map((item, index) => { let requestedElement = this.props.requested_objects.map((item, index) => {
return ( return (
<tr key={index}> <tr key={index}>
<td><Link to={{ pathname: '/admin/'+String(index)}}>{item.name}</Link></td> { this.generateListElements(index, item) }
<td>{item.status}</td> <td>{item.status}</td>
<td>{item.requested_date}</td> <td>{item.requested_date}</td>
</tr> </tr>
@@ -25,7 +36,7 @@ class SidebarComponent extends Component {
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{element} {requestedElement}
</tbody> </tbody>
</table> </table>
) )