File tree 4 files changed +24
-20
lines changed
4 files changed +24
-20
lines changed Original file line number Diff line number Diff line change 1
1
<div class="actions">
2
- <button class="ui red cancel button">
2
+ <button class="ui red cancel button cancel-button ">
3
3
{{svg "octicon-x"}}
4
4
{{if .ModalNoText}}{{.ModalNoText}}{{else}}{{.locale.Tr "modal.no"}}{{end}}
5
5
</button>
6
- <button class="ui green ok button{{if .ExtendedClasses}} {{.ExtendedClasses}}{{end}}" {{if .DataUrl}}data-url="{{.DataUrl}}"{{end}} >
6
+ <button class="ui green ok button confirm-button" >
7
7
{{svg "octicon-check"}}
8
8
{{if .ModalYesText}}{{.ModalYesText}}{{else}}{{.locale.Tr "modal.yes"}}{{end}}
9
9
</button>
Original file line number Diff line number Diff line change 115
115
{{$.locale.Tr "repo.projects.column.unset_default"}}
116
116
</a>
117
117
{{end}}
118
- <a class="item show-modal button" data-modal="#delete-board-modal-{{.ID}}">
118
+ <a class="item show-modal button show-delete-column-modal"
119
+ data-modal="#delete-board-modal-{{.ID}}"
120
+ data-url="{{$.Link}}/{{.ID}}"
121
+ >
119
122
{{svg "octicon-trash"}}
120
123
{{$.locale.Tr "repo.projects.column.delete"}}
121
124
</a>
171
174
{{$.locale.Tr "repo.projects.column.deletion_desc"}}
172
175
</label>
173
176
</div>
174
- <div class="text right actions">
175
- {{$DataUrl := printf "%s/%d" $.Link .ID}}
176
- {{$ModalNoText := $.locale.Tr "settings.cancel"}}
177
- {{$ModalYesText := $.locale.Tr "repo.projects.column.delete"}}
178
- {{template "base/page_dimmer_buttons" (dict "." $ "ExtendedClasses" "delete-project-board" "DataUrl" $DataUrl "ModalNoText" $ModalNoText "ModalYesText" $ModalYesText)}}
179
- </div>
177
+ {{$ModalNoText := $.locale.Tr "settings.cancel"}}
178
+ {{$ModalYesText := $.locale.Tr "repo.projects.column.delete"}}
179
+ {{template "base/page_dimmer_buttons" (dict "." $ "ModalNoText" $ModalNoText "ModalYesText" $ModalYesText)}}
180
180
</div>
181
181
</div>
182
182
</div>
Original file line number Diff line number Diff line change 121
121
{{$.locale.Tr "repo.projects.column.unset_default"}}
122
122
</a>
123
123
{{end}}
124
- <a class="item show-modal button" data-modal="#delete-board-modal-{{.ID}}">
124
+ <a class="item show-modal button show-delete-column-modal"
125
+ data-modal="#delete-board-modal-{{.ID}}"
126
+ data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}"
127
+ >
125
128
{{svg "octicon-trash"}}
126
129
{{$.locale.Tr "repo.projects.column.delete"}}
127
130
</a>
177
180
{{$.locale.Tr "repo.projects.column.deletion_desc"}}
178
181
</label>
179
182
</div>
180
- <div class="text right actions">
181
- {{$DataUrl := printf "%s/projects/%d/%d" $.RepoLink $.Project.ID .ID}}
182
- {{$ModalNoText := $.locale.Tr "settings.cancel"}}
183
- {{$ModalYesText := $.locale.Tr "repo.projects.column.delete"}}
184
- {{template "base/page_dimmer_buttons" (dict "." $ "ExtendedClasses" "delete-project-board" "DataUrl" $DataUrl "ModalNoText" $ModalNoText "ModalYesText" $ModalYesText)}}
185
- </div>
183
+ {{$ModalNoText := $.locale.Tr "settings.cancel"}}
184
+ {{$ModalYesText := $.locale.Tr "repo.projects.column.delete"}}
185
+ {{template "base/page_dimmer_buttons" (dict "." $ "ModalNoText" $ModalNoText "ModalYesText" $ModalYesText)}}
186
186
</div>
187
187
</div>
188
188
</div>
Original file line number Diff line number Diff line change @@ -147,12 +147,16 @@ export function initRepoProject() {
147
147
} ) ;
148
148
} ) ;
149
149
150
- $ ( '.delete-project-board' ) . each ( function ( ) {
151
- $ ( this ) . click ( function ( e ) {
150
+ $ ( '.show-delete-column-modal' ) . each ( function ( ) {
151
+ const deleteColumnModal = $ ( `${ $ ( this ) . attr ( 'data-modal' ) } ` ) ;
152
+ const deleteColumnButton = deleteColumnModal . find ( '.confirm-button' ) ;
153
+ const deleteUrl = $ ( this ) . attr ( 'data-url' ) ;
154
+
155
+ deleteColumnButton . on ( 'click' , function ( e ) {
152
156
e . preventDefault ( ) ;
153
157
154
158
$ . ajax ( {
155
- url : $ ( this ) . data ( 'url' ) ,
159
+ url : deleteUrl ,
156
160
headers : {
157
161
'X-Csrf-Token' : csrfToken ,
158
162
} ,
@@ -162,7 +166,7 @@ export function initRepoProject() {
162
166
window . location . reload ( ) ;
163
167
} ) ;
164
168
} ) ;
165
- } ) ;
169
+ } )
166
170
167
171
$ ( '#new_board_submit' ) . click ( function ( e ) {
168
172
e . preventDefault ( ) ;
You can’t perform that action at this time.
0 commit comments