diff --git a/appview/pages/templates/repo/new.html b/appview/pages/templates/repo/new.html index 2edc04b8..a117c74b 100644 --- a/appview/pages/templates/repo/new.html +++ b/appview/pages/templates/repo/new.html @@ -110,11 +110,12 @@ type="text" id="description" name="description" + maxlength="140" class="w-full w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded px-3 py-2" placeholder="A brief description of your project..." />
- Optional. A short description to help others understand what your project does. + Optional. A short description to help others understand what your project does (max 140 characters).
{{ end }} diff --git a/appview/state/state.go b/appview/state/state.go index 604a33a8..fd5b85ae 100644 --- a/appview/state/state.go +++ b/appview/state/state.go @@ -469,6 +469,10 @@ func (s *State) NewRepo(w http.ResponseWriter, r *http.Request) { l = l.With("defaultBranch", defaultBranch) description := r.FormValue("description") + if len([]rune(description)) > 140 { + s.pages.Notice(w, "repo", "Description must be 140 characters or fewer.") + return + } // ACL validation ok, err := s.enforcer.E.Enforce(user.Active.Did, domain, domain, "repo:create")