Fakultas Ilmu Komputer UI

Commit dceaf466 authored by M. Reza Qorib's avatar M. Reza Qorib
Browse files

Fix VacancyList for supervisor + some css things

parent db8ae455
......@@ -246,8 +246,7 @@ card .formRegis{
}
.ui.segment.paginationCompany{
margin-left: 10%;
margin-right: 10%;
margin: 2% 7% 60px;
}
.admin-bar{
......
......@@ -19,9 +19,6 @@ export default class CompanyPage extends React.Component {
<div>
<div className="button-administrasi">
<Button onClick={this.handleClick} icon="dashboard" labelPosition="left" color="facebook" content="Buka Menu Administrasi" />
</div>
<div style={{ paddingLeft: '10px', paddingTop : '10px'}}>
<Button onClick={this.handleVacancy} icon="dashboard" labelPosition="left" color="facebook" content="Halaman Verifikasi Lowongan" />
</div>
......@@ -29,7 +26,7 @@ export default class CompanyPage extends React.Component {
<Pagination
key={1}
url={`/companies/?status=${Company.COMPANY_STATUS.NEW}`}
label="Baru"
label="Belum Diverifikasi"
child={
<CompanyList status={Company.COMPANY_STATUS.NEW} />
}
......
import React from 'react';
import { Segment } from 'semantic-ui-react';
import { Segment, Item, Button } from 'semantic-ui-react';
import { Link } from 'react-router';
import Tabs from './components/Tabs';
import Pane from './components/Pane';
import VacancyList from './components/VacancyList';
......@@ -140,9 +141,28 @@ export default class VacancyPage extends React.Component {
);
}
companyHeader() {
if ((this.props.user.role === 'admin' && this.props.user.data.company != null) || this.props.user.role === 'company') {
return (
<div style={{ float: 'left' }}>
<Button as={Link} to="/pelamar" icon="eye" labelPosition="left" color="facebook" content="Lihat Semua Pendaftar" />
<Button as={Link} to="/buat-lowongan" icon="add" labelPosition="left" content="Tambah Lowongan Baru" color="teal" />
</div>
);
}
return '';
}
render() {
return (
<div className="applicant">
<div className="button-administrasi">
{ this.companyHeader() }
{(this.props.user.role === 'admin' || this.props.user.role === 'supervisor') &&
<Button as={Link} to="/rekap" icon="dashboard" labelPosition="left" color="facebook" content="Rekap Pendaftaran"/>
}
</div>
{ this.generateVacancies() }
</div>
);
......
......@@ -32,9 +32,10 @@ export default class AdminVacancy extends React.Component {
}
render() {
const defaultImage = 'http://semantic-ui.com/images/wireframe/image.png';
return (
<Item className="adminItems">
<Item.Image src="http://semantic-ui.com/images/wireframe/image.png" size="small" />
<Item.Image src={this.props.data.company.logo ? this.props.data.company.logo : defaultImage} size="small" />
<Item.Content>
<Item.Header as="a">{this.props.data.name}</Item.Header>
<Grid.Row>
......
......@@ -65,8 +65,13 @@ export default class TopMenu extends React.Component {
<div>
{ this.props.user.data.is_staff && this.props.user.data.company && (
<div className="admin-bar">
Anda login sebagai perusahaan: {this.props.user.data.company.name} (#{this.props.user.data.company.id}).
Untuk keluar, silahkan klik <a href="#" onClick={this.logoutCompany}> link ini</a>
<br/>
<p>
Anda login sebagai perusahaan:
<b> {this.props.user.data.company.name}</b> (#{this.props.user.data.company.id}).
Untuk kembali menjadi admin, klik <a href="#" onClick={this.logoutCompany}> link ini</a>
</p>
<br/>
</div>
)}
<Menu color="blue" pointing secondary>
......
......@@ -18,7 +18,6 @@ export default class VacancyList extends React.Component {
items: [],
};
constructor(props) {
super(props);
/* istanbul ignore next */
......@@ -64,51 +63,32 @@ export default class VacancyList extends React.Component {
/>
),
);
}
if ((this.props.user.role === 'admin' && this.props.user.data.supervisor != null) || this.props.user.role === 'supervisor') {
} else if ((this.props.user.role === 'admin' && this.props.user.data.company != null)
|| this.props.user.role === 'company') {
return this.state.vacancies.map(vacancy => (
<AdminVacancy
key={vacancy.id}
data={vacancy}
updateStatus={this.updateStatus}
/>),
<Item.Group key={vacancy.id} relaxed style={{ width: '100%' }}>
<CompanyVacancy
key={vacancy.id}
data={vacancy}
deleteCallback={() => this.deleteVacancy(vacancy.id)}
/>
</Item.Group>
),
);
}
return this.state.vacancies.map(vacancy => (
<Item.Group key={vacancy.id} relaxed style={{ width: '100%' }}>
<CompanyVacancy
key={vacancy.id}
data={vacancy}
deleteCallback={() => this.deleteVacancy(vacancy.id)}
/>
</Item.Group>
),
<AdminVacancy
key={vacancy.id}
data={vacancy}
updateStatus={this.updateStatus}
/>),
);
}
companyHeader() {
if (this.props.user.role === 'admin' || this.props.user.role === 'company') {
return (
<div>
<Button size="tiny" as={Link} to="/pelamar" icon="eye" labelPosition="left" color="facebook" content="Lihat Semua Pendaftar" />
<Button size="tiny" as={Link} to="/buat-lowongan" icon="add" labelPosition="left" content="Tambah Lowongan Baru" color="teal" />
</div>
);
}
return '';
}
render = () => (
<div>
<Grid container columns="eleven" doubling>
<Grid textAlign="center" style={{ paddingTop: '10px' }}>
{ this.companyHeader() }<br />
{(this.props.user.role === 'admin' || this.props.user.role === 'supervisor') &&
<Button size="tiny" as={Link} to="/rekap" icon="dashboard" labelPosition="left" color="facebook" content="Rekap Pendaftaran" />
}
</Grid>
<Item.Group relaxed style={{ width: '100%' }}>
{ this.generateVacancies() }
</Item.Group>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment