Browse Source

feat: add I18n and the pages for update edit

tags/v1.21.12.1
colorfulberry 5 years ago
parent
commit
f963c12250
5 changed files with 11 additions and 3 deletions
  1. +2
    -0
      options/locale/locale_en-US.ini
  2. +2
    -0
      options/locale/locale_zh-CN.ini
  3. +1
    -1
      routers/repo/dataset.go
  4. +3
    -2
      templates/repo/datasets/index.tmpl
  5. +3
    -0
      web_src/js/index.js

+ 2
- 0
options/locale/locale_en-US.ini View File

@@ -692,6 +692,8 @@ category.computer_vision= computer vision
category.natural_language_processing= natural language processing category.natural_language_processing= natural language processing
category.speech_processing= speech processing category.speech_processing= speech processing
category.computer_vision_natural_language_processing= computer vision and natural language processing category.computer_vision_natural_language_processing= computer vision and natural language processing
attachment.delete= delete this version of dataset
attachment.desc= Are you sure you will delete this version of dataset, once deelted can not be recovery


[repo] [repo]
owner = Owner owner = Owner


+ 2
- 0
options/locale/locale_zh-CN.ini View File

@@ -692,6 +692,8 @@ category.computer_vision=计算机视觉
category.natural_language_processing=自然语言处理 category.natural_language_processing=自然语言处理
category.speech_processing=语音处理 category.speech_processing=语音处理
category.computer_vision_natural_language_processing=计算机视觉、自然语言处理 category.computer_vision_natural_language_processing=计算机视觉、自然语言处理
attachment.delete= 删除该版本的数据集
attachment.desc= 你确定要删除该版本的数据集么?一旦删除不能恢复。


[repo] [repo]
owner=拥有者 owner=拥有者


+ 1
- 1
routers/repo/dataset.go View File

@@ -91,7 +91,7 @@ func EditDatasetPost(ctx *context.Context, form auth.EditDatasetForm) {


ctx.Data["Title"] = ctx.Tr("dataset.edit_dataset") ctx.Data["Title"] = ctx.Tr("dataset.edit_dataset")


rel, err := models.GetDatasetByID(5)
rel, err := models.GetDatasetByID(form.ID)
ctx.Data["dataset"] = rel ctx.Data["dataset"] = rel


if err != nil { if err != nil {


+ 3
- 2
templates/repo/datasets/index.tmpl View File

@@ -2,6 +2,7 @@
<div class="repository release dataset-list view"> <div class="repository release dataset-list view">
{{template "repo/header" .}} {{template "repo/header" .}}
<form class="ui container" action="{{.Link}}" method="post"> <form class="ui container" action="{{.Link}}" method="post">
<input name="id" value="{{.dataset.ID}}" type="hidden" />
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
{{template "base/alert" .}} {{template "base/alert" .}}
<div class="ui two column stackable grid {{if .Error}}hide{{end}}" id="dataset-content"> <div class="ui two column stackable grid {{if .Error}}hide{{end}}" id="dataset-content">
@@ -78,10 +79,10 @@
<div class="ui small basic delete modal" id="data-dataset-delete-modal"> <div class="ui small basic delete modal" id="data-dataset-delete-modal">
<div class="ui icon header"> <div class="ui icon header">
<i class="trash icon"></i> <i class="trash icon"></i>
删除分支
{{.i18n.Tr "dataset.attachment.delete"}}
</div> </div>
<div class="content"> <div class="content">
<p>{{.i18n.Tr "repo.branch.delete_desc" | Str2html}}</p>
<p>{{.i18n.Tr "dataset.attachment.delete_desc" | Str2html}}</p>
</div> </div>
{{template "base/delete_modal_actions" .}} {{template "base/delete_modal_actions" .}}
</div> </div>


+ 3
- 0
web_src/js/index.js View File

@@ -2397,6 +2397,9 @@ $(document).ready(async () => {
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid); const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
$('.files').append(input); $('.files').append(input);
}); });
this.on('queuecomplete', () => {
window.location.realod();
});
this.on('removedfile', (file) => { this.on('removedfile', (file) => {
if (file.name in filenameDict) { if (file.name in filenameDict) {
$(`#${filenameDict[file.name]}`).remove(); $(`#${filenameDict[file.name]}`).remove();


Loading…
Cancel
Save