feat: 项目库上线(七阶段流程 + Gitea 同步 + 首页入口)
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import (
|
||||
Project,
|
||||
ProjectEvent,
|
||||
ProjectMaterial,
|
||||
ProjectRelease,
|
||||
ProjectRequirement,
|
||||
ProjectTest,
|
||||
RepoBranch,
|
||||
RepoCommit,
|
||||
RepoRelease,
|
||||
)
|
||||
|
||||
|
||||
@admin.register(Project)
|
||||
class ProjectAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "stage", "repo_full_name", "updated_at", "completed_at")
|
||||
list_filter = ("stage", "repo_private")
|
||||
search_fields = ("name", "summary", "repo_name")
|
||||
prepopulated_fields = {"slug": ("name",)}
|
||||
|
||||
|
||||
@admin.register(ProjectRequirement)
|
||||
class RequirementAdmin(admin.ModelAdmin):
|
||||
list_display = ("text", "project", "priority", "done")
|
||||
list_filter = ("priority", "done")
|
||||
|
||||
|
||||
@admin.register(ProjectMaterial)
|
||||
class MaterialAdmin(admin.ModelAdmin):
|
||||
list_display = ("title", "project", "kind", "created_at")
|
||||
list_filter = ("kind",)
|
||||
|
||||
|
||||
@admin.register(ProjectTest)
|
||||
class TestAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "project", "status")
|
||||
list_filter = ("status",)
|
||||
|
||||
|
||||
@admin.register(ProjectRelease)
|
||||
class ReleaseAdmin(admin.ModelAdmin):
|
||||
list_display = ("version", "project", "environment", "released_at")
|
||||
|
||||
|
||||
@admin.register(ProjectEvent)
|
||||
class EventAdmin(admin.ModelAdmin):
|
||||
list_display = ("text", "project", "kind", "created_at")
|
||||
list_filter = ("kind",)
|
||||
|
||||
|
||||
@admin.register(RepoCommit)
|
||||
class CommitAdmin(admin.ModelAdmin):
|
||||
list_display = ("short_sha", "project", "author", "committed_at")
|
||||
search_fields = ("sha", "message", "author")
|
||||
|
||||
|
||||
@admin.register(RepoBranch)
|
||||
class BranchAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "project", "is_default")
|
||||
|
||||
|
||||
@admin.register(RepoRelease)
|
||||
class RepoReleaseAdmin(admin.ModelAdmin):
|
||||
list_display = ("tag_name", "project", "published_at")
|
||||
Reference in New Issue
Block a user