|
|
|
@@ -2,62 +2,44 @@ |
|
|
|
{{range .Attachments}} |
|
|
|
<div class="ui grid item" id="{{.UUID}}"> |
|
|
|
<div class="row"> |
|
|
|
<div class="{{if $.Permission.CanWrite $.UnitTypeDatasets}}five{{else}}nine{{end}} wide column"> |
|
|
|
<div class="eight wide column"> |
|
|
|
<span class="ui right">{{.Size | FileSize}}</span> |
|
|
|
<a class="title" href="{{.DownloadURL}}?type={{$.Type}}"> |
|
|
|
<span class="fitted">{{svg "octicon-cloud-download" 16}}</span> {{.Name}} |
|
|
|
{{svg "octicon-cloud-download" 16}} {{.Name}} |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
<div class="two wide column"> |
|
|
|
{{.Size | FileSize}} |
|
|
|
</div> |
|
|
|
<div class="two wide column"> |
|
|
|
<span class="ui text center" data-tooltip='{{$.i18n.Tr "dataset.download_count"}}' data-position="bottom right">{{svg "octicon-flame" 16}} {{(.DownloadCount | PrettyNumber)}}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="one wide column" style="{{if ne $.Type 0}}visibility: hidden;{{end}}"> |
|
|
|
<span class="ui text center clipboard" data-clipboard-text="{{.DownloadURL}}" data-tooltip='{{$.i18n.Tr "dataset.copy_url"}}' data-clipboard-action="copy">{{svg "octicon-file" 16}}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="one wide column"> |
|
|
|
<span class="ui text center clipboard" data-clipboard-text="{{.FileChunk.Md5}}" data-tooltip='{{$.i18n.Tr "dataset.copy_md5"}}' data-clipboard-action="copy">{{svg "octicon-file-binary" 16}}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="wide column one" style="{{if ne .DecompressState 1}}visibility: hidden;{{end}}"> |
|
|
|
<a class="ui text center" href="datasets/dirs/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.directory"}}'>{{svg "octicon-file-directory" 16}}</a> |
|
|
|
</div> |
|
|
|
{{if $.IsSigned}} |
|
|
|
<div class="wide column one" style="{{if ne .DecompressState 1}}visibility: hidden;{{end}}"> |
|
|
|
<a class="ui text center" href="datasets/label/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.create_label_task"}}'><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a> |
|
|
|
<div class="eight wide column right aligned"> |
|
|
|
<div class="ui mini icon buttons" style="margin-right: 10px;"> |
|
|
|
<span class="ui basic button" data-tooltip='{{$.i18n.Tr "dataset.download_count"}}' data-position="bottom right">{{svg "octicon-flame" 16}} {{(.DownloadCount | PrettyNumber)}}</span> |
|
|
|
<span class="ui button" data-clipboard-text="{{.DownloadURL}}" data-tooltip='{{$.i18n.Tr "dataset.copy_url"}}' data-clipboard-action="copy"{{if ne $.Type 0}} style="display:none;"{{end}}>{{svg "octicon-file" 16}}</span> |
|
|
|
<span class="ui button" data-clipboard-text="{{.FileChunk.Md5}}" data-tooltip='{{$.i18n.Tr "dataset.copy_md5"}}' data-clipboard-action="copy">{{svg "octicon-file-binary" 16}}</span> |
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
{{if not .CanDel}} |
|
|
|
<div class="two wide column"> |
|
|
|
<a class="ui button mini" disabled='true'>{{if .IsPrivate}} {{$.i18n.Tr "dataset.private"}} {{else}} {{$.i18n.Tr "dataset.public"}} {{end}}</a> |
|
|
|
<div class="ui mini icon buttons" style="margin-right: 10px;"> |
|
|
|
<a class="ui basic{{if ne .DecompressState 1}} disabled{{else}} blue{{end}} button" href="datasets/dirs/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.directory"}}'>{{svg "octicon-file-directory" 16}}</a> |
|
|
|
{{if $.IsSigned}} |
|
|
|
<a class="ui blue basic{{if ne .DecompressState 1}} disabled{{else}} blue{{end}}{{end}} button" href="datasets/label/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.create_label_task"}}'>{{svg "octicon-pencil" 16}}</a> |
|
|
|
{{end}} |
|
|
|
</div> |
|
|
|
{{else}} |
|
|
|
{{if $.Permission.CanWrite $.UnitTypeDatasets}} |
|
|
|
{{if $.Repository.IsPrivate}} |
|
|
|
<div class="two wide column"> |
|
|
|
<a class="ui button mini" disabled='true' data-tooltip='{{$.i18n.Tr "dataset.how_to_public"}}'>{{$.i18n.Tr "dataset.private"}}</a> |
|
|
|
</div> |
|
|
|
{{ else }} |
|
|
|
<div class="two wide column"> |
|
|
|
<div class="ui buttons mini"> |
|
|
|
<a class="ui button mini {{if .IsPrivate}}positive active{{end}}" href="javascript:void(0)" data-dataset-status="true-{{.UUID}}" data-csrf="{{$.CsrfToken}}" data-url="{{AppSubUrl}}/attachments/private" data-uuid={{.UUID}} data-private="true" data-is-private={{.IsPrivate}}>{{$.i18n.Tr "dataset.private"}}</a> |
|
|
|
{{if not .CanDel}} |
|
|
|
<a class="ui right small button" disabled='true'>{{if .IsPrivate}} {{$.i18n.Tr "dataset.private"}} {{else}} {{$.i18n.Tr "dataset.public"}} {{end}}</a> |
|
|
|
{{else}} |
|
|
|
{{if $.Permission.CanWrite $.UnitTypeDatasets}} |
|
|
|
{{if $.Repository.IsPrivate}} |
|
|
|
<a class="ui small button" disabled='true' data-tooltip='{{$.i18n.Tr "dataset.how_to_public"}}'>{{$.i18n.Tr "dataset.private"}}</a> |
|
|
|
{{else}} |
|
|
|
<div class="compact small ui buttons" style="margin-right: 10px;"> |
|
|
|
<a class="ui button{{if .IsPrivate}} positive active{{end}}" href="javascript:void(0)" data-dataset-status="true-{{.UUID}}" data-csrf="{{$.CsrfToken}}" data-url="{{AppSubUrl}}/attachments/private" data-uuid={{.UUID}} data-private="true" data-is-private={{.IsPrivate}}>{{$.i18n.Tr "dataset.private"}}</a> |
|
|
|
<div class="or"></div> |
|
|
|
<a class="ui button mini {{if not .IsPrivate}}positive active{{end}}" href="javascript:void(0)" data-dataset-status="false-{{.UUID}}" data-csrf="{{$.CsrfToken}}" data-url="{{AppSubUrl}}/attachments/private" data-uuid={{.UUID}} data-private="false" data-is-private={{.IsPrivate}}>{{$.i18n.Tr "dataset.public"}}</a> |
|
|
|
<a class="ui button{{if not .IsPrivate}} positive active{{end}}" href="javascript:void(0)" data-dataset-status="false-{{.UUID}}" data-csrf="{{$.CsrfToken}}" data-url="{{AppSubUrl}}/attachments/private" data-uuid={{.UUID}} data-private="false" data-is-private={{.IsPrivate}}>{{$.i18n.Tr "dataset.public"}}</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
<a class="ui right small red button" href="javascript:void(0)" data-uuid={{.UUID}} data-dataset-delete data-remove-url="{{AppSubUrl}}/attachments/delete" data-csrf="{{$.CsrfToken}}">{{$.i18n.Tr "dataset.delete"}}</a> |
|
|
|
{{else}} |
|
|
|
<a class="ui small button" disabled='true'>{{if .IsPrivate}} {{$.i18n.Tr "dataset.private"}} {{else}} {{$.i18n.Tr "dataset.public"}} {{end}}</a> |
|
|
|
{{end}} |
|
|
|
<div class="two wide column right aligned"> |
|
|
|
<a class="ui red button mini" href="javascript:void(0)" data-uuid={{.UUID}} data-dataset-delete data-remove-url="{{AppSubUrl}}/attachments/delete" data-csrf="{{$.CsrfToken}}">{{$.i18n.Tr "dataset.delete"}}</a> |
|
|
|
</div> |
|
|
|
{{else}} |
|
|
|
<div class="two wide column"> |
|
|
|
<a class="ui button mini" disabled='true'>{{if .IsPrivate}} {{$.i18n.Tr "dataset.private"}} {{else}} {{$.i18n.Tr "dataset.public"}} {{end}}</a> |
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
|