diff --git a/kallithea/controllers/admin/settings.py b/kallithea/controllers/admin/settings.py --- a/kallithea/controllers/admin/settings.py +++ b/kallithea/controllers/admin/settings.py @@ -266,7 +266,7 @@ class SettingsController(BaseController) settings = [ ('show_public_icon', 'show_public_icon', 'bool'), ('show_private_icon', 'show_private_icon', 'bool'), - ('stylify_metatags', 'stylify_metatags', 'bool'), + ('stylify_metalabels', 'stylify_metalabels', 'bool'), ('repository_fields', 'repository_fields', 'bool'), ('dashboard_items', 'dashboard_items', 'int'), ('admin_grid_items', 'admin_grid_items', 'int'), diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -391,7 +391,7 @@ class BaseController(TGController): ## DB stored c.visual.show_public_icon = str2bool(rc_config.get('show_public_icon')) c.visual.show_private_icon = str2bool(rc_config.get('show_private_icon')) - c.visual.stylify_metatags = str2bool(rc_config.get('stylify_metatags')) + c.visual.stylify_metalabels = str2bool(rc_config.get('stylify_metalabels')) c.visual.page_size = safe_int(rc_config.get('dashboard_items', 100)) c.visual.admin_grid_items = safe_int(rc_config.get('admin_grid_items', 100)) c.visual.repository_fields = str2bool(rc_config.get('repository_fields')) diff --git a/kallithea/lib/db_manage.py b/kallithea/lib/db_manage.py --- a/kallithea/lib/db_manage.py +++ b/kallithea/lib/db_manage.py @@ -457,7 +457,7 @@ class DbManage(object): ('ga_code', '', 'unicode'), ('show_public_icon', True, 'bool'), ('show_private_icon', True, 'bool'), - ('stylify_metatags', False, 'bool'), + ('stylify_metalabels', False, 'bool'), ('dashboard_items', 100, 'int'), # TODO: call it page_size ('admin_grid_items', 25, 'int'), ('show_version', True, 'bool'), diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -1058,20 +1058,20 @@ def urlify_text(s, repo_name=None, link_ if stylize: seen = match_obj.group('seen') if seen: - return '
see => %s
' % seen + return '
see => %s
' % seen license = match_obj.group('license') if license: - return '
%s
' % (license, license) + return '
%s
' % (license, license) tagtype = match_obj.group('tagtype') if tagtype: tagvalue = match_obj.group('tagvalue') - return '
%s => %s
' % (tagtype, tagtype, tagvalue, tagvalue) + return '
%s => %s
' % (tagtype, tagtype, tagvalue, tagvalue) lang = match_obj.group('lang') if lang: - return '
%s
' % lang + return '
%s
' % lang tag = match_obj.group('tag') if tag: - return '
%s
' % (tag, tag) + return '
%s
' % (tag, tag) return match_obj.group(0) def _urlify(s): diff --git a/kallithea/model/forms.py b/kallithea/model/forms.py --- a/kallithea/model/forms.py +++ b/kallithea/model/forms.py @@ -363,7 +363,7 @@ def ApplicationVisualisationForm(): filter_extra_fields = False show_public_icon = v.StringBoolean(if_missing=False) show_private_icon = v.StringBoolean(if_missing=False) - stylify_metatags = v.StringBoolean(if_missing=False) + stylify_metalabels = v.StringBoolean(if_missing=False) repository_fields = v.StringBoolean(if_missing=False) lightweight_journal = v.StringBoolean(if_missing=False) diff --git a/kallithea/model/repo.py b/kallithea/model/repo.py --- a/kallithea/model/repo.py +++ b/kallithea/model/repo.py @@ -174,7 +174,7 @@ class RepoModel(object): cs_cache.get('message')) def desc(desc): - return h.urlify_text(desc, truncate=80, stylize=c.visual.stylify_metatags) + return h.urlify_text(desc, truncate=80, stylize=c.visual.stylify_metalabels) def state(repo_state): return _render("repo_state", repo_state) diff --git a/kallithea/public/less/kallithea-tags.less b/kallithea/public/less/kallithea-labels.less rename from kallithea/public/less/kallithea-tags.less rename to kallithea/public/less/kallithea-labels.less --- a/kallithea/public/less/kallithea-tags.less +++ b/kallithea/public/less/kallithea-labels.less @@ -1,230 +1,93 @@ -.metatag { - .label; +.label-meta { color: #000; } -.metatag[data-tag="dead"] { +.label-meta[data-tag="dead"] { background-color: #E44; } -.metatag[data-tag="stale"] { +.label-meta[data-tag="stale"] { background-color: #EA4; } -.metatag[data-tag="featured"] { +.label-meta[data-tag="featured"] { background-color: #AEA; } -.metatag[data-tag="requires"] { +.label-meta[data-tag="requires"] { background-color: #9CF; } -.metatag[data-tag="recommends"] { +.label-meta[data-tag="recommends"] { background-color: #BDF; } -.metatag[data-tag="lang"] { +.label-meta[data-tag="lang"] { background-color: #FAF474; } -.metatag[data-tag="license"] { +.label-meta[data-tag="license"] { border: solid 1px #9CF; background-color: #DEF; } -.metatag[data-tag="see"] { +.label-meta[data-tag="see"] { border: solid 1px #CBD; background-color: #EDF; } -a.metatag[data-tag="license"]:hover { +a.label-metameta[data-tag="license"]:hover { background-color: @kallithea-theme-main-color; color: #FFF; text-decoration: none; } -#perms .perm_tag { - position: relative; - top: -2px; - margin-left: 3px; - padding: 3px 3px 1px 3px; - font-size: 10px; - font-weight: bold; - text-transform: uppercase; - white-space: nowrap; - border-radius: 3px; - &.admin { - background-color: #B94A48; - color: #ffffff; - } - &.write { - background-color: #DB7525; - color: #ffffff; - } - &.read { - background-color: #468847; - color: #ffffff; - } - &.none { - background-color: #bfbfbf; - color: #ffffff; - } +/* permission labels */ +.label-admin { + background-color: #B94A48; + color: #ffffff; +} +.label-write { + background-color: #DB7525; + color: #ffffff; } -.mergetag { - padding: 1px 3px 1px 3px; +.label-read { + background-color: #468847; + color: #ffffff; +} +.label-none { + background-color: #bfbfbf; + color: #ffffff; +} + +/* changeset labels */ +.label-merge { background-color: #fca062; - font-size: 10px; color: #ffffff; text-transform: uppercase; - white-space: nowrap; - border-radius: 3px; - margin-right: 2px; -} -.parent { - color: #666666; - clear: both; -} -.logtags { - line-height: 2.2em; -} -.phasetag, -.bumpedtag, -.divergenttag, -.extincttag, -.unstabletag, -.repotag, -.branchtag, -.logtags .tagtag, -.logtags .booktag { - margin: 0px 2px; -} -.phasetag, -.bumpedtag, -.divergenttag, -.extincttag, -.unstabletag, -.repotag, -.branchtag, -.tagtag, -.booktag, -.spantag { - padding: 1px 3px 1px 3px; - font-size: 10px; - color: @kallithea-theme-main-color; - white-space: nowrap; - border-radius: 4px; - border: 1px solid #d9e8f8; } -table#changesets .phasetag, -table#changesets .bumpedtag, -table#changesets .divergenttag, -table#changesets .extincttag, -table#changesets .unstabletag, -table#changesets .branchtag, -table#changesets .tagtag, -table#changesets .booktag { - margin-right: 0.5em; -} -.phasetag, -.bumpedtag, -.divergenttag, -.extincttag, -.unstabletag, -.repotag, -.branchtag, -.tagtag, -.booktag { - float: left; - display: inline-block; +.label-repo { + border: 1px solid #56A546; + color: #46A546; + text-transform: uppercase; + padding: .2em .3em 0; } -.logtags .phasetag, -.logtags .bumpedtag, -.logtags .divergenttag, -.logtags .extincttag, -.logtags .unstabletag, -.logtags .branchtag, -.logtags .tagtag, -.logtags .booktag, -.mergetag, -.merge { - float: right; - line-height: 1em; - margin: 1px 1px !important; - display: block; -} -.repotag { - border-color: #56A546; - color: #46A546; - font-size: 8px; - text-transform: uppercase; -} -#context-bar .repotag, -.repo-icons .repotag { +#context-bar .label-repo { border-color: white; color: white; - margin-top: 3px; } -.repo-icons .repotag { - margin-top: 0px; - padding-top: 0px; - padding-bottom: 0px; -} -.booktag { - border-color: #46A546; +.label-bookmark { + border: 1px solid #46A546; color: #46A546; } -.tagtag { - border-color: #62cffc; +.label-tag { + border: 1px solid #62cffc; color: #62cffc; } -.bumpedtag, -.divergenttag, -.extincttag, -.unstabletag { +.label-bumped, +.label-divergent, +.label-extinct, +.label-unstable { background-color: #f00; border-color: #600; color: #fff; } -.phasetag { - border-color: #1F14CE; +.label-phase { + border: 1px solid #1F14CE; color: #1F14CE; } -.logtags .branchtag a:hover, -.logtags .branchtag a, -.branchtag a, -.branchtag a:hover { - text-decoration: none; - color: inherit; -} -.logtags .tagtag { - padding: 1px 3px 1px 3px; - background-color: #62cffc; - font-size: 10px; - color: #ffffff; - white-space: nowrap; - border-radius: 3px; -} -.tagtag a, -.tagtag a:hover, -.logtags .tagtag a, -.logtags .tagtag a:hover { - text-decoration: none; - color: inherit; +.label-branch { + border: 1px solid #d9e8f8; + color: #577632; } -.logbooks .booktag, -.logbooks .booktag, -.logtags .booktag, -.logtags .booktag { - padding: 1px 3px 1px 3px; - background-color: #46A546; - font-size: 10px; - color: #ffffff; - white-space: nowrap; - border-radius: 3px; -} -.logbooks .booktag, -.logbooks .booktag a, -.right .logtags .booktag, -.logtags .booktag a { - color: #ffffff; -} -.logbooks .booktag, -.logbooks .booktag a:hover, -.logtags .booktag, -.logtags .booktag a:hover, -.booktag a, -.booktag a:hover { - text-decoration: none; - color: inherit; -} diff --git a/kallithea/public/less/main.less b/kallithea/public/less/main.less --- a/kallithea/public/less/main.less +++ b/kallithea/public/less/main.less @@ -17,7 +17,7 @@ /* kallithea styles */ @import "kallithea-variables.less"; -@import "kallithea-tags.less"; +@import "kallithea-labels.less"; @import "yui-ac.less"; @import "kallithea-select2.less"; @import "kallithea-diff.less"; diff --git a/kallithea/templates/admin/settings/settings_visual.html b/kallithea/templates/admin/settings/settings_visual.html --- a/kallithea/templates/admin/settings/settings_visual.html +++ b/kallithea/templates/admin/settings/settings_visual.html @@ -86,25 +86,25 @@ ${h.form(url('admin_settings_visual'), m
- +
${_('Stylify recognised meta tags:')}
    -
  • [featured] featured
  • -
  • [stale] stale
  • -
  • [dead] dead
  • -
  • [lang => lang] lang
  • -
  • [license => License] License
  • -
  • [requires => Repo] requires => Repo
  • -
  • [recommends => Repo] recommends => Repo
  • -
  • [see => URI] see => URI
  • +
  • [featured] featured
  • +
  • [stale] stale
  • +
  • [dead] dead
  • +
  • [lang => lang] lang
  • +
  • [license => License] License
  • +
  • [requires => Repo] requires => Repo
  • +
  • [recommends => Repo] recommends => Repo
  • +
  • [see => URI] see => URI
diff --git a/kallithea/templates/base/base.html b/kallithea/templates/base/base.html --- a/kallithea/templates/base/base.html +++ b/kallithea/templates/base/base.html @@ -81,12 +81,12 @@ -<%def name="repotag(repo)"> +<%def name="repolabel(repo)"> %if h.is_hg(repo): - hg + hg %endif %if h.is_git(repo): - git + git %endif @@ -97,7 +97,7 @@
%if cs_comments.get(cs.raw_id): - - ${len(cs_comments[cs.raw_id])} - + ${len(cs_comments[cs.raw_id])} %endif %for book in cs.bookmarks: - - ${h.link_to(book,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))} - + ${h.link_to(book,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))} %endfor %for tag in cs.tags: - - ${h.link_to(tag,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))} - + ${h.link_to(tag,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))} %endfor %if cs.bumped: - - Bumped - + Bumped %endif %if cs.divergent: - - Divergent - + Divergent %endif %if cs.extinct: - - Extinct - + Extinct %endif %if cs.unstable: - - Unstable - + Unstable %endif %if cs.phase: - - ${cs.phase} - + ${cs.phase} %endif %if show_branch and cs.branch: - - ${h.link_to(cs.branch,h.url('changelog_home',repo_name=repo_name,branch=cs.branch))} - + ${h.link_to(cs.branch,h.url('changelog_home',repo_name=repo_name,branch=cs.branch))} %endif
diff --git a/kallithea/templates/changeset/changeset.html b/kallithea/templates/changeset/changeset.html --- a/kallithea/templates/changeset/changeset.html +++ b/kallithea/templates/changeset/changeset.html @@ -57,24 +57,19 @@ ${self.repo_context_bar('changelog', c.c
%if len(c.changeset.parents)>1: - ${_('Merge')} + ${_('Merge')} %endif %for book in c.changeset.bookmarks: - - ${h.link_to(book,h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} - + ${h.link_to(book,h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} %endfor %for tag in c.changeset.tags: - - ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} + ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} %endfor %if c.changeset.branch: - - ${h.link_to(c.changeset.branch,h.url('changelog_home',repo_name=c.repo_name,branch=c.changeset.branch))} - + ${h.link_to(c.changeset.branch,h.url('changelog_home',repo_name=c.repo_name,branch=c.changeset.branch))} %endif diff --git a/kallithea/templates/changeset/changeset_range.html b/kallithea/templates/changeset/changeset_range.html --- a/kallithea/templates/changeset/changeset_range.html +++ b/kallithea/templates/changeset/changeset_range.html @@ -77,21 +77,21 @@ ${self.repo_context_bar('changelog')}
%if len(cs.parents)>1: - ${_('Merge')} + ${_('Merge')} %endif %if h.is_hg(c.db_repo_scm_instance): %for book in cs.bookmarks: - + ${h.link_to(book,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} %endfor %endif %for tag in cs.tags: - + ${h.link_to(tag,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} %endfor %if cs.branch: - + ${h.link_to(cs.branch,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} %endif diff --git a/kallithea/templates/data_table/_dt_elements.html b/kallithea/templates/data_table/_dt_elements.html --- a/kallithea/templates/data_table/_dt_elements.html +++ b/kallithea/templates/data_table/_dt_elements.html @@ -13,7 +13,7 @@ return name %>
- ${base.repotag(rtype)} + ${base.repolabel(rtype)} ${get_name(name)} diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html --- a/kallithea/templates/pullrequests/pullrequest_show.html +++ b/kallithea/templates/pullrequests/pullrequest_show.html @@ -161,7 +161,7 @@ ${self.repo_context_bar('showpullrequest
%for tag in cs.tags: - + ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} %endfor diff --git a/kallithea/templates/summary/summary.html b/kallithea/templates/summary/summary.html --- a/kallithea/templates/summary/summary.html +++ b/kallithea/templates/summary/summary.html @@ -63,12 +63,12 @@ ${self.repo_context_bar('summary')}
- ${self.repotag(c.db_repo)} + ${self.repolabel(c.db_repo)} ${_('Show by ID')}
@@ -77,7 +77,7 @@ ${self.repo_context_bar('summary')}
-
${h.urlify_text(c.db_repo.description, stylize=c.visual.stylify_metatags)}
+
${h.urlify_text(c.db_repo.description, stylize=c.visual.stylify_metalabels)}
diff --git a/kallithea/tests/functional/test_home.py b/kallithea/tests/functional/test_home.py --- a/kallithea/tests/functional/test_home.py +++ b/kallithea/tests/functional/test_home.py @@ -21,11 +21,11 @@ class TestHomeController(TestController) response.mustcontain('Add Repository') response.mustcontain( - """git""" + """git""" ) response.mustcontain( - """hg""" + """hg""" ) # html in javascript variable: diff --git a/kallithea/tests/functional/test_summary.py b/kallithea/tests/functional/test_summary.py --- a/kallithea/tests/functional/test_summary.py +++ b/kallithea/tests/functional/test_summary.py @@ -33,7 +33,7 @@ class TestSummaryController(TestControll # repo type response.mustcontain( - """hg""" + """hg""" ) # public/private response.mustcontain( @@ -59,7 +59,7 @@ class TestSummaryController(TestControll # repo type response.mustcontain( - """git""" + """git""" ) # public/private response.mustcontain( @@ -84,7 +84,7 @@ class TestSummaryController(TestControll # repo type response.mustcontain( - """hg""" + """hg""" ) # public/private response.mustcontain( @@ -113,7 +113,7 @@ class TestSummaryController(TestControll # repo type response.mustcontain( - """git""" + """git""" ) # public/private response.mustcontain( diff --git a/kallithea/tests/other/test_libs.py b/kallithea/tests/other/test_libs.py --- a/kallithea/tests/other/test_libs.py +++ b/kallithea/tests/other/test_libs.py @@ -215,12 +215,12 @@ class TestLibs(TestController): ) from kallithea.lib.helpers import urlify_text res = urlify_text(sample, stylize=True) - assert '
tag
' in res - assert '
obsolete
' in res - assert '
stale
' in res - assert '
python
' in res - assert '
requires => url
' in res - assert '
tag
' in res + assert '
tag
' in res + assert '
obsolete
' in res + assert '
stale
' in res + assert '
python
' in res + assert '
requires => url
' in res + assert '
tag
' in res def test_alternative_gravatar(self): from kallithea.lib.helpers import gravatar_url