summaryrefslogtreecommitdiffstats
path: root/templates/repo/create.tmpl
blob: 07a9c0919d2c83419fdc218dadf7bcbb84c5749c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{{template "base/head" .}}
<div class="repository new repo">
  <div class="ui middle very relaxed page grid">
    <div class="column">
      <form class="ui form" action="{{.Link}}" method="post">
        {{.CsrfTokenHtml}}
        <h3 class="ui top attached header">
          {{.i18n.Tr "new_repo"}}
        </h3>
        <div class="ui attached segment">
          {{template "base/alert" .}}
          <div class="inline required field {{if .Err_Owner}}error{{end}}">
            <label>{{.i18n.Tr "repo.owner"}}</label>
            <div class="ui selection owner dropdown">
              <input type="hidden" id="uid" name="uid" value="{{.ContextUser.Id}}" required>
              <span class="text">
                <img class="ui mini image" src="{{.ContextUser.AvatarLink}}">
                {{.ContextUser.ShortName 20}}
              </span>
              <i class="dropdown icon"></i>
              <div class="menu">
                <div class="item" data-value="{{.SignedUser.Id}}">
                  <img class="ui mini image" src="{{.SignedUser.AvatarLink}}">
                  {{.SignedUser.ShortName 20}}
                </div>
                {{range .Orgs}}
                <div class="item" data-value="{{.Id}}">
                  <img class="ui mini image" src="{{.AvatarLink}}">
                  {{.ShortName 20}}
                </div>
                {{end}}
              </div>
            </div>
          </div>

          <div class="inline required field {{if .Err_RepoName}}error{{end}}">
            <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
            <input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required>
            <span class="help">{{.i18n.Tr "repo.repo_name_helper" | Safe}}</span>
          </div>
          <div class="inline field">
            <label>{{.i18n.Tr "repo.visibility"}}</label>
            <div class="ui checkbox">
              {{if .IsForcedPrivate}}
              <input name="private" type="checkbox" checked readonly>
              <label>{{.i18n.Tr "repo.visiblity_helper_forced" | Safe}}</label>
              {{else}}
              <input name="private" type="checkbox" {{if .private}}checked{{end}}>
              <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}}</label>
              {{end}}
            </div>
          </div>
          <div class="inline field {{if .Err_Description}}error{{end}}">
            <label for="description">{{.i18n.Tr "repo.repo_desc"}}</label>
            <textarea id="description" name="description">{{.description}}</textarea>
          </div>
          
          <div class="ui divider"></div>

          <div class="inline field">
            <label>{{.i18n.Tr "repo.repo_lang"}}</label>
            <div class="ui multiple search normal selection dropdown">
              <input type="hidden" name="gitignores" value="{{.gitignores}}">
              <div class="default text">{{.i18n.Tr "repo.repo_lang_helper"}}</div>
              <div class="menu">
                {{range .Gitignores}}
                <div class="item" data-value="{{.}}">{{.}}</div>
                {{end}}
              </div>
            </div>
          </div>
          <div class="inline field">
            <label>{{.i18n.Tr "repo.license"}}</label>
            <div class="ui search selection dropdown">
              <input type="hidden" name="license" value="{{.license}}">
              <div class="default text">{{.i18n.Tr "repo.license_helper"}}</div>
              <div class="menu">
                {{range .Licenses}}
                <div class="item" data-value="{{.}}">{{.}}</div>
                {{end}}
              </div>
            </div>
          </div>

          <div class="inline field">
            <label>{{.i18n.Tr "repo.readme"}} <a target="_blank" href="https://github.com/gogits/go-gogs-client/wiki/Repositories#litte-notes-on-readme-template"><span class="octicon octicon-question"></span></a></label>
            <div class="ui selection dropdown">
              <input type="hidden" name="readme" value="{{.readme}}">
              <div class="default text">{{.i18n.Tr "repo.readme_helper"}}</div>
              <div class="menu">  
                {{range .Readmes}}
                <div class="item" data-value="{{.}}">{{.}}</div>
                {{end}}
              </div>
            </div>
          </div>
          <div class="inline field">
            <div class="ui checkbox" id="auto-init">
              <input class="hidden" name="auto_init" type="checkbox" tabindex="0" {{if .auto_init}}checked{{end}}>
              <label>{{.i18n.Tr "repo.auto_init"}}</label>
            </div>
          </div>

          <div class="inline field">
            <label></label>
            <button class="ui green button">
              {{.i18n.Tr "repo.create_repo"}}
            </button>
            <a class="ui button" href="{{AppSubUrl}}/">{{.i18n.Tr "cancel"}}</a>
          </div>
        </div>
    </form>
    </div>
  </div>
</div>
{{template "base/footer" .}}