Auto suggest new class times
This commit is contained in:
@@ -420,6 +420,11 @@ export function InstructorClassList(props) {
|
||||
).sort((a, b) => a.datetime > b.datetime ? 1 : -1));
|
||||
}, [input.datetime]);
|
||||
|
||||
const fillSuggestion = (e) => {
|
||||
e.preventDefault();
|
||||
setInput({ ...input, ...course.suggestion });
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Header size='medium'>Instructor Panel</Header>
|
||||
@@ -434,6 +439,10 @@ export function InstructorClassList(props) {
|
||||
|
||||
<p>Documentation: <a href='https://wiki.protospace.ca/Be_a_Course_Instructor' target='_blank' rel='noopener noreferrer'>https://wiki.protospace.ca/Be_a_Course_Instructor</a></p>
|
||||
|
||||
{course.suggestion &&
|
||||
<p><Button onClick={fillSuggestion}>Suggest</Button> based off previous classes.</p>
|
||||
}
|
||||
|
||||
<InstructorClassEditor input={input} setInput={setInput} error={error} token={token} />
|
||||
|
||||
<Form.Button loading={loading} error={error.non_field_errors}>
|
||||
|
Reference in New Issue
Block a user