{% extends "projects/base.html" %} {% block title %}{{ project.name }} · 项目库{% endblock %} {% block steps %}
{% for no, label in stages %} 0{{ no }}{{ label }} {% endfor %} 阶段 {{ active_stage }} / 7
{% endblock %} {% block content %}

PROJECT / 0{{ project.stage }} · {{ project.stage_label }}

{{ project.name }}

{{ project.summary|default:"还没有写项目介绍。" }}

{{ project.progress }}% {% if unlocked %} 编辑 {% else %} 解锁编辑 {% endif %}
{% if not unlocked %}
当前是只读模式,可以浏览完整流程;编辑、发布和同步仓库需要解锁。 解锁编辑 →
{% endif %}
{% if active_stage == 1 %}
01 / 需求池

你这次想做什么

先用一句话写下最核心的那条,之后随时可以继续加。独立开发的第一条纪律:需求写在池子里,不要只放在脑子里。

{% if unlocked %}
{% csrf_token %}
{% for quick in quick_requirements %} {% endfor %}
{% endif %}

需求池

{{ req_count }} 条 · 已实现 {{ req_done }}
{% for req in requirements %}
{% if unlocked %}
{% csrf_token %}
{% endif %}
{{ req.text }}
{% if unlocked %}
{% csrf_token %}
{% csrf_token %}
{% else %} {{ req.priority }} {% endif %}
{% empty %}
还没有需求写一句,或者点上面的示例直接加进来。
{% endfor %}
{% if req_count %}共 {{ req_count }} 条需求,其中 {{ req_done }} 条已实现。{% else %}先写一条需求,再往下走。{% endif %}
{% if unlocked %}
{% csrf_token %}
{% endif %}
{% elif active_stage == 2 %}
02 / 方案

先定两件事:用什么写,以及不做什么

一个人做项目,最大的浪费不是选错框架,而是把时间花在“顺便也能做”的功能上。把边界写下来,比写架构图有用。

{% if unlocked %}
{% csrf_token %}

技术选型(可多选)

{{ project.tech_stack|length }} 项
{% for opt in stack_options %} {% endfor %} {% for opt in project.tech_stack %} {% if opt not in stack_options %} {% endif %} {% endfor %}

用一句话说清架构

明确不做的事

每行一条
方案不用完美,写到“明天能开工”就够了。
{% else %}

技术选型

{{ project.tech_stack|length }} 项
{% for opt in project.tech_stack %}{{ opt }}{% empty %}还没有选型。{% endfor %}

架构

{{ project.architecture|default:"还没有写架构说明。"|linebreaksbr }}

明确不做

{% for item in project.non_goals %}
{{ item }}
{% empty %}

还没有写边界。

{% endfor %} {% endif %}
方案不用完美,写到“明天能开工”就够了。
{% if unlocked %}
{% csrf_token %}
{% endif %}
{% elif active_stage == 3 %}
03 / 材料

把手边的东西先放进来

你没有交接对象,但有“三个月后的自己”。材料能少就少:一句话能说清的事,不要写成一页纸。

{% if unlocked %}
{% csrf_token %}
{% for title, kind in quick_materials %} {% endfor %}
{% endif %}

已归档材料

{{ material_count }} 份
{% for material in materials %}
{{ material.kind }} {% if material.url %}{{ material.title }}{% else %}{{ material.title }}{% endif %} {% if material.note %}{{ material.note }}{% endif %} {{ material.created_at|date:"m-d H:i" }} {% if unlocked %}
{% csrf_token %}
{% endif %}
{% empty %}
材料目录是空的一份 PRD、一张草图,先放进来,别留在脑子里。
{% endfor %}
{{ material_count }} 份材料已归档。材料是给未来的自己看的。
{% if unlocked %}
{% csrf_token %}
{% endif %}
{% elif active_stage == 4 %}
04 / 开发

一次只推进一件事

主干开发、小步提交。仓库的提交由 Git 控制,项目库只做只读同步——点“同步仓库”拉取最新记录。

{% if project.repo_name %}
{{ project.branch }} 提交 {{ commit_count }} 分支 {{ branch_count }} ★ {{ project.repo_stars }} {% if project.repo_synced_at %}同步于 {{ project.repo_synced_at|date:"m-d H:i" }}{% else %}尚未同步{% endif %}
打开 {{ project.repo_full_name }} ↗ {% if unlocked %}
{% csrf_token %}
{% endif %} {% if project.repo_private %}私有{% endif %}
提交记录来自 Gitea API;这里不会代替 Git 提交。

最近提交

{{ commit_count }} 次
{% for commit in commits %}
{{ commit.short_sha }}
{{ commit.message|truncatechars:120 }}
{{ commit.author|default:"unknown" }} {{ commit.committed_at|date:"m-d H:i" }} +{{ commit.additions }}−{{ commit.deletions }} {% if commit.files %}{{ commit.files|join:" · "|truncatechars:60 }}{% endif %}
{% empty %}
还没有同步到提交{% if unlocked %}点上面的“同步仓库”,或者等仓库有第一次提交。{% else %}解锁后可以同步仓库。{% endif %}
{% endfor %} {% if branches %}

分支

