# HG changeset patch # User Marcin Kuzminski # Date 2012-03-24 11:11:54 # Node ID 04d3fae0e4c09af62190d30689868dc390a3aedc # Parent e8c016815ab939bb6cff687ed75fba3bb23ce2e5 imported patch 2260 diff --git a/docs/changelog.rst b/docs/changelog.rst --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -45,6 +45,7 @@ fixes - fixed #396 fixed problems with revoking users in nested groups - fixed mysql unicode issues + specified InnoDB as default engine with utf8 charset +- #406 trim long branch/tag names in changelog to not break UI 1.3.3 (**2012-03-02**) ---------------------- diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -46,6 +46,13 @@ from rhodecode.lib.markup_renderer impor log = logging.getLogger(__name__) +def shorter(text, size=20): + postfix = '...' + if len(text) > size: + return text[:size - len(postfix)] + postfix + return text + + def _reset(name, value=None, id=NotGiven, type="reset", **attrs): """ Reset button @@ -87,6 +94,7 @@ def get_token(): session.save() return session[token_key] + class _GetError(object): """Get error from form_errors, and represent it as span wrapped error message @@ -102,6 +110,7 @@ class _GetError(object): get_error = _GetError() + class _ToolTip(object): def __call__(self, tooltip_title, trim_at=50): @@ -113,6 +122,7 @@ class _ToolTip(object): return escape(tooltip_title) tooltip = _ToolTip() + class _FilesBreadCrumbs(object): def __call__(self, repo_name, rev, paths): @@ -137,8 +147,10 @@ class _FilesBreadCrumbs(object): files_breadcrumbs = _FilesBreadCrumbs() + class CodeHtmlFormatter(HtmlFormatter): - """My code Html Formatter for source codes + """ + My code Html Formatter for source codes """ def wrap(self, source, outfile): diff --git a/rhodecode/templates/changelog/changelog.html b/rhodecode/templates/changelog/changelog.html --- a/rhodecode/templates/changelog/changelog.html +++ b/rhodecode/templates/changelog/changelog.html @@ -93,11 +93,11 @@ %endif %if h.is_hg(c.rhodecode_repo) and cs.branch: - ${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} + ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} %endif %for tag in cs.tags: - ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} + ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} %endfor