Auto suggest new class times

This commit is contained in:
2022-07-15 03:21:25 +00:00
parent ab1a04d800
commit 41f6969a4a
2 changed files with 80 additions and 1 deletions

View File

@@ -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}>