Display Protospace as meeting instructor
This commit is contained in:
parent
04e0bbc7a2
commit
edb2128cbf
|
@ -3,7 +3,7 @@ import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-r
|
||||||
import './light.css';
|
import './light.css';
|
||||||
import { Button, Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react';
|
import { Button, Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react';
|
||||||
import moment from 'moment-timezone';
|
import moment from 'moment-timezone';
|
||||||
import { isAdmin, isInstructor, BasicTable, requester } from './utils.js';
|
import { isAdmin, isInstructor, getInstructor, BasicTable, requester } from './utils.js';
|
||||||
import { NotFound, PleaseLogin } from './Misc.js';
|
import { NotFound, PleaseLogin } from './Misc.js';
|
||||||
import { InstructorClassDetail, InstructorClassAttendance } from './InstructorClasses.js';
|
import { InstructorClassDetail, InstructorClassAttendance } from './InstructorClasses.js';
|
||||||
import { PayPalPayNow } from './PayPal.js';
|
import { PayPalPayNow } from './PayPal.js';
|
||||||
|
@ -35,7 +35,7 @@ function ClassTable(props) {
|
||||||
</Link>
|
</Link>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).tz('America/Edmonton').format('LT')}</Table.Cell>
|
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).tz('America/Edmonton').format('LT')}</Table.Cell>
|
||||||
<Table.Cell>{x.instructor_name}</Table.Cell>
|
<Table.Cell>{getInstructor(x)}</Table.Cell>
|
||||||
<Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell>
|
<Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell>
|
||||||
<Table.Cell>{x.student_count} {!!x.max_students && '/ '+x.max_students}</Table.Cell>
|
<Table.Cell>{x.student_count} {!!x.max_students && '/ '+x.max_students}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
|
@ -171,7 +171,7 @@ export function ClassDetail(props) {
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell>Instructor:</Table.Cell>
|
<Table.Cell>Instructor:</Table.Cell>
|
||||||
<Table.Cell>{clazz.instructor_name}</Table.Cell>
|
<Table.Cell>{getInstructor(clazz)}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell>Cost:</Table.Cell>
|
<Table.Cell>Cost:</Table.Cell>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-r
|
||||||
import './light.css';
|
import './light.css';
|
||||||
import { Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react';
|
import { Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react';
|
||||||
import moment from 'moment-timezone';
|
import moment from 'moment-timezone';
|
||||||
import { isInstructor, requester } from './utils.js';
|
import { isInstructor, getInstructor, requester } from './utils.js';
|
||||||
import { NotFound, PleaseLogin } from './Misc.js';
|
import { NotFound, PleaseLogin } from './Misc.js';
|
||||||
import { InstructorCourseList, InstructorCourseDetail } from './InstructorCourses.js';
|
import { InstructorCourseList, InstructorCourseDetail } from './InstructorCourses.js';
|
||||||
import { InstructorClassList } from './InstructorClasses.js';
|
import { InstructorClassList } from './InstructorClasses.js';
|
||||||
|
@ -126,7 +126,7 @@ export function CourseDetail(props) {
|
||||||
</Link>
|
</Link>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).tz('America/Edmonton').format('LT')}</Table.Cell>
|
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).tz('America/Edmonton').format('LT')}</Table.Cell>
|
||||||
<Table.Cell>{x.instructor_name}</Table.Cell>
|
<Table.Cell>{getInstructor(x)}</Table.Cell>
|
||||||
<Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell>
|
<Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,6 +8,14 @@ export const staticUrl = window.location.protocol + '//static.' + window.locatio
|
||||||
export const isAdmin = (user) => user.is_staff || user.member.is_director || user.member.is_staff;
|
export const isAdmin = (user) => user.is_staff || user.member.is_director || user.member.is_staff;
|
||||||
export const isInstructor = (user) => isAdmin(user) || user.member.is_instructor;
|
export const isInstructor = (user) => isAdmin(user) || user.member.is_instructor;
|
||||||
|
|
||||||
|
export const getInstructor = (x) => {
|
||||||
|
if (x.course === 413 || x.course === 317 || x.course === 273) {
|
||||||
|
return 'Protospace';
|
||||||
|
} else {
|
||||||
|
return x.instructor_name;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const statusColor = {
|
export const statusColor = {
|
||||||
'Prepaid': 'green',
|
'Prepaid': 'green',
|
||||||
'Current': 'green',
|
'Current': 'green',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user