aboutsummaryrefslogtreecommitdiff
path: root/templates/repo/create.tmpl
diff options
context:
space:
mode:
authorSergey Dryabzhinsky <sergey.dryabzhinsky@gmail.com>2018-06-11 15:34:26 +0300
committer无闻 <u@gogs.io>2018-06-11 20:34:26 +0800
commit57897cc8c2c90ab1566a65bcd1eabfd41a906070 (patch)
tree146467cd0a0c7867345f584e2b6d05e68af6e831 /templates/repo/create.tmpl
parent459c8be94fb704f974579471dd7a7197bd226b69 (diff)
repo: update repository description field to contain more than 256 symbols (#5219)
* Update repository description field to contain more than 256 symbols - update repository model - description field now is `TEXT` and limited by 4000 symbols - new migration - add description to html forms - repo creation and repo settings - add translation for description * Update for description field, new features - add autosize (height) for description textarea, new plugin - set max description length to 512 symbols - update locales * Fix migration - typo in var * Update repo description behaviour - add textarea autosize for /repo/create - add symbols counter under description testarea (create/edit) * Fix function definition - it a var * Revert ru-RU locale * Update by review - Use type `varchar(512)` in migration - Remove unused files from autosize plugin * Fix migration - new project paths * Fixes after review 2 - copyright year - format includes - use switch instead of multi-if * Remove unused `default:` option.
Diffstat (limited to 'templates/repo/create.tmpl')
-rw-r--r--templates/repo/create.tmpl14
1 files changed, 13 insertions, 1 deletions
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index 25c8dc27..89fe133c 100644
--- a/templates/repo/create.tmpl
+++ b/templates/repo/create.tmpl
@@ -52,7 +52,9 @@
</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>
+ <textarea id="description" name="description" rows="3">{{.description}}</textarea>
+ <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 class="ui divider"></div>
@@ -113,4 +115,14 @@
</div>
</div>
</div>
+
+<script type="text/javascript">
+$(document).ready(function(){
+ if (typeof window.autosize !== "undefined") {
+ autosize($('#description'));
+ }
+ showMessageMaxLength(512, 'description', 'descLength');
+});
+</script>
+
{{template "base/footer" .}}