]> source.dussan.org Git - gitea.git/commitdiff
Fix project card preview select and template select (#23684)
authorZettat123 <zettat123@gmail.com>
Mon, 27 Mar 2023 05:15:41 +0000 (13:15 +0800)
committerGitHub <noreply@github.com>
Mon, 27 Mar 2023 05:15:41 +0000 (13:15 +0800)
Now user cannot set Card Previews when creating a new project.

Before:

https://user-images.githubusercontent.com/15528715/227488883-29bbd636-8b98-45b3-b2f8-de5206b045dc.mp4

After:

https://user-images.githubusercontent.com/15528715/227488976-3447f252-805a-4f18-ae0e-1cddd921dcc3.mp4

templates/projects/new.tmpl
templates/repo/projects/new.tmpl

index e7927221a8104cc3d723ceee4bf778d08e07d9d1..ecb8c745652190a769ca13bd4b4ff7da172338ef 100644 (file)
@@ -38,7 +38,7 @@
                                                        <input type="hidden" name="board_type" value="{{.type}}">
                                                        <div class="default text">{{.locale.Tr "repo.projects.template.desc_helper"}}</div>
                                                        <div class="menu">
-                                                               {{range $element := .ProjectTypes}}
+                                                               {{range $element := .BoardTypes}}
                                                                        <div class="item" data-id="{{$element.BoardType}}" data-value="{{$element.BoardType}}">{{$.locale.Tr $element.Translation}}</div>
                                                                {{end}}
                                                        </div>
index 20c4d2ebfc6414a70ab2e19f579ba60ca33dd485..4778279317620cb4bb40e9c16d3ed3b122e75797 100644 (file)
@@ -54,7 +54,7 @@
                                        <div class="ui selection dropdown">
                                                {{svg "octicon-triangle-down" 14 "dropdown icon"}}
                                                {{range $element := .CardTypes}}
-                                                       {{if or (eq $.card_type $element.CardType) (and (not $.card_type) (eq $element.CardType 2))}}
+                                                       {{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}}