diff --git a/rhodecode/public/css/tables.less b/rhodecode/public/css/tables.less index 07789565..cf7d114e 100644 --- a/rhodecode/public/css/tables.less +++ b/rhodecode/public/css/tables.less @@ -187,6 +187,7 @@ table.dataTable { white-space: nowrap; overflow: hidden; max-width: 350px; + text-overflow: ellipsis; } } diff --git a/rhodecode/templates/admin/admin_audit_logs.mako b/rhodecode/templates/admin/admin_audit_logs.mako index 82dbe09f..d9b26b52 100644 --- a/rhodecode/templates/admin/admin_audit_logs.mako +++ b/rhodecode/templates/admin/admin_audit_logs.mako @@ -37,6 +37,7 @@ diff --git a/rhodecode/templates/admin/repos/repo_add_base.mako b/rhodecode/templates/admin/repos/repo_add_base.mako index 181cdea9..fe32aae4 100644 --- a/rhodecode/templates/admin/repos/repo_add_base.mako +++ b/rhodecode/templates/admin/repos/repo_add_base.mako @@ -19,7 +19,7 @@ ${h.secure_form(h.route_path('repo_create'), request=request)} ${h.select('repo_group', request.GET.get('parent_group'), c.repo_groups, class_="medium")}
/
- ${h.text('repo_name', class_="medium", id="repo_name_input", maxlength=192)} + ${h.text('repo_name', class_="medium", id="repo_name_input")}
@@ -196,6 +196,22 @@ ${h.secure_form(h.route_path('repo_create'), request=request)} let debounceTimer; $('#repo_name_input').on('input paste', function () { + const LIMIT = 192; + const $input = $("#repo_name_input"); + const $error = $("#repo_name_error"); + const $saveBtn = $("#save"); + + const len = $input.val().length; + + if (len >= LIMIT) { + $error.text("You've reached the " + LIMIT + " character limit. Please select shorter name.").show(); + $saveBtn.prop("disabled", true); + return; + } else { + $error.text("").hide(); + $saveBtn.prop("disabled", false); + } + let repoName = $(this).val(); if (repoName.length > 0) { @@ -284,6 +300,7 @@ ${h.secure_form(h.route_path('repo_create'), request=request)} }) trimRepoTitleName(); + }); ${h.end_form()} diff --git a/rhodecode/templates/admin/repos/repos.mako b/rhodecode/templates/admin/repos/repos.mako index c9276ade..1742d133 100644 --- a/rhodecode/templates/admin/repos/repos.mako +++ b/rhodecode/templates/admin/repos/repos.mako @@ -143,7 +143,6 @@ $(document).ready(function() { $(document).on("draw.dt", function () { applyMiddleCut('#repo_list_table .truncate a', 60); - applyMiddleCut('.truncate-wrap'); }); }); diff --git a/rhodecode/templates/base/base.mako b/rhodecode/templates/base/base.mako index 802a1430..0f8843d9 100644 --- a/rhodecode/templates/base/base.mako +++ b/rhodecode/templates/base/base.mako @@ -1223,7 +1223,7 @@ } } $(function () { - applyMiddleCut('#context-bar .title a'); + applyMiddleCut('#context-bar .title a', 120); }); })(); diff --git a/rhodecode/templates/index_base.mako b/rhodecode/templates/index_base.mako index 076da653..0bc72dbd 100644 --- a/rhodecode/templates/index_base.mako +++ b/rhodecode/templates/index_base.mako @@ -226,7 +226,7 @@ }, }); $(document).on("draw.dt", function () { - applyMiddleCut('.truncate-wrap .truncate a, .truncate-wrap'); // auto + applyMiddleCut('.truncate-wrap .truncate a'); // auto }); });