File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -1228,6 +1228,8 @@ projects.column.new_submit = "Create Column"
1228
1228
projects.column.new = "New Column"
1229
1229
projects.column.set_default = "Set Default"
1230
1230
projects.column.set_default_desc = "Set this column as default for uncategorized issues and pulls"
1231
+ projects.column.unset_default = "Unset Default"
1232
+ projects.column.unset_default_desc = "Unset this column as default"
1231
1233
projects.column.delete = "Delete Column"
1232
1234
projects.column.deletion_desc = "Deleting a project column moves all related issues to ' Uncategorized' . Continue?"
1233
1235
projects.column.color = "Color"
Original file line number Diff line number Diff line change @@ -573,6 +573,23 @@ func SetDefaultProjectBoard(ctx *context.Context) {
573
573
})
574
574
}
575
575
576
+ // UnsetDefaultProjectBoard unset default board for uncategorized issues/pulls
577
+ func UnsetDefaultProjectBoard (ctx * context.Context ) {
578
+ project , _ := CheckProjectBoardChangePermissions (ctx )
579
+ if ctx .Written () {
580
+ return
581
+ }
582
+
583
+ if err := project_model .SetDefaultBoard (project .ID , 0 ); err != nil {
584
+ ctx .ServerError ("SetDefaultBoard" , err )
585
+ return
586
+ }
587
+
588
+ ctx .JSON (http .StatusOK , map [string ]interface {}{
589
+ "ok" : true ,
590
+ })
591
+ }
592
+
576
593
// MoveIssues moves or keeps issues in a column and sorts them inside that column
577
594
func MoveIssues (ctx * context.Context ) {
578
595
if ctx .Doer == nil {
Original file line number Diff line number Diff line change @@ -907,6 +907,7 @@ func RegisterRoutes(m *web.Route) {
907
907
m .Put ("" , web .Bind (forms.EditProjectBoardForm {}), org .EditProjectBoard )
908
908
m .Delete ("" , org .DeleteProjectBoard )
909
909
m .Post ("/default" , org .SetDefaultProjectBoard )
910
+ m .Post ("/unsetdefault" , org .UnsetDefaultProjectBoard )
910
911
911
912
m .Post ("/move" , org .MoveIssues )
912
913
})
Original file line number Diff line number Diff line change 99
99
{{svg "octicon-pin"}}
100
100
{{$.locale.Tr "repo.projects.column.set_default"}}
101
101
</a>
102
+ {{else}}
103
+ <a class="item show-modal button" data-modal="#unset-default-project-board-modal-{{.ID}}">
104
+ {{svg "octicon-pin"}}
105
+ {{$.locale.Tr "repo.projects.column.unset_default"}}
106
+ </a>
102
107
{{end}}
103
108
<a class="item show-modal button" data-modal="#delete-board-modal-{{.ID}}">
104
109
{{svg "octicon-trash"}}
149
154
</div>
150
155
</div>
151
156
157
+ <div class="ui basic modal" id="unset-default-project-board-modal-{{.ID}}">
158
+ <div class="ui icon header">
159
+ {{$.locale.Tr "repo.projects.column.unset_default"}}
160
+ </div>
161
+ <div class="content center">
162
+ <label>
163
+ {{$.locale.Tr "repo.projects.column.unset_default_desc"}}
164
+ </label>
165
+ </div>
166
+ <div class="text right actions">
167
+ <button class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</button>
168
+ <button class="ui red button unset-default-project-board" data-url="{{$.Link}}/{{.ID}}/unsetdefault">{{$.locale.Tr "repo.projects.column.unset_default"}}</button>
169
+ </div>
170
+ </div>
171
+
152
172
<div class="ui basic modal" id="delete-board-modal-{{.ID}}">
153
173
<div class="ui icon header">
154
174
{{$.locale.Tr "repo.projects.column.delete"}}
Original file line number Diff line number Diff line change @@ -141,6 +141,21 @@ export function initRepoProject() {
141
141
window . location . reload ( ) ;
142
142
} ) ;
143
143
144
+ $ ( document ) . on ( 'click' , '.unset-default-project-board' , async function ( e ) {
145
+ e . preventDefault ( ) ;
146
+
147
+ await $ . ajax ( {
148
+ method : 'POST' ,
149
+ url : $ ( this ) . data ( 'url' ) ,
150
+ headers : {
151
+ 'X-Csrf-Token' : csrfToken ,
152
+ } ,
153
+ contentType : 'application/json' ,
154
+ } ) ;
155
+
156
+ window . location . reload ( ) ;
157
+ } ) ;
158
+
144
159
$ ( '.delete-project-board' ) . each ( function ( ) {
145
160
$ ( this ) . click ( function ( e ) {
146
161
e . preventDefault ( ) ;
You can’t perform that action at this time.
0 commit comments