Skip to content

Commit

Permalink
Added cancel and repeat buttons to task add
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mortimer committed Sep 28, 2016
1 parent f3233eb commit 8dd15ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion controller/app/mod_tasks/controllers.py
Expand Up @@ -58,7 +58,12 @@ def add_tasks():
return render_template('tasks/add.html',
form=form,
error=result)
return redirect(url_for('tasks.get_tasks'))

print(request.form['submit'])
if request.form['submit'] == 'Add':
return redirect(url_for('tasks.get_tasks'))
elif request.form['submit'] == 'Repeat':
return redirect(url_for('tasks.add_tasks'))

return render_template('tasks/add.html', form=form)

Expand Down
4 changes: 3 additions & 1 deletion controller/app/templates/tasks/add.html
Expand Up @@ -114,7 +114,9 @@
<div class="form-group">
<div class="col-sm-2"></div>
<div class="col-sm-3">
<input type="submit" class="btn btn-primary" category="submit" value="Add"></input>
<input type="button" class="btn-xs btn-danger" value="Cancel" onclick="location.href = '{{ url_for('tasks.get_tasks') }}';">
<input type="submit" name="submit" class="btn-xs btn-primary" category="submit" value="Repeat"></input>
<input type="submit" name="submit" class="btn-xs btn-primary" category="submit" value="Add"></input>
</div>
</div>

Expand Down

0 comments on commit 8dd15ad

Please sign in to comment.