-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
developed CreateTaskForm and frontend functionality
- Loading branch information
1 parent
a046ba3
commit 85d59cf
Showing
5 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from flask_wtf import FlaskForm | ||
from wtforms import StringField, SubmitField, SelectField | ||
from wtforms.validators import DataRequired | ||
|
||
from src.config import TaskStatus | ||
|
||
|
||
class AddTaskForm(FlaskForm): | ||
|
||
title = StringField("Title:", validators=[DataRequired()]) | ||
description = StringField("Description:", validators=[DataRequired()]) | ||
status = SelectField( | ||
"Status:", | ||
choices=[(status.value, status.value) for status in TaskStatus], | ||
validators=[DataRequired()] | ||
) | ||
submit = SubmitField("Create Task") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<style> | ||
/* Full-page background image */ | ||
body { | ||
background-image: url("{{ url_for('static', filename='img/background.png') }}"); | ||
background-size: cover; | ||
background-position: center; | ||
background-attachment: fixed; | ||
} | ||
</style> | ||
|
||
<div class="d-flex justify-content-center align-items-center" style="min-height: 90vh;"> | ||
<div class="card p-4" style="width: 700px; border-radius: 15px; box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);"> | ||
<div class="text-center mb-4"> | ||
<h2 class="mt-2" style="font-family: 'Lobster', cursive; font-size: 2rem; color: #333;">Add a Task to Your ToDo List</h2> | ||
</div> | ||
<form method="POST" action="{{ url_for('add_task', user_id=user_id) }}"> | ||
{{ form.hidden_tag() }} | ||
<div class="form-group"> | ||
{{ form.title.label }} | ||
{{ form.title(class="form-control") }} | ||
</div> | ||
<div class="form-group"> | ||
{{ form.description.label }} | ||
{{ form.description(class="form-control") }} | ||
</div> | ||
<div class="form-group"> | ||
{{ form.status.label }} | ||
{{ form.status(class="form-control") }} | ||
</div> | ||
<div class="text-center"> | ||
<button type="submit" class="btn btn-primary btn-thin mt-4">Create Task</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
{% endblock %} |