{% for branch in branches %}{{ branch.name }}{% if branch.is_default %} · default{% endif %}{% endfor %}
{% endif %} {% if repo_releases %}

仓库 Release

最近 {{ repo_releases|length }} 个
{% for release in repo_releases %}
{{ release.tag_name }} {{ release.name|default:release.tag_name }}{% if release.body %}{{ release.body|truncatechars:70 }}{% endif %} {% if release.published_at %}{{ release.published_at|date:"Y-m-d" }}{% endif %}
{% endfor %} {% endif %} {% if unlocked %}

仓库设置

{% csrf_token %}
{% endif %} {% else %}
还没有绑定仓库 可以从本机 Gitea 绑定一个已有仓库,或者让项目库帮你创建一个空仓库。
{% if unlocked %}
{% csrf_token %}
{% if gitea_has_token %}
{% csrf_token %}
{% else %} 未配置 GITEA_TOKEN,不能创建仓库;可以绑定公开仓库。 {% endif %} 从 Gitea 导入已有仓库
{% endif %} {% endif %}
{{ commit_count }} 次提交记录。提交由 Git 控制,项目库只负责看见。
{% if unlocked %}
{% csrf_token %}
{% endif %}
{% elif active_stage == 5 %}
05 / 自测

上线前,先自己当一次用户

没有测试同学,就把这几件事固定成肌肉记忆。项目库里的“自测”是工作流检查,不会真的执行构建或浏览器测试。

{% for test in tests %}
{{ test.name }} {% if test.note %}
{{ test.note }}
{% endif %}
{% if unlocked %}
{% csrf_token %}
{% csrf_token %}
{% endif %} {{ test.get_status_display }}
{% empty %}
还没有自测项添加几条上线前必须亲眼确认的检查。
{% endfor %}
{% if unlocked %}
{% csrf_token %}
{% csrf_token %}
{{ test_passed }} / {{ test_count }} 项通过{% if test_failed %},{{ test_failed }} 项失败{% endif %}
{% endif %}
{% if test_count and test_passed == test_count %}全部通过,可以发布了。{% else %}全部通过后才能发布。{% endif %}
{% if unlocked %}
{% csrf_token %}
{% endif %}
{% elif active_stage == 6 %}
06 / 发布

把“能跑”变成“能用”

一个人的发布也必须可控:留一个能退回去的版本,写一句给用户看的说明,然后按下按钮。

{% if unlocked %}
{% csrf_token %}

发布前确认

3 项
{% for item in release_checklist %} {% endfor %}

给用户看的一句话

{% if release.released_at %}已发布于 {{ release.released_at|date:"Y-m-d H:i" }}{% endif %}
{% else %}

发布方案

版本 {{ release.version|default:"未设置" }} · 环境 {{ release.environment|default:"未设置" }}

{{ release.notes|default:"还没有写更新说明。"|linebreaksbr }}

{% for item in release_checklist %}
{{ item.text }}{% if item.done %} · 已确认{% endif %}
{% endfor %} {% endif %}
{% if release and release.released_at %}
✓ {{ release.version }} 已发布到{{ release.environment }}
// {{ release.released_at|date:"Y-m-d H:i" }}
{% if release.notes %}
{{ release.notes }}
{% endif %} {% else %} // 等待执行 {% endif %}
{% if unlocked %}
{% csrf_token %}
发布会写入右侧活动流。
{% endif %}
发布过程会同步写进右侧活动流。
{% if unlocked %}
{% csrf_token %}
{% endif %}
{% else %}
07 / 完成

做完了。现在只剩一件事:复盘

独立开发最容易跳过的一步。花十分钟看清楚:哪些需求是真的,哪些提交是白写的。

{{ req_count }}
条需求
{{ req_done }}
条已实现
{{ commit_count }}
次提交
{{ material_count }}
份材料

这是你走过的路

{% if req_count %}
需求写下 {{ req_count }} 条需求,实现 {{ req_done }} 条
{% endif %} {% if project.tech_stack %}
选型{{ project.tech_stack|join:" · " }}
{% endif %} {% if project.architecture %}
架构{{ project.architecture }}
{% endif %} {% if project.non_goals %}
边界明确不做 {{ project.non_goals|length }} 件事
{% endif %} {% if material_count %}
材料{{ material_count }} 份归档
{% endif %} {% if commit_count %}
开发{{ commit_count }} 次提交{% if commits %},最后一次:{{ commits.0.message|truncatechars:50 }}{% endif %}
{% endif %} {% if release and release.released_at %}
发布{{ release.version }} → {{ release.environment }}
{% endif %} {% if not req_count and not project.tech_stack and not commit_count %}
这个项目还是空的。回到第 1 步开始吧。
{% endif %}

留下的东西

版本 {{ release.version|default:"未发布" }} 分支 {{ project.branch }} 测试 {{ test_passed }} / {{ test_count }} 未实现需求 {{ req_left }}
导出流程记录 {% if unlocked and not project.is_done %}
{% csrf_token %}
{% endif %} {% if unlocked %}再做下一个{% else %}返回项目库{% endif %}
{% if project.completed_at %}

完成于 {{ project.completed_at|date:"Y-m-d H:i" }}

{% endif %}
记录会保存在项目库里,随时可以回来复盘。
{% endif %}
{% endblock %}