Skip to content

Commit adc0652

Browse files
committed
add labels create.html
1 parent a143a04 commit adc0652

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

db.sqlite3

0 Bytes
Binary file not shown.

task_manager/labels/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from django.db import models
2+
from django.utils.translation import gettext_lazy as _
3+
24

35
class Label(models.Model):
4-
name = models.CharField(max_length=100, unique=True)
5-
created_at = models.DateTimeField(auto_now_add=True)
6+
name = models.CharField(max_length=40, unique=True, null=False)
7+
created_at = models.DateTimeField(_("Creation date"), auto_now_add=True)
68

79
def __str__(self):
810
return self.name
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% extends "task_manager/base.html" %}
2+
3+
{% load django_bootstrap5 %}
4+
{% load i18n %}
5+
6+
{% block title %}{% trans 'Registration' %}{% endblock %}
7+
8+
9+
{% block content %}
10+
<div class="container" style="width: 60%; color: black">
11+
<div class="card bg-light my-5">
12+
<div class="card-header">
13+
<h3>{% translate "Label creation" %}</h3>
14+
</div>
15+
<div class="card-body">
16+
<form class="form" method="post">
17+
{% csrf_token %}
18+
{% bootstrap_form form %}
19+
<button class="btn btn-primary" type="submit">{% translate 'Create' %}</button>
20+
</form>
21+
</div>
22+
</div>
23+
</div>
24+
{% endblock %}

0 commit comments

Comments
 (0)