Changeset - 789de118156b
[Not reviewed]
default
0 6 0
domruf - 8 years ago 2017-06-29 23:17:15
dominikruf@gmail.com
style: consistently use 'changeset_hash' class for monospace hashes

Get rid of 'revision-link' and some use of 'hash'.

There is still some use of 'hash' for columns, but the content there already
has 'changeset_hash'.
6 files changed with 7 insertions and 29 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -1031,13 +1031,13 @@ def urlify_text(s, repo_name=None, link_
 
        mention = match_obj.group('mention')
 
        if mention is not None:
 
            return '<b>%s</b>' % mention
 
        hash_ = match_obj.group('hash')
 
        if hash_ is not None and repo_name is not None:
 
            from kallithea.config.routing import url  # doh, we need to re-import url to mock it later
 
            return '<a class="revision-link" href="%(url)s">%(hash)s</a>' % {
 
            return '<a class="changeset_hash" href="%(url)s">%(hash)s</a>' % {
 
                 'url': url('changeset_home', repo_name=repo_name, revision=hash_),
 
                 'hash': hash_,
 
                }
 
        bold = match_obj.group('bold')
 
        if bold is not None:
 
            return '<b>*%s*</b>' % _urlify(bold[1:-1])
kallithea/public/css/style.css
Show inline comments
 
@@ -1583,29 +1583,12 @@ table#changesets tr > td.mid .message a:
 
}
 

	
 
#updaterevs-table {
 
    margin-left: 40px !important;
 
}
 

	
 
#compare_branches + div.panel-body .revision-link,
 
#compare_tags + div.panel-body .revision-link,
 
#compare_bookmarks + div.panel-body .revision-link,
 
div.panel-body #files_data .revision-link,
 
#repos_list_wrap .revision-link,
 
#shortlog_data .revision-link {
 
    font-weight: normal !important;
 
    font-family: monospace;
 
    font-size: 12px;
 
    color: #577632;
 
}
 

	
 
.revision-link {
 
    color: #3F6F9F;
 
    font-weight: bold !important;
 
}
 

	
 
.issue-tracker-link {
 
    color: #3F6F9F;
 
    font-weight: bold !important;
 
}
 

	
 
/* changeset statuses (must be the same name as the status) */
 
@@ -2021,17 +2004,12 @@ table.code-browser i[class^='icon-'] {
 
    border: medium none;
 
    color: #FFF;
 
    font-weight: 700;
 
    font-size: 14px;
 
}
 

	
 
.breadcrumbs .hash {
 
    text-transform: none;
 
    color: #fff;
 
}
 

	
 
div#legend_data {
 
    padding-left: 10px;
 
}
 
div#legend_container table {
 
    border: none !important;
 
}
kallithea/templates/changeset/changeset.html
Show inline comments
 
@@ -6,13 +6,13 @@
 

	
 
<%block name="title">
 
    ${_('%s Changeset') % c.repo_name} - ${h.show_id(c.changeset)}
 
</%block>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${_('Changeset')} - <span class='hash'>${h.show_id(c.changeset)}</span>
 
    ${_('Changeset')} - <span class='changeset_hash'>${h.show_id(c.changeset)}</span>
 
</%def>
 

	
 
<%block name="header_menu">
 
    ${self.menu('repositories')}
 
</%block>
 

	
kallithea/templates/data_table/_dt_elements.html
Show inline comments
 
@@ -37,13 +37,13 @@
 
  <span data-toggle="tooltip" title="${h.fmt_date(last_change)}" date="${last_change}">${h.age(last_change)}</span>
 
</%def>
 

	
 
<%def name="revision(name,rev,tip,author,last_msg)">
 
  <div>
 
  %if rev >= 0:
 
      <a data-toggle="popover" title="${author | entity}" data-content="${last_msg | entity}" class="hash" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a>
 
      <a data-toggle="popover" title="${author | entity}" data-content="${last_msg | entity}" class="changeset_hash" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a>
 
  %else:
 
      ${_('No changesets yet')}
 
  %endif
 
  </div>
 
</%def>
 

	
kallithea/templates/files/files_browser.html
Show inline comments
 
@@ -89,13 +89,13 @@
 
                     %if node.is_file():
 
                         ${h.format_byte_size(node.size,binary=True)}
 
                     %endif
 
                     </td>
 
                     <td>
 
                         %if node.is_file():
 
                             <a data-toggle="tooltip" title="${node.last_changeset.message}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=node.last_changeset.raw_id)}" class="revision-link">${h.show_id(node.last_changeset)}</a>
 
                             <a data-toggle="tooltip" title="${node.last_changeset.message}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=node.last_changeset.raw_id)}" class="changeset_hash">${h.show_id(node.last_changeset)}</a>
 
                         %endif
 
                     </td>
 
                     <td>
 
                         %if node.is_file():
 
                             <span data-toggle="tooltip" title="${h.fmt_date(node.last_changeset.date)}">
 
                            ${h.age(node.last_changeset.date)}</span>
kallithea/tests/other/test_libs.py
Show inline comments
 
@@ -284,13 +284,13 @@ class TestLibs(TestController):
 
    def test_clone_url_generator(self, tmpl, repo_name, overrides, prefix, expected):
 
        from kallithea.lib.utils2 import get_clone_url
 
        clone_url = get_clone_url(uri_tmpl=tmpl, qualified_home_url='http://vps1:8000'+prefix,
 
                                  repo_name=repo_name, repo_id=23, **overrides)
 
        assert clone_url == expected
 

	
 
    def _quick_url(self, text, tmpl="""<a class="revision-link" href="%s">%s</a>""", url_=None):
 
    def _quick_url(self, text, tmpl="""<a class="changeset_hash" href="%s">%s</a>""", url_=None):
 
        """
 
        Changes `some text url[foo]` => `some text <a href="/">foo</a>
 

	
 
        :param text:
 
        """
 
        import re
 
@@ -360,13 +360,13 @@ class TestLibs(TestController):
 
       """       some text lalala""",
 
       "https://foo.bar.example.com"),
 
      ("@mention @someone",
 
       """<b>@mention</b> <b>@someone</b>""",
 
       ""),
 
      ("deadbeefcafe 123412341234",
 
       """<a class="revision-link" href="/repo_name/changeset/deadbeefcafe">deadbeefcafe</a> <a class="revision-link" href="/repo_name/changeset/123412341234">123412341234</a>""",
 
       """<a class="changeset_hash" href="/repo_name/changeset/deadbeefcafe">deadbeefcafe</a> <a class="changeset_hash" href="/repo_name/changeset/123412341234">123412341234</a>""",
 
       ""),
 
      ("We support * markup for *bold* markup of *single or multiple* words, "
 
       "*a bit @like http://slack.com*. "
 
       "The first * must come after whitespace and not be followed by whitespace, "
 
       "contain anything but * and newline until the next *, "
 
       "which must not come after whitespace "
 
@@ -387,13 +387,13 @@ class TestLibs(TestController):
 
        with mock.patch('kallithea.config.routing.url', fake_url):
 
            from kallithea.lib.helpers import urlify_text
 
            assert urlify_text(sample, 'repo_name', stylize=True) == expected
 

	
 
    @parametrize('sample,expected', [
 
      ("deadbeefcafe @mention, and http://foo.bar/ yo",
 
       """<a class="revision-link" href="/repo_name/changeset/deadbeefcafe">deadbeefcafe</a>"""
 
       """<a class="changeset_hash" href="/repo_name/changeset/deadbeefcafe">deadbeefcafe</a>"""
 
       """<a class="message-link" href="#the-link"> <b>@mention</b>, and </a>"""
 
       """<a href="http://foo.bar/">http://foo.bar/</a>"""
 
       """<a class="message-link" href="#the-link"> yo</a>"""),
 
    ])
 
    def test_urlify_link(self, sample, expected):
 
        fake_url = FakeUrlGenerator(changeset_home='/%(repo_name)s/changeset/%(revision)s')
0 comments (0 inline, 0 general)