| @@ -31,4 +31,5 @@ type EditDatasetForm struct { | |||||
| Private bool | Private bool | ||||
| ReleaseID int64 `xorm:"INDEX"` | ReleaseID int64 `xorm:"INDEX"` | ||||
| Files []string | Files []string | ||||
| Type string `binding:"Required"` | |||||
| } | } | ||||
| @@ -49,6 +49,12 @@ func DatasetIndex(ctx *context.Context) { | |||||
| ctx.NotFound("GetDatasetByRepo", err) | ctx.NotFound("GetDatasetByRepo", err) | ||||
| return | return | ||||
| } | } | ||||
| if ctx.Query("type") == "" { | |||||
| log.Error("not found param type") | |||||
| ctx.NotFound("type error", nil) | |||||
| return | |||||
| } | |||||
| err = models.GetDatasetAttachments(ctx.QueryInt("type"), dataset) | err = models.GetDatasetAttachments(ctx.QueryInt("type"), dataset) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("GetDatasetAttachments", err) | ctx.ServerError("GetDatasetAttachments", err) | ||||
| @@ -116,5 +122,5 @@ func EditDatasetPost(ctx *context.Context, form auth.EditDatasetForm) { | |||||
| ctx.HTML(200, tplIndex) | ctx.HTML(200, tplIndex) | ||||
| log.Error("%v", err) | log.Error("%v", err) | ||||
| } | } | ||||
| ctx.Redirect(ctx.Repo.RepoLink + "/datasets") | |||||
| ctx.Redirect(ctx.Repo.RepoLink + "/datasets?type=" + form.Type) | |||||
| } | } | ||||
| @@ -55,6 +55,7 @@ | |||||
| <div class="sixteen wide column"> | <div class="sixteen wide column"> | ||||
| <textarea name="description" rows="3">{{.dataset.Description}}</textarea> | <textarea name="description" rows="3">{{.dataset.Description}}</textarea> | ||||
| </div> | </div> | ||||
| <input name="type" value="{{.Type}}" type="hidden" /> | |||||
| <div class="sixteen wide column"> | <div class="sixteen wide column"> | ||||
| <a class="ui button" id="cancel">{{.i18n.Tr "cancel"}}</a> | <a class="ui button" id="cancel">{{.i18n.Tr "cancel"}}</a> | ||||
| <button class="ui primary button" id="submit">{{.i18n.Tr "dataset.update_dataset"}}</button> | <button class="ui primary button" id="submit">{{.i18n.Tr "dataset.update_dataset"}}</button> | ||||