Skip to content

Commit 3bc4996

Browse files
authored
Merge pull request #70 from achilleas-k/new-repo-page
Create repository form rewording and redesign
2 parents d461c4a + 65fe6ca commit 3bc4996

File tree

7 files changed

+34811
-2017
lines changed

7 files changed

+34811
-2017
lines changed

conf/app.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ ENABLE_RAW_FILE_RENDER_MODE = false
106106
RAW_CAPTCHA_MIN_FILE_SIZE = 50
107107
; File size from which on repo file view is protected by captures
108108
CAPTCHA_MIN_FILE_SIZE = 5
109+
; If enabled, will select "Initialize this repository" on the repository
110+
; creation page by default
111+
AUTO_INIT = false
109112

110113

111114
[repository.editor]

conf/locale/locale_en-GB.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ delete_account_desc=This account is going to be deleted permanently, do you want
400400
[repo]
401401
owner=Owner
402402
repo_name=Repository Name
403-
repo_name_helper=Repository names should be short, memorable and unique. It must be one word (no spaces) and can contain letters (a-z), numbers (0-9), dash (-), underscore (_), or dot (.) characters.
403+
repo_name_helper=Will be used to define the URL (path) of the repository. It must be one word (no spaces) and can contain letters (a-z, A-Z), numbers (0-9), dash (-), underscore (_), or dot (.) characters. Repository names should be short, unique and specific (do not use a generic name like "dataset", "plos_paper", etc).
404404
visibility=Private
405405
visiblity_helper=Accessible only to owner and assigned collaborators
406406
visiblity_helper_forced=New repositories are private by default. You can change the state later.
@@ -412,10 +412,13 @@ fork_visiblity_helper=You cannot alter the visibility of a forked repository.
412412
repo_desc=Description
413413
repo_lang=Language
414414
repo_gitignore_helper=Select .gitignore templates
415+
repo_gitignore_tooltip = Files to exclude from versioning. In the case of data repositories you probably don't need this. If in doubt, ignore.
415416
license=Licence
416417
license_helper=Select a licence file
418+
license_tooltip=A license is essential for a data or code publication. You can choose a license now, or add a license file to the repository later.
417419
readme=Readme
418420
readme_helper=Select a readme template
421+
readme_tooltip=The file to enter a description of your repository with information to understand and use it. The README file contents will be displayed when accessing your repository through a web browser.
419422
auto_init=Initialise this repository with selected files and template
420423
create_repo=Create Repository
421424
default_branch=Default Branch

conf/locale/locale_en-US.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ delete_account_desc = This account is going to be deleted permanently, do you wa
400400
[repo]
401401
owner = Owner
402402
repo_name = Repository Name
403-
repo_name_helper = Repository names should be short, memorable and unique. It must be one word (no spaces) and can contain letters (a-z), numbers (0-9), dash (-), underscore (_), or dot (.) characters.
403+
repo_name_helper = Will be used to define the URL (path) of the repository. It must be one word (no spaces) and can contain letters (a-z, A-Z), numbers (0-9), dash (-), underscore (_), or dot (.) characters. Repository names should be short, unique and specific (do not use a generic name like "dataset", "plos_paper", etc).
404404
visibility = Private
405405
visiblity_helper = Accessible only to owner and assigned collaborators
406406
visiblity_helper_forced = New repositories are private by default. You can change the state later.
@@ -415,10 +415,13 @@ fork_visiblity_helper = You cannot alter the visibility of a forked repository.
415415
repo_desc = Description
416416
repo_lang = Language
417417
repo_gitignore_helper = Select .gitignore templates
418+
repo_gitignore_tooltip = Files to exclude from versioning. In the case of data repositories you probably don't need this. If in doubt, ignore.
418419
license = License
419420
license_helper = Select a license file
421+
license_tooltip = A license is essential for a data or code publication. You can choose a license now, or add a license file to the repository later.
420422
readme = Readme
421423
readme_helper = Select a readme template
424+
readme_tooltip = The file to enter a description of your repository with information to understand and use it. The README file contents will be displayed when accessing your repository through a web browser.
422425
auto_init = Initialize this repository with selected files and template
423426
create_repo = Create Repository
424427
default_branch = Default Branch

internal/bindata/bindata.go

Lines changed: 34788 additions & 2010 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/route/repo/repo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ func Create(c *context.Context) {
7676
c.Data["readme"] = "Default"
7777
c.Data["private"] = c.User.LastRepoVisibility
7878
c.Data["IsForcedPrivate"] = setting.Repository.ForcePrivate
79+
c.Data["auto_init"] = setting.Repository.AutoInit
7980

8081
ctxUser := checkContextUser(c, c.QueryInt64("org"))
8182
if c.Written() {

internal/setting/setting.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ var (
131131
EnableRawFileRenderMode bool
132132
RawCaptchaMinFileSize int64
133133
CaptchaMinFileSize int64
134+
AutoInit bool
134135

135136
// Repository editor settings
136137
Editor struct {

templates/repo/create.tmpl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@
5656
<span class="help">{{.i18n.Tr "repo.repo_description_helper" | Safe}}</span>
5757
<span class="help">{{.i18n.Tr "repo.repo_description_length"}}: <span id="descLength"></span></span>
5858
</div>
59+
</div>
5960

60-
<div class="ui divider"></div>
61-
62-
<div class="inline field" data-tooltip="In the case of data repositories you probably don't need this">
61+
<h3 class="ui attached header">
62+
Initial Files
63+
</h3>
64+
<div class="ui attached segment">
65+
<div class="inline field" data-tooltip={{.i18n.Tr "repo.repo_gitignore_tooltip"}}>
6366
<label>.gitignore</label>
6467
<a target="_blank" href="https://git-scm.com/docs/gitignore"><span class="octicon octicon-question"></span></a>
6568
<div class="ui multiple search normal selection dropdown">
@@ -72,7 +75,7 @@
7275
</div>
7376
</div>
7477
</div>
75-
<div class="inline field" data-tooltip="You can choose a license now, or add one to the repository later">
78+
<div class="inline field" data-tooltip={{.i18n.Tr "repo.license_tooltip"}}>
7679
<label>{{.i18n.Tr "repo.license"}}</label>
7780
<a target="_blank" href="/G-Node/Info/wiki/Licensing"><span class="octicon octicon-question"></span></a>
7881
<div class="ui search selection dropdown">
@@ -87,7 +90,7 @@
8790
</div>
8891
</div>
8992

90-
<div class="inline field">
93+
<div class="inline field" data-tooltip={{.i18n.Tr "repo.readme_tooltip"}}>
9194
<label>{{.i18n.Tr "repo.readme"}}</label>
9295
<div class="ui selection dropdown">
9396
<input type="hidden" name="readme" value="{{.readme}}">
@@ -105,7 +108,9 @@
105108
<label>{{.i18n.Tr "repo.auto_init"}}</label>
106109
</div>
107110
</div>
111+
</div>
108112

113+
<div class="ui attached segment">
109114
<div class="inline field">
110115
<label></label>
111116
<button class="ui green button">

0 commit comments

Comments
 (0)