Browse Source

feat: add dataset pages for create

tags/v1.21.12.1
colorfulberry 5 years ago
parent
commit
b205fdaeb2
6 changed files with 17 additions and 8 deletions
  1. +2
    -2
      .bra.toml
  2. +2
    -1
      main.go
  3. +7
    -5
      templates/datasets/create.tmpl
  4. +3
    -0
      web_src/less/_dataset.less
  5. +2
    -0
      web_src/less/_form.less
  6. +1
    -0
      web_src/less/index.less

+ 2
- 2
.bra.toml View File

@@ -12,12 +12,12 @@ watch_dirs = [
"$WORKDIR/cmd",
"$WORKDIR/options",
] # Directories to watch
watch_exts = [".go", ".ini"] # Extensions to watch
watch_exts = [".go", ".ini", ".less"] # Extensions to watch
env_files = [] # Load env vars from files
ignore = [".git", "node_modules"] # Directories to exclude from watching
ignore_files = [] # Regexps for ignoring specific notifies
follow_symlinks = false # Enable/disable following symbolic links of sub directories
build_delay = 1500 # Minimal interval to Trigger build event
build_delay = 3000 # Minimal interval to Trigger build event
interrupt_timout = 15 # Time to wait until force kill
graceful_kill = false # Wait for exit and before directly kill
cmds = [ # Commands to run


+ 2
- 1
main.go View File

@@ -11,6 +11,7 @@ import (
"os"
"runtime"
"strings"
"time"

"code.gitea.io/gitea/cmd"
"code.gitea.io/gitea/modules/log"
@@ -38,7 +39,7 @@ var (
)

func init() {
setting.AppVer = Version
setting.AppVer = time.Now().String()
setting.AppBuiltWith = formatBuiltWith()

// Grab the original help templates


+ 7
- 5
templates/datasets/create.tmpl View File

@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="dataset new dataset">
<div class="dataset new">
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
@@ -9,22 +9,24 @@
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
<div class="field">
<div class="inline required field">
<label>{{.i18n.Tr "dataset.title"}}</label>
<input name="title" placeholder="{{.i18n.Tr "dataset.title"}}" value="{{.title}}" autofocus required maxlength="255">
</div>

<div class="field">
<div class="inline required field">
<label>{{.i18n.Tr "dataset.description"}}</label>
<textarea name="description">{{.description}}</textarea>
</div>

<div class="field">
<div class="inline required field">
<label>{{.i18n.Tr "dataset.category"}}</label>
<input name="category" placeholder="{{.i18n.Tr "dataset.category"}}" value="{{.category}}" autofocus required maxlength="255">
</div>

<div class="field">
<br/>

<div class="field required">
<label>{{.i18n.Tr "dataset.file"}}</label>
<div class="files"></div>
<div class="ui dropzone" id="dropzone" data-upload-url="{{AppSubUrl}}/attachments" data-accepts="{{.AttachmentAllowedTypes}}" data-max-file="{{.AttachmentMaxFiles}}" data-max-size="{{.AttachmentMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"></div>


+ 3
- 0
web_src/less/_dataset.less View File

@@ -0,0 +1,3 @@
.dataset {
padding-top: 15px;
}

+ 2
- 0
web_src/less/_form.less View File

@@ -153,7 +153,9 @@
}
}

.dataset,
.repository {
&.new,
&.new.repo,
&.new.migrate,
&.new.fork {


+ 1
- 0
web_src/less/index.less View File

@@ -9,6 +9,7 @@
@import "_install";
@import "_form";
@import "_repository";
@import "_dataset";
@import "_editor";
@import "_organization";
@import "_user";


Loading…
Cancel
Save