diff --git a/assets/css/custom.css b/assets/css/custom.css index 0ef3af70e1f14dce3f5d4c7925e8a7da199bca40..2fcdeb99f6f2557150a71d4420e78b32cbb1000e 100755 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -245,23 +245,31 @@ card .formRegis{ } .ui.segment.biodata-section{ - background-color: #343838; + background-color: white; } -.ui.segment.biodata-section h2{ - color: white; +.ui.segment.biodata-section h1{ + color: black; } .ui.segment.biodata-section h3{ - color: white; + color: black; +} + +.ui.segment.biodata-section h4{ + color: black; } .ui.segment.biodata-section h5{ - color: white; + color: black; +} + +.ui.segments.biodataBorder{ +border-color: transparent; } .transkrip{ - color: white; + color: black; } .ui.segment.biodata-section b{ diff --git a/assets/js/Dashboard.jsx b/assets/js/Dashboard.jsx index c1b9287f6905481fbd3953a870bdf7fbbfd3a801..c5d9556360305d257359a6d4f9147bf1ce6ab2c2 100755 --- a/assets/js/Dashboard.jsx +++ b/assets/js/Dashboard.jsx @@ -17,6 +17,13 @@ export default class Dashboard extends React.Component { }; static getInfo(user) { + const adminRole = { + name: 'admin', + user: { + email: '', + }, + photo: null, + }; const role = user.role; if (role === 'student') { return user.data.student; @@ -24,7 +31,7 @@ export default class Dashboard extends React.Component { return user.data.company; } - return 0; + return adminRole; } constructor(props) { diff --git a/assets/js/ProfilePage.jsx b/assets/js/ProfilePage.jsx index a39203092d07446cce94f0df15f4b44f5e56f488..2700b8ac75bc1cd1a8828959b20d1fcc4567aa61 100644 --- a/assets/js/ProfilePage.jsx +++ b/assets/js/ProfilePage.jsx @@ -154,9 +154,10 @@ export default class ProfilePage extends React.Component { <div className="profilePage"> <Segment className="biodata-section" > <Grid> - <Grid.Column width={3}> + <Grid.Column width={7}> <Header as="h2" icon textAlign="center"> - <Image src={this.state.photo ? this.state.photo : defaultPicture} size="small" shape="circular" /> + <br /> + <Image src={this.state.photo ? this.state.photo : defaultPicture} size="medium" /> </Header> </Grid.Column> @@ -164,83 +165,74 @@ export default class ProfilePage extends React.Component { <Container textAlign="left" className="profile-biodata"> <div className="biodata"> - <Segment.Group basic > - <Segment basic> - <Grid> - <Grid.Column width={2}> - <Icon color="teal" name="users" size="big"/> - </Grid.Column> - <Grid.Column width={11}> - <h2> { this.state.name } </h2> - </Grid.Column> - </Grid> - </Segment> - - <Segment basic> - <Grid> - <Grid.Column width={2}> - <Icon color="teal" name="university" size="big"/> - </Grid.Column> - <Grid.Column width={13}> - <h3> { this.state.major }, { this.state.batch } </h3> - </Grid.Column> - </Grid> - </Segment> - - <Segment basic> - <Grid> - <Grid.Column width={2}> - <Icon color="teal" name="mail" size="big"/> - </Grid.Column> - <Grid.Column width={13}> - <h3> { this.state.email } </h3> - </Grid.Column> - </Grid> - </Segment> - - - </Segment.Group> + + <Segment basic textAlign="center"> + <h1> { this.state.name } </h1> + </Segment> + + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="university" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <h3> { this.state.major }, { this.state.batch } </h3> + </Grid.Column> + </Grid> + </Segment> + + <Segment basic vertical> + + <Grid> + <Grid.Column width={2}> + <Icon name="mail" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <h3> { this.state.email } </h3> + </Grid.Column> + </Grid> + </Segment> + + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="phone" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <h3> { this.state.phone_number }</h3> + </Grid.Column> + </Grid> + </Segment> + + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="gift" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <h3> { this.state.cityOfBirth}, { this.state.dateOfBirth } </h3> + </Grid.Column> + </Grid> + </Segment> </div> - </Container> + <Container textAlign="center"> + <div className="button-profile"> + <a href={this.state.resume ? this.state.resume : '#'} ><Button primary size="small">Resume</Button></a> + { this.state.show_transcript && + <Button primary size="small">Transkrip</Button> + } + </div> + <div> + <h4> Bagikan Transkrip : { this.state.bagikanTranskrip }</h4> + </div> + </Container> + + </Container> </Grid.Column > - <Grid.Column width={5}> - <Segment.Group> - <Segment basic> - <Grid> - <Grid.Column width={2}> - <Icon color="teal" name="phone" size="big"/> - </Grid.Column> - <Grid.Column width={13}> - <h3> { this.state.phone_number }</h3> - </Grid.Column> - </Grid> - </Segment> - - <Segment basic> - <Grid> - <Grid.Column width={2}> - <Icon color="teal" name="gift" size="big" /> - </Grid.Column> - <Grid.Column width={13}> - <h3> { this.state.cityOfBirth}, { this.state.dateOfBirth } </h3> - </Grid.Column> - </Grid> - </Segment> - </Segment.Group> - - <div className="button-profile"> - <a href={this.state.resume ? this.state.resume : '#'} ><Button primary size="small">Resume</Button></a> - { this.state.show_transcript && - <Button primary size="small">Transkrip</Button> - } - </div> - <div> - <b> Bagikan Transkrip : { this.state.bagikanTranskrip }</b> - </div> - </Grid.Column> + </Grid> </Segment > { this.updateForm(this.props.route.own) } diff --git a/assets/js/VacancyPage.jsx b/assets/js/VacancyPage.jsx index eb437685378889c4442c391cdb2ce04452d3b854..2201e5b3db0c6414587bfe1d15c1d2b8b2a564c0 100644 --- a/assets/js/VacancyPage.jsx +++ b/assets/js/VacancyPage.jsx @@ -3,7 +3,7 @@ import Tabs from './components/Tabs'; import Pane from './components/Pane'; import VacancyList from './components/VacancyList'; import Pagination from './components/Pagination'; -import Applicants from './components/Applicants'; +import Applicants from './components/SupervisorPage'; export default class VacancyPage extends React.Component { @@ -47,7 +47,7 @@ export default class VacancyPage extends React.Component { /> } /> - <Applicants /> + <Applicants /> </Pane> <Pane label="Lamaran saya" > <Pagination @@ -79,17 +79,26 @@ export default class VacancyPage extends React.Component { ); } else if (this.props.user.role === 'company' || this.props.user.role === 'admin') { return ( - <Pagination - url={`/companies/${this.state.id}/vacancies/`} - child={ - <VacancyList - key={1} - user={this.props.user} - userId={this.state.id} - /> + <div> + <Pagination + url={`/companies/${this.state.id}/vacancies/`} + child={ + <VacancyList + key={1} + user={this.props.user} + userId={this.state.id} + /> } - error="Anda belum diverifikasi. Harap hubungi admin" - /> + error="Anda belum diverifikasi. Harap hubungi admin" + /> + + </div> + ); + } else if (this.props.user.role === 'admin') { + return ( + <div> + <h1> halo </h1> + </div> ); } diff --git a/assets/js/components/Applicants.jsx b/assets/js/components/SupervisorPage.jsx similarity index 64% rename from assets/js/components/Applicants.jsx rename to assets/js/components/SupervisorPage.jsx index 4d48f85fe721a5b61a009a78e16377267650c685..03c7cf33e9cd6a8ce6cff247f1bd1eb1df1f4840 100644 --- a/assets/js/components/Applicants.jsx +++ b/assets/js/components/SupervisorPage.jsx @@ -1,6 +1,7 @@ import React from 'react'; import { Header, Icon } from 'semantic-ui-react'; import Tables from './Tables'; +import Server from '../lib/Server'; const cols = [ { key: 'StudentName', label: 'Students Name' }, @@ -9,7 +10,7 @@ const cols = [ { key: 'Status', label: 'Status' }, ]; -const data = [ +const data2 = [ { id: 1, StudentName: 'John Doe', Perusahaan: 'Jalanloka', Posisi: 'Software Engineer', Status: 'Melamar' }, { id: 2, StudentName: 'Clark Kent', Perusahaan: 'Tutuplapak', Posisi: 'Data Scientist', Status: 'Diterima' }, { id: 3, StudentName: 'Rosamund Pike', Perusahaan: 'Tutuplapak', Posisi: 'System Analyst', Status: 'Diterima' }, @@ -19,9 +20,29 @@ const data = [ export default class Applicants extends React.Component { + constructor(props) { + super(props); + + this.state = { list: [] }; + } + + componentDidMount() { + this.UserList(); + } + + UserList() { + Server.get('/student-applications/', false).then((data) => { + this.setState({ list: data.results }); + }); + } render() { + const list = this.state.list.map((item, i) => <div> + <h1>{item.name}</h1> + <span>{item.npm}, {item.email}</span> + </div>); return ( + <div className="home-dosen"> <Header as="h2"> <Icon name="list" /> @@ -30,7 +51,9 @@ export default class Applicants extends React.Component { </Header.Content> </Header> - <Tables data={data} cols={cols} /> + <div id="layout-content" className="layout-content-wrapper"> + <div className="panel-list">{ list }</div> + </div> </div> ); diff --git a/assets/js/index.jsx b/assets/js/index.jsx index ee7ac55f37447610eefead797e7ca338d77be105..625b87d676ca7c42b71bc019d1b6815933ebf8f4 100644 --- a/assets/js/index.jsx +++ b/assets/js/index.jsx @@ -12,6 +12,8 @@ import Storage from './lib/Storage'; import ApplicantPage from './ApplicantPage'; import TranscriptPage from './TranscriptPage'; import AdminVacancyPage from './AdminVacancyPage'; +import CompanyPage from './CompanyPage'; + export default class App extends React.Component { static getRole() { @@ -70,15 +72,24 @@ export default class App extends React.Component { handleHome= (nextState, replace, cb) => { if (Server.isLoggedIn()) { if (App.getRole() === 'student') { - replace({ pathname: '/lowongan' }); cb(); + replace({ pathname: '/lowongan' }); + cb(); + } else if (App.getRole() === 'company') { + replace({ pathname: '/lowongan' }); + cb(); } else if (App.getRole() === 'company') { - replace({ pathname: '/lowongan' }); cb(); + replace({ pathname: '/lowongan' }); + cb(); + } else if (App.getRole() === 'admin') { + replace({ pathname: '/perusahaan' }); + cb(); } } replace({ pathname: '/login' }); cb(); }; render() { + const staff = this.authorization(['admin']); const student = this.authorization(['admin', 'student']); // const supervisor = this.authorization(['admin', 'supervisor']); const company = this.authorization(['admin', 'company']); @@ -90,7 +101,7 @@ export default class App extends React.Component { return ( <Router history={browserHistory}> <Route path="/login" component={Login} /> - <Route component={all(Dashboard)} onEnter={this.handleAuth} own> + <Route component={commonUser(Dashboard)} onEnter={this.handleAuth}> <Route path="/transcript/:id" component={company(TranscriptPage)} /> <Route path="/lowongan" component={commonUser(VacancyPage)} /> <Route path="/admin-lowongan" component={AdminVacancyPage} /> @@ -100,6 +111,7 @@ export default class App extends React.Component { <Route path="/profil" component={App.getRole() === 'student' ? student(ProfilePage) : company(CompanyProfile)} own /> <Route path="/mahasiswa/:id" component={grownups(ProfilePage)} /> <Route path="/perusahaan/:id" component={facultyMember(CompanyProfile)} /> + <Route path="/perusahaan" component={staff(CompanyPage)} /> <Route path="/transkrip/:id" component={facultyMember(CompanyProfile)} /> </Route> <Route path="/home" onEnter={this.handleHome} />