Преглед на файлове

[GinR] Show license warning before publication

cgars преди 7 години
родител
ревизия
6138871064
променени са 3 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 1 0
      conf/locale/locale_en-US.ini
  2. 1 1
      templates/repo/settings/options.tmpl
  3. 1 1
      templates/repo/view_list.tmpl

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

@@ -398,6 +398,7 @@ visibility = Visibility
 visiblity_helper = This repository is <span class="ui red text">Private</span>
 visiblity_helper_forced = Site admin has forced all new repositories to be <span class="ui red text">Private</span>
 visiblity_fork_helper = (Change of this value will affect all forks)
+license_warn=Before making this public: Have you added a LICENSE file?
 listed = Listed
 listed_helper = Is this repository listed on Explore?
 clone_helper = Need help cloning? Visit <a target="_blank" href="%s">Help</a>!

+ 1 - 1
templates/repo/settings/options.tmpl

@@ -29,7 +29,7 @@
 						{{if not .Repository.IsFork}}
 							<div class="inline field">
 								<label>{{.i18n.Tr "repo.visibility"}}</label>
-								<div class="ui checkbox">
+								<div class="ui checkbox" {{if .Repository.IsPrivate}}data-tooltip="{{.i18n.Tr "repo.license_warn"}}"{{end}}>
 									<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
 									<label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label>
 								</div>

+ 1 - 1
templates/repo/view_list.tmpl

@@ -1,4 +1,4 @@
-{{if and (not .IsPrivate) (and (not .LicenseExists) $.IsRepositoryAdmin)}}
+{{if and (not $.Repository.IsPrivate) (and (not .LicenseExists) $.IsRepositoryAdmin)}}
 <div class="ui warning icon message">
 	<i class="comment outline icon"></i>
 	<div class="content">