Display Protospace as meeting instructor

master
Tanner Collin 4 years ago
parent 04e0bbc7a2
commit edb2128cbf
  1. 6
      webclient/src/Classes.js
  2. 4
      webclient/src/Courses.js
  3. 8
      webclient/src/utils.js

@ -3,7 +3,7 @@ import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-r
import './light.css';
import { Button, Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react';
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 { InstructorClassDetail, InstructorClassAttendance } from './InstructorClasses.js';
import { PayPalPayNow } from './PayPal.js';
@ -35,7 +35,7 @@ function ClassTable(props) {
</Link>
</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.student_count} {!!x.max_students && '/ '+x.max_students}</Table.Cell>
</Table.Row>
@ -171,7 +171,7 @@ export function ClassDetail(props) {
</Table.Row>
<Table.Row>
<Table.Cell>Instructor:</Table.Cell>
<Table.Cell>{clazz.instructor_name}</Table.Cell>
<Table.Cell>{getInstructor(clazz)}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Cost:</Table.Cell>

@ -3,7 +3,7 @@ import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-r
import './light.css';
import { Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react';
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 { InstructorCourseList, InstructorCourseDetail } from './InstructorCourses.js';
import { InstructorClassList } from './InstructorClasses.js';
@ -126,7 +126,7 @@ export function CourseDetail(props) {
</Link>
</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.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 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 = {
'Prepaid': 'green',
'Current': 'green',

Loading…
Cancel
Save