diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/create.tmpl | 119 | ||||
-rw-r--r-- | templates/repo/header.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/home.tmpl | 11 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 7 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 22 |
5 files changed, 116 insertions, 45 deletions
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 1a53e3c893..f728a93631 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -55,68 +55,97 @@ <label for="description">{{.i18n.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description">{{.description}}</textarea> </div> - <div class="inline field"> - <label>{{.i18n.Tr "repo.issue_labels"}}</label> - <div class="ui search normal selection dropdown"> - <input type="hidden" name="issue_labels" value="{{.issueLabels}}"> - <div class="default text">{{.i18n.Tr "repo.issue_labels_helper"}}</div> + <label>{{.i18n.Tr "repo.template"}}</label> + <div id="repo_template_search" class="ui search normal selection dropdown"> + <input type="hidden" id="repo_template" name="repo_template" value="{{.repo_template}}"> + <div class="default text">{{.repo_template_name}}</div> <div class="menu"> - <div class="item" data-value="">{{.i18n.Tr "repo.issue_labels_helper"}}</div> - {{range .LabelTemplates}} - <div class="item" data-value="{{.}}">{{.}}</div> - {{end}} </div> </div> </div> - <div class="ui divider"></div> - - <div class="inline field"> - <label>.gitignore</label> - <div class="ui multiple search normal selection dropdown"> - <input type="hidden" name="gitignores" value="{{.gitignores}}"> - <div class="default text">{{.i18n.Tr "repo.repo_gitignore_helper"}}</div> - <div class="menu"> - {{range .Gitignores}} - <div class="item" data-value="{{.}}">{{.}}</div> - {{end}} + <div id="template_units" style="display: none;"> + <div class="inline field"> + <label>{{.i18n.Tr "repo.template.items"}}</label> + <div class="ui checkbox"> + <input class="hidden" name="git_content" type="checkbox" tabindex="0" {{if .git_content}}checked{{end}}> + <label>{{.i18n.Tr "repo.template.git_content"}}</label> </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"> - <div class="item" data-value="">{{.i18n.Tr "repo.license_helper"}}</div> - {{range .Licenses}} - <div class="item" data-value="{{.}}">{{.}}</div> - {{end}} + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input class="hidden" name="topics" type="checkbox" tabindex="0" {{if .topics}}checked{{end}}> + <label>{{.i18n.Tr "repo.template.topics"}}</label> </div> </div> </div> - <div class="inline field"> - <label>{{.i18n.Tr "repo.readme"}}</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 id="non_template"> + <div class="inline field"> + <label>{{.i18n.Tr "repo.issue_labels"}}</label> + <div class="ui search normal selection dropdown"> + <input type="hidden" name="issue_labels" value="{{.issueLabels}}"> + <div class="default text">{{.i18n.Tr "repo.issue_labels_helper"}}</div> + <div class="menu"> + <div class="item" data-value="">{{.i18n.Tr "repo.issue_labels_helper"}}</div> + {{range .LabelTemplates}} + <div class="item" data-value="{{.}}">{{.}}</div> + {{end}} + </div> </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 class="ui divider"></div> + + <div class="inline field"> + <label>.gitignore</label> + <div class="ui multiple search normal selection dropdown"> + <input type="hidden" name="gitignores" value="{{.gitignores}}"> + <div class="default text">{{.i18n.Tr "repo.repo_gitignore_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"> + <div class="item" data-value="">{{.i18n.Tr "repo.license_helper"}}</div> + {{range .Licenses}} + <div class="item" data-value="{{.}}">{{.}}</div> + {{end}} + </div> + </div> + </div> + + <div class="inline field"> + <label>{{.i18n.Tr "repo.readme"}}</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> + <br/> <div class="inline field"> <label></label> <button class="ui green button"> diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 111609efef..b1b31183c4 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -12,9 +12,11 @@ <div class="divider"> / </div> <a href="{{$.RepoLink}}">{{.Name}}</a> {{if and .RelAvatarLink .IsPrivate}}<i class="mega-octicon octicon-lock"></i>{{end}} + {{if .IsTemplate}}<i class="icon fa-copy"></i>{{end}} {{if .IsArchived}}<i class="archive icon archived-icon"></i>{{end}} {{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{MirrorAddress $.Mirror}}">{{MirrorAddress $.Mirror}}</a></div>{{end}} {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}} + {{if .IsGenerated}}<div class="fork-flag">{{$.i18n.Tr "repo.generated_from"}} <a href="{{.TemplateRepo.Link}}">{{SubStr .TemplateRepo.RelLink 1 -1}}</a></div>{{end}} </div> {{if not .IsBeingCreated}} <div class="repo-buttons"> diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index b23e851139..19989bbe06 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -95,6 +95,17 @@ </div> <div class="fitted item"> + {{if eq $n 0}} + {{if .Repository.IsTemplate}} + <div class="ui tiny blue buttons"> + <a href="{{AppSubUrl}}/repo/create?template_id={{.Repository.ID}}" class="ui button"> + {{.i18n.Tr "repo.use_template"}} + </a> + </div> + {{end}} + {{end}} + </div> + <div class="fitted item"> <!-- Only show clone panel in repository home page --> {{if eq $n 0}} diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index a93efb8d25..7ded98206c 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -15,6 +15,13 @@ <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required> </div> + <div class="inline field"> + <label>{{.i18n.Tr "repo.template"}}</label> + <div class="ui checkbox"> + <input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}> + <label>{{.i18n.Tr "repo.template_helper"}}</label> + </div> + </div> {{if not .Repository.IsFork}} <div class="inline field"> <label>{{.i18n.Tr "repo.visibility"}}</label> diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index dc162bc37d..bebe85246c 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -1229,6 +1229,13 @@ { "type": "integer", "format": "int64", + "description": "repo owner to prioritize in the results", + "name": "priority_owner_id", + "in": "query" + }, + { + "type": "integer", + "format": "int64", "description": "search only for repos that the user with the given id has starred", "name": "starredBy", "in": "query" @@ -1240,6 +1247,12 @@ "in": "query" }, { + "type": "boolean", + "description": "include template repositories this user has access to (defaults to true)", + "name": "template", + "in": "query" + }, + { "type": "integer", "description": "page number of results to return (1-based)", "name": "page", @@ -8786,6 +8799,11 @@ "type": "boolean", "x-go-name": "Private" }, + "template": { + "description": "either `true` to make this repository a template or `false` to make it a normal repository", + "type": "boolean", + "x-go-name": "Template" + }, "website": { "description": "a URL with more information about the repository.", "type": "string", @@ -10306,6 +10324,10 @@ "format": "int64", "x-go-name": "Stars" }, + "template": { + "type": "boolean", + "x-go-name": "Template" + }, "updated_at": { "type": "string", "format": "date-time", |