File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -575,6 +575,23 @@ func SetDefaultProjectBoard(ctx *context.Context) {
575
575
})
576
576
}
577
577
578
+ // UnSetDefaultProjectBoard unset default board for uncategorized issues/pulls
579
+ func UnSetDefaultProjectBoard (ctx * context.Context ) {
580
+ project , _ := checkProjectBoardChangePermissions (ctx )
581
+ if ctx .Written () {
582
+ return
583
+ }
584
+
585
+ if err := project_model .SetDefaultBoard (project .ID , 0 ); err != nil {
586
+ ctx .ServerError ("SetDefaultBoard" , err )
587
+ return
588
+ }
589
+
590
+ ctx .JSON (http .StatusOK , map [string ]interface {}{
591
+ "ok" : true ,
592
+ })
593
+ }
594
+
578
595
// MoveIssues moves or keeps issues in a column and sorts them inside that column
579
596
func MoveIssues (ctx * context.Context ) {
580
597
if ctx .Doer == nil {
Original file line number Diff line number Diff line change @@ -1246,7 +1246,7 @@ func RegisterRoutes(m *web.Route) {
1246
1246
m .Group ("/projects" , func () {
1247
1247
m .Get ("" , repo .Projects )
1248
1248
m .Get ("/{id}" , repo .ViewProject )
1249
- m .Group ("" , func () { //nolint:dupl
1249
+ m .Group ("" , func () {
1250
1250
m .Get ("/new" , repo .NewProject )
1251
1251
m .Post ("/new" , web .Bind (forms.CreateProjectForm {}), repo .NewProjectPost )
1252
1252
m .Group ("/{id}" , func () {
@@ -1261,6 +1261,7 @@ func RegisterRoutes(m *web.Route) {
1261
1261
m .Put ("" , web .Bind (forms.EditProjectBoardForm {}), repo .EditProjectBoard )
1262
1262
m .Delete ("" , repo .DeleteProjectBoard )
1263
1263
m .Post ("/default" , repo .SetDefaultProjectBoard )
1264
+ m .Post ("/unsetdefault" , repo .UnSetDefaultProjectBoard )
1264
1265
1265
1266
m .Post ("/move" , repo .MoveIssues )
1266
1267
})
Original file line number Diff line number Diff line change 103
103
{{svg "octicon-pin"}}
104
104
{{$.locale.Tr "repo.projects.column.set_default"}}
105
105
</a>
106
+ {{else}}
107
+ <a class="item show-modal button" data-modal="#unset-default-project-board-modal-{{.ID}}">
108
+ {{svg "octicon-pin"}}
109
+ {{$.locale.Tr "repo.projects.column.unset_default"}}
110
+ </a>
106
111
{{end}}
107
112
<a class="item show-modal button" data-modal="#delete-board-modal-{{.ID}}">
108
113
{{svg "octicon-trash"}}
153
158
</div>
154
159
</div>
155
160
161
+ <div class="ui basic modal" id="unset-default-project-board-modal-{{.ID}}">
162
+ <div class="ui icon header">
163
+ {{$.locale.Tr "repo.projects.column.unset_default"}}
164
+ </div>
165
+ <div class="content center">
166
+ <label>
167
+ {{$.locale.Tr "repo.projects.column.unset_default_desc"}}
168
+ </label>
169
+ </div>
170
+ <div class="text right actions">
171
+ <button class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</button>
172
+ <button class="ui red button unset-default-project-board" data-url="{{$.Link}}/{{.ID}}/unsetdefault">{{$.locale.Tr "repo.projects.column.unset_default"}}</button>
173
+ </div>
174
+ </div>
175
+
156
176
<div class="ui basic modal" id="delete-board-modal-{{.ID}}">
157
177
<div class="ui icon header">
158
178
{{$.locale.Tr "repo.projects.column.delete"}}
You can’t perform that action at this time.
0 commit comments