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{ ...@@ -246,8 +246,7 @@ card .formRegis{
} }
.ui.segment.paginationCompany{ .ui.segment.paginationCompany{
margin-left: 10%; margin: 2% 7% 60px;
margin-right: 10%;
} }
.admin-bar{ .admin-bar{
......
...@@ -19,9 +19,6 @@ export default class CompanyPage extends React.Component { ...@@ -19,9 +19,6 @@ export default class CompanyPage extends React.Component {
<div> <div>
<div className="button-administrasi"> <div className="button-administrasi">
<Button onClick={this.handleClick} icon="dashboard" labelPosition="left" color="facebook" content="Buka Menu 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" /> <Button onClick={this.handleVacancy} icon="dashboard" labelPosition="left" color="facebook" content="Halaman Verifikasi Lowongan" />
</div> </div>
...@@ -29,7 +26,7 @@ export default class CompanyPage extends React.Component { ...@@ -29,7 +26,7 @@ export default class CompanyPage extends React.Component {
<Pagination <Pagination
key={1} key={1}
url={`/companies/?status=${Company.COMPANY_STATUS.NEW}`} url={`/companies/?status=${Company.COMPANY_STATUS.NEW}`}
label="Baru" label="Belum Diverifikasi"
child={ child={
<CompanyList status={Company.COMPANY_STATUS.NEW} /> <CompanyList status={Company.COMPANY_STATUS.NEW} />
} }
......
import React from 'react'; 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 Tabs from './components/Tabs';
import Pane from './components/Pane'; import Pane from './components/Pane';
import VacancyList from './components/VacancyList'; import VacancyList from './components/VacancyList';
...@@ -140,9 +141,28 @@ export default class VacancyPage extends React.Component { ...@@ -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() { render() {
return ( return (
<div className="applicant"> <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() } { this.generateVacancies() }
</div> </div>
); );
......
...@@ -32,9 +32,10 @@ export default class AdminVacancy extends React.Component { ...@@ -32,9 +32,10 @@ export default class AdminVacancy extends React.Component {
} }
render() { render() {
const defaultImage = 'http://semantic-ui.com/images/wireframe/image.png';
return ( return (
<Item className="adminItems"> <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.Content>
<Item.Header as="a">{this.props.data.name}</Item.Header> <Item.Header as="a">{this.props.data.name}</Item.Header>
<Grid.Row> <Grid.Row>
......
...@@ -65,8 +65,13 @@ export default class TopMenu extends React.Component { ...@@ -65,8 +65,13 @@ export default class TopMenu extends React.Component {
<div> <div>
{ this.props.user.data.is_staff && this.props.user.data.company && ( { this.props.user.data.is_staff && this.props.user.data.company && (
<div className="admin-bar"> <div className="admin-bar">
Anda login sebagai perusahaan: {this.props.user.data.company.name} (#{this.props.user.data.company.id}). <br/>
Untuk keluar, silahkan klik <a href="#" onClick={this.logoutCompany}> link ini</a> <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> </div>
)} )}
<Menu color="blue" pointing secondary> <Menu color="blue" pointing secondary>
......
...@@ -18,7 +18,6 @@ export default class VacancyList extends React.Component { ...@@ -18,7 +18,6 @@ export default class VacancyList extends React.Component {
items: [], items: [],
}; };
constructor(props) { constructor(props) {
super(props); super(props);
/* istanbul ignore next */ /* istanbul ignore next */
...@@ -64,51 +63,32 @@ export default class VacancyList extends React.Component { ...@@ -64,51 +63,32 @@ export default class VacancyList extends React.Component {
/> />
), ),
); );
} } else if ((this.props.user.role === 'admin' && this.props.user.data.company != null)
if ((this.props.user.role === 'admin' && this.props.user.data.supervisor != null) || this.props.user.role === 'supervisor') { || this.props.user.role === 'company') {
return this.state.vacancies.map(vacancy => ( return this.state.vacancies.map(vacancy => (
<AdminVacancy <Item.Group key={vacancy.id} relaxed style={{ width: '100%' }}>
key={vacancy.id} <CompanyVacancy
data={vacancy} key={vacancy.id}
updateStatus={this.updateStatus} data={vacancy}
/>), deleteCallback={() => this.deleteVacancy(vacancy.id)}
/>
</Item.Group>
),
); );
} }
return this.state.vacancies.map(vacancy => ( return this.state.vacancies.map(vacancy => (
<Item.Group key={vacancy.id} relaxed style={{ width: '100%' }}> <AdminVacancy
<CompanyVacancy key={vacancy.id}
key={vacancy.id} data={vacancy}
data={vacancy} updateStatus={this.updateStatus}
deleteCallback={() => this.deleteVacancy(vacancy.id)} />),
/>
</Item.Group>
),
); );
} }
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 = () => ( render = () => (
<div> <div>
<Grid container columns="eleven" doubling> <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%' }}> <Item.Group relaxed style={{ width: '100%' }}>
{ this.generateVacancies() } { this.generateVacancies() }
</Item.Group> </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