فهرست منبع

Merge pull request #70 from achilleas-k/new-repo-page

Create repository form rewording and redesign
Michael Sonntag 5 سال پیش
والد
کامیت
3bc4996cf6

+ 3 - 0
conf/app.ini

@@ -106,6 +106,9 @@ ENABLE_RAW_FILE_RENDER_MODE = false
 RAW_CAPTCHA_MIN_FILE_SIZE = 50
 ; File size from which on repo file view is protected by captures
 CAPTCHA_MIN_FILE_SIZE = 5
+; If enabled, will select "Initialize this repository" on the repository
+; creation page by default
+AUTO_INIT = false
 
 
 [repository.editor]

+ 4 - 1
conf/locale/locale_en-GB.ini

@@ -400,7 +400,7 @@ delete_account_desc=This account is going to be deleted permanently, do you want
 [repo]
 owner=Owner
 repo_name=Repository Name
-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.
+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).
 visibility=Private
 visiblity_helper=Accessible only to owner and assigned collaborators
 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.
 repo_desc=Description
 repo_lang=Language
 repo_gitignore_helper=Select .gitignore templates
+repo_gitignore_tooltip = Files to exclude from versioning. In the case of data repositories you probably don't need this. If in doubt, ignore.
 license=Licence
 license_helper=Select a licence file
+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.
 readme=Readme
 readme_helper=Select a readme template
+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.
 auto_init=Initialise this repository with selected files and template
 create_repo=Create Repository
 default_branch=Default Branch

+ 4 - 1
conf/locale/locale_en-US.ini

@@ -400,7 +400,7 @@ delete_account_desc = This account is going to be deleted permanently, do you wa
 [repo]
 owner = Owner
 repo_name = Repository Name
-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.
+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).
 visibility = Private
 visiblity_helper = Accessible only to owner and assigned collaborators
 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.
 repo_desc = Description
 repo_lang = Language
 repo_gitignore_helper = Select .gitignore templates
+repo_gitignore_tooltip = Files to exclude from versioning. In the case of data repositories you probably don't need this. If in doubt, ignore.
 license = License
 license_helper = Select a license file
+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.
 readme = Readme
 readme_helper = Select a readme template
+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.
 auto_init = Initialize this repository with selected files and template
 create_repo = Create Repository
 default_branch = Default Branch

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 6
internal/bindata/bindata.go


+ 1 - 0
internal/route/repo/repo.go

@@ -76,6 +76,7 @@ func Create(c *context.Context) {
 	c.Data["readme"] = "Default"
 	c.Data["private"] = c.User.LastRepoVisibility
 	c.Data["IsForcedPrivate"] = setting.Repository.ForcePrivate
+	c.Data["auto_init"] = setting.Repository.AutoInit
 
 	ctxUser := checkContextUser(c, c.QueryInt64("org"))
 	if c.Written() {

+ 1 - 0
internal/setting/setting.go

@@ -131,6 +131,7 @@ var (
 		EnableRawFileRenderMode  bool
 		RawCaptchaMinFileSize    int64
 		CaptchaMinFileSize       int64
+		AutoInit                 bool
 
 		// Repository editor settings
 		Editor struct {

+ 10 - 5
templates/repo/create.tmpl

@@ -56,10 +56,13 @@
 						<span class="help">{{.i18n.Tr "repo.repo_description_helper" | Safe}}</span>
 						<span class="help">{{.i18n.Tr "repo.repo_description_length"}}: <span id="descLength"></span></span>
 					</div>
+				</div>
 
-					<div class="ui divider"></div>
-
-					<div class="inline field" data-tooltip="In the case of data repositories you probably don't need this">
+				<h3 class="ui attached header">
+					Initial Files
+				</h3>
+				<div class="ui attached segment">
+					<div class="inline field" data-tooltip={{.i18n.Tr "repo.repo_gitignore_tooltip"}}>
 						<label>.gitignore</label>
 						<a target="_blank" href="https://git-scm.com/docs/gitignore"><span class="octicon octicon-question"></span></a>
 						<div class="ui multiple search normal selection dropdown">
@@ -72,7 +75,7 @@
 							</div>
 						</div>
 					</div>
-					<div class="inline field" data-tooltip="You can choose a license now, or add one to the repository later">
+					<div class="inline field" data-tooltip={{.i18n.Tr "repo.license_tooltip"}}>
 						<label>{{.i18n.Tr "repo.license"}}</label>
 						<a target="_blank" href="/G-Node/Info/wiki/Licensing"><span class="octicon octicon-question"></span></a>
 						<div class="ui search selection dropdown">
@@ -87,7 +90,7 @@
 						</div>
 					</div>
 
-					<div class="inline field">
+					<div class="inline field" data-tooltip={{.i18n.Tr "repo.readme_tooltip"}}>
 						<label>{{.i18n.Tr "repo.readme"}}</label>
 						<div class="ui selection dropdown">
 							<input type="hidden" name="readme" value="{{.readme}}">
@@ -105,7 +108,9 @@
 							<label>{{.i18n.Tr "repo.auto_init"}}</label>
 						</div>
 					</div>
+				</div>
 
+				<div class="ui attached segment">
 					<div class="inline field">
 						<label></label>
 						<button class="ui green button">

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است