summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorHester Gong <hestergong@gmail.com>2023-04-12 20:23:05 +0800
committerGitHub <noreply@github.com>2023-04-12 08:23:05 -0400
commit5482602ba8fc84f716e4742467bc429037f45f88 (patch)
treeaaed2e2733ef0561cd88eb50089513546c3e4882 /templates
parent37d3e0ec336f0fdc2a6f3c4828dd74005d2d9448 (diff)
downloadgitea-5482602ba8fc84f716e4742467bc429037f45f88.tar.gz
gitea-5482602ba8fc84f716e4742467bc429037f45f88.zip
Add cardtype to org/user level project on creation, edit and view (#24043) (#24066)
Backport #24043 Part of #23318 The way to fix the missing cardtype for user/org level projects in this PR is to port the cardtype related part from #22112 to org/user level projects' template and router functions. Before: <img width="1135" alt="截屏2023-04-11 13 55 49" src="https://user-images.githubusercontent.com/17645053/231069068-ba897129-ae90-4aa0-9b0f-468bf5c65375.png"> <img width="1131" alt="截屏2023-04-11 13 55 59" src="https://user-images.githubusercontent.com/17645053/231069084-279f6681-5a10-42da-b5a8-2b0ba47c7078.png"> After: Create <img width="835" alt="截屏2023-04-11 13 27 16" src="https://user-images.githubusercontent.com/17645053/231064445-0d6e12bd-5725-48db-a102-80e7472757c2.png"> Edit <img width="852" alt="截屏2023-04-11 13 27 05" src="https://user-images.githubusercontent.com/17645053/231064503-c70525cd-1038-43ec-8d93-8b8d95d183d4.png"> View <img width="1329" alt="截屏2023-04-11 13 26 56" src="https://user-images.githubusercontent.com/17645053/231064529-26023c85-698b-4b2e-af02-45f9820c77ec.png"> --------- Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/projects/new.tmpl18
-rw-r--r--templates/projects/view.tmpl7
2 files changed, 25 insertions, 0 deletions
diff --git a/templates/projects/new.tmpl b/templates/projects/new.tmpl
index 1314884da6..cb3214c49d 100644
--- a/templates/projects/new.tmpl
+++ b/templates/projects/new.tmpl
@@ -43,6 +43,24 @@
</div>
</div>
{{end}}
+
+ <div class="field">
+ <label>{{.locale.Tr "repo.projects.card_type.desc"}}</label>
+ <div class="ui selection dropdown">
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ {{range $element := .CardTypes}}
+ {{if or (eq $.card_type $element.CardType) (and (not $.PageIsEditProjects) (eq $element.CardType 1))}}
+ <input type="hidden" name="card_type" value="{{$element.CardType}}">
+ <div class="default text">{{$.locale.Tr $element.Translation}}</div>
+ {{end}}
+ {{end}}
+ <div class="menu">
+ {{range $element := .CardTypes}}
+ <div class="item" data-id="{{$element.CardType}}" data-value="{{$element.CardType}}">{{$.locale.Tr $element.Translation}}</div>
+ {{end}}
+ </div>
+ </div>
+ </div>
</div>
<div class="ui container">
<div class="ui divider"></div>
diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl
index c815ec4f6a..c1f52cefd4 100644
--- a/templates/projects/view.tmpl
+++ b/templates/projects/view.tmpl
@@ -175,6 +175,13 @@
<!-- start issue card -->
<div class="card board-card" data-issue="{{.ID}}">
+ {{if eq $.Project.CardType 1}}{{/* Images and Text*/}}
+ <div class="card-attachment-images">
+ {{range (index $.issuesAttachmentMap .ID)}}
+ <img src="{{.DownloadURL}}" alt="{{.Name}}" />
+ {{end}}
+ </div>
+ {{end}}
<div class="content gt-p-0">
<div class="header">
<span class="gt-dif gt-ac gt-vm {{if .IsClosed}}red{{else}}green{{end}}">