Files
BellScheduler/app/templates/task.html

47 lines
1.9 KiB
HTML

{% extends 'base.html' %}
{% set createdTime = datetime.fromtimestamp(task.created_timestamp) %}
{% set createdTime = datetime.strptime(str(createdTime), '%Y-%m-%d %H:%M:%S') %}
{% block content %}
<span><h1>{% block title %} {{ task.title }} {% endblock %}</h1></span>
<div>
<div>
<div>
<br>
{% if task.description != None %}
{% set description = task.description %}
{% set url_regex = '(https?://[^\s]+)' %}
{% set match = re.search(url_regex, description) %}
{% if match %}
{% set url = match.group(0) %}
{% set rest = description[match.end(0):] %}
<p>{{ description[:match.start(0)] }}<a href="{{ url }}">{{ url }}</a>{{ rest }}</p>
{% else %}
<p>{{ description }}</p>
{% endif %}
{% endif %}
</div>
<div>
<p>Created: {{ createdTime.strftime('%Y-%m-%d %I:%M %p') }} </p>
</div>
<div>
<p>Due: {{ task.due_timestamp }}</p>
</div>
<p>
<a class="btn btn-primary" href="/task/{{task.id}}/edit">Edit Task</a>
<span>
</span>
</p>
<p>
<form method="POST"
action="{{url_for('delete_task',
task_id=task.id) }}">
<input class="btn btn-danger" type="submit" value="Delete Task"
onclick="return confirm('Are you sure you want to delete this task?')">
</form>
</p>
</div>
</div>
{% endblock %}