| @@ -1389,6 +1389,7 @@ issues.filter_sort.feweststars = Fewest stars | |||
| issues.filter_sort.mostforks = Most forks | |||
| issues.filter_sort.fewestforks = Fewest forks | |||
| issues.filter_sort.downloadtimes = Most downloaded | |||
| issues.filter_sort.moststars = Most star | |||
| issues.action_open = Open | |||
| issues.action_close = Close | |||
| issues.action_label = Label | |||
| @@ -1401,6 +1401,7 @@ issues.filter_sort.feweststars=点赞由少到多 | |||
| issues.filter_sort.mostforks=派生由多到少 | |||
| issues.filter_sort.fewestforks=派生由少到多 | |||
| issues.filter_sort.downloadtimes=下载次数 | |||
| issues.filter_sort.moststars=收藏数量 | |||
| issues.action_open=开启 | |||
| issues.action_close=关闭 | |||
| issues.action_label=标签 | |||
| @@ -27,7 +27,7 @@ | |||
| <td><a href="{{AppSubUrl}}/">{{.Title}}</a></td> | |||
| <td><i class="fa fa{{if .IsPrivate}}-check{{end}}-square-o"></i></td> | |||
| <td><span title="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</span></td> | |||
| <td></td> | |||
| <td>{{if .Recommend}}<span class="set_dataset" style="color: rgb(250, 140, 22);cursor: pointer;" data-url="{{$.Link}}/{{.ID}}/action/unrecommend">取消推荐</span>{{else}}<span class="set_dataset" style="color: rgb(19, 194, 141);cursor: pointer;" data-url="{{$.Link}}/{{.ID}}/action/recommend">设为推荐</span>{{end}}</td> | |||
| </tr> | |||
| {{end}} | |||
| </tbody> | |||
| @@ -37,16 +37,35 @@ | |||
| {{template "base/paginate" .}} | |||
| </div> | |||
| </div> | |||
| <div class="ui small basic delete modal"> | |||
| <div class="ui icon header"> | |||
| <i class="trash icon"></i> | |||
| {{.i18n.Tr "dataset.settings.delete"}} | |||
| </div> | |||
| <div class="content"> | |||
| <p>{{.i18n.Tr "dataset.settings.delete_desc"}}</p> | |||
| {{.i18n.Tr "dataset.settings.delete_notices_2" `<span class="name"></span>` | Safe}}<br> | |||
| </div> | |||
| {{template "base/delete_modal_actions" .}} | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| console.log({{.Datasets}}) | |||
| $('.set_dataset').on('click', function(){ | |||
| const $this = $(this); | |||
| let link = $this.data('url') | |||
| console.log("111111") | |||
| $.ajax({ | |||
| url:link, | |||
| type:'PUT', | |||
| success:function(res){ | |||
| console.log(res) | |||
| }, | |||
| error: function(xhr){ | |||
| // 隐藏 loading | |||
| // 只有请求不正常(状态码不为200)才会执行 | |||
| // $('.ui.negative.message').html(xhr.responseText).show().delay(1500).fadeOut(); | |||
| console.log(xhr) | |||
| }, | |||
| complete:function(xhr){ | |||
| // $("#mask").css({"display":"none","z-index":"1"}) | |||
| } | |||
| }) | |||
| // $.put($this.data('url'), { | |||
| // }).done((data) => { | |||
| // console.log(data) | |||
| // // window.location.href = data.redirect; | |||
| // }); | |||
| }); | |||
| </script> | |||
| @@ -44,7 +44,7 @@ | |||
| <td>{{.NumIssues}}</td> | |||
| <td>{{SizeFmt .Size}}</td> | |||
| <td><span title="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</span></td> | |||
| <td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.ID}}" data-name="{{.Name}}"><i class="trash icon text red"></i></a></td> | |||
| <td><a class="delete-button1" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.ID}}" data-name="{{.Name}}"><i class="trash icon text red"></i></a></td> | |||
| </tr> | |||
| {{end}} | |||
| </tbody> | |||
| @@ -68,3 +68,38 @@ | |||
| {{template "base/delete_modal_actions" .}} | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| $('.delete-button1').on('click', showDeletePopup); | |||
| function showDeletePopup() { | |||
| const $this = $(this); | |||
| let filter = ''; | |||
| if ($this.attr('id')) { | |||
| filter += `#${$this.attr('id')}`; | |||
| } | |||
| const dialog = $(`.delete.modal${filter}`); | |||
| console.log(`.delete.modal${filter}`,dialog) | |||
| dialog.find('.name').text($this.data('name')); | |||
| console.log(dialog.find('.name')) | |||
| dialog | |||
| .modal({ | |||
| closable: false, | |||
| onApprove() { | |||
| if ($this.data('type') === 'form') { | |||
| $($this.data('form')).trigger('submit'); | |||
| return; | |||
| } | |||
| $.post($this.data('url'), { | |||
| _csrf: csrf, | |||
| id: $this.data('id') | |||
| }).done((data) => { | |||
| window.location.href = data.redirect; | |||
| }); | |||
| } | |||
| }) | |||
| .modal('show'); | |||
| return false; | |||
| } | |||
| </script> | |||
| @@ -125,7 +125,8 @@ | |||
| <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> | |||
| <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> | |||
| <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> | |||
| <!-- <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item" href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a> --> | |||
| <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item" href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a> | |||
| <a class="{{if eq .SortType "moststars"}}active{{end}} item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.issues.filter_sort.moststars"}}</a> | |||
| </div> | |||
| </div> | |||
| </div> | |||