fix: fix some bugs; evaluate_factor editable in details

This commit is contained in:
raiots 2021-04-10 16:26:44 +08:00
parent a6022a3865
commit 80f3f7f9d8
4 changed files with 10 additions and 5 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
static/* linguist-vendored

View File

@ -1,6 +1,7 @@
from django import forms
from .models import Todo
class LoginForm(forms.Form):
username = forms.CharField(error_messages={'required': '用户名不能为空'})
password = forms.CharField()
@ -12,9 +13,8 @@ class TodoForm(forms.ModelForm):
class Meta:
model = Todo
fields = ['maturity', 'real_work', 'complete_note']
fields = ['maturity', 'real_work', 'evaluate_factor', 'complete_note']
labels ={'text': ''}
widgets = {'rows': '3'}
# TODO 数据不可为空

View File

@ -53,10 +53,10 @@ scratch. This page gets rid of all links and provides the needed markup only.
<a href="{% url 'tasks:tasklist' %}" class="nav-link">年度任务</a>
</li>
<li class="nav-item">
<a href="/admin" class="nav-link">编辑任务</a>
<a href="/admin/#tasks/task" class="nav-link">编辑任务</a>
</li>
<li class="nav-item">
<a href="/admin" class="nav-link">系统配置</a>
<a href="/admin/#users/user" class="nav-link">系统配置</a>
</li>
{# <li class="nav-item dropdown">#}
{# <a id="dropdownSubMenu1" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link dropdown-toggle">统计与分析</a>#}

View File

@ -9,7 +9,7 @@
<div class="container">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"> 我的任务 <small>Example 3.0</small></h1>
<h1 class="m-0"> 我的任务 <small></small></h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
@ -74,6 +74,10 @@
<label for="exampleInputEmail1">实际工作量</label>
{{ form.real_work }}
</div>
<div>
<label for="exampleInputEmail">折算系数</label>
{{ form.evaluate_factor }}
</div>
<div class="form-group">
<label for="exampleInputPassword1">完成情况说明</label>
{{ form.complete_note }}