Changeset - 1619d9ebc1b9
[Not reviewed]
default
1 6 0
Sean Farley - 11 years ago 2015-02-18 00:02:34
sean.michael.farley@gmail.com
giticon.png: use repotag class to make an icon

A quick search revealed that some old css code was never used, so it was
removed.
7 files changed with 6 insertions and 14 deletions:
0 comments (0 inline, 0 general)
kallithea/public/css/contextbar.css
Show inline comments
 
/**
 
 * Stylesheets for the context bar
 
 */
 

	
 
i.icon-ellipsis-horizontal:after { content: ' ...';}
 
i.icon-git { background-image: url('../images/icons/giticon.png');}
 
i.icon-disabled { background-image: url('../images/icons/shading.png');} /* todo: use instead of minus sign */
 

	
 
i[class^='icon-'] {
 
    background-repeat: no-repeat;
 
    background-position: center;
 
    display: inline-block;
 
    min-width: 16px;
 
    min-height: 16px;
 
    margin: -2px 0 -4px 0;
 
    /* background-color: red; /* for debugging */
 

	
 
}
 

	
 
/* css classes for diff file status ... it'd be nice if css had a way to
 
   inherit from another class but alas, we must make sure this content is the
 
   same from the icon font file */
 

	
 
.icon-diff-M:before {
 
    font-family: 'kallithea';
 
    content: '\e805';
 
    color: #d0b44c;
 
}
 

	
 
.icon-diff-D:before {
kallithea/public/css/style.css
Show inline comments
 
@@ -480,55 +480,48 @@ div.header img {
 
#header #header-inner #quick ul.repo_switcher {
 
    max-height: 275px;
 
    overflow-x: hidden;
 
    overflow-y: auto;
 
}
 

	
 
#header #header-inner #quick ul.repo_switcher li.qfilter_rs {
 
    padding: 2px 3px;
 
    padding-right: 17px;
 
}
 

	
 
#header #header-inner #quick ul.repo_switcher li.qfilter_rs input {
 
    width: 100%;
 
    border-radius: 10px;
 
    padding: 2px 7px;
 
}
 

	
 
#header #header-inner #quick .repo_switcher_type {
 
    position: absolute;
 
    left: 0;
 
    top: 9px;
 
    margin: 0px 2px 0px 2px;
 
}
 

	
 
#header #header-inner #quick li ul li a.git,
 
#header #header-inner #quick li ul li a.git:hover {
 
    background-image: url("../images/icons/giticon.png");
 
    padding-left: 42px;
 
    background-position: 20px 9px;
 
}
 

	
 
.groups_breadcrumbs a {
 
    color: #fff;
 
}
 

	
 
.groups_breadcrumbs a:hover {
 
    color: #bfe3ff;
 
    text-decoration: none;
 
}
 

	
 
td.quick_repo_menu:before {
 
    font-family: "kallithea";
 
    content: "\e80f";           /* triangle-right */
 
    margin-left: 3px;
 
    padding-right: 3px;
 
}
 

	
 
td.quick_repo_menu {
 
    cursor: pointer;
 
    width: 8px;
 
    border: 1px solid transparent;
 
}
 

	
 
td.quick_repo_menu.active:before {
 
    font-family: "kallithea";
kallithea/public/images/icons/giticon.png
Show inline comments
 
deleted file
 
binary diff not shown
Show images
kallithea/templates/base/base.html
Show inline comments
 
@@ -80,49 +80,49 @@
 
</%def>
 

	
 
<%def name="repo_context_bar(current=None, rev=None)">
 
  <% rev = None if rev == 'tip' else rev %>
 
  <%
 
      def follow_class():
 
          if c.repository_following:
 
              return h.literal('following')
 
          else:
 
              return h.literal('follow')
 
  %>
 
  <%
 
    def is_current(selected):
 
        if selected == current:
 
            return h.literal('class="current"')
 
    %>
 

	
 
  <!--- CONTEXT BAR -->
 
  <div id="context-bar" class="box">
 
      <h2>
 
        %if h.is_hg(c.db_repo):
 
          <span class="repotag">hg</span>
 
        %endif
 
        %if h.is_git(c.db_repo):
 
          <i class="icon-git" style="color: #e85634; font-size: 24px"></i>
 
          <span class="repotag">git</span>
 
        %endif
 

	
 
        ## public/private
 
        %if c.db_repo.private:
 
          <i class="icon-keyhole-circled"></i>
 
        %else:
 
          <i class="icon-globe"></i>
 
        %endif
 
        ${h.repo_link(c.db_repo.groups_and_repo)}
 

	
 
        %if current == 'createfork':
 
         - ${_('Create Fork')}
 
        %endif
 
      </h2>
 
      <!--
 
      <div id="breadcrumbs">
 
        ${h.link_to(_(u'Repositories'),h.url('home'))}
 
        &raquo;
 
        ${h.repo_link(c.db_repo.groups_and_repo)}
 
      </div>
 
      -->
 
      <ul id="context-pages" class="horizontal-list">
 
        <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}"><i class="icon-file-text"></i> ${_('Summary')}</a></li>
 
        %if rev:
 
@@ -342,49 +342,49 @@
 
            </ol>
 
            </div>
 
          %endif
 
        </div>
 
      </div>
 
    </li>
 

	
 
    <script type="text/javascript">
 
        var visual_show_public_icon = "${c.visual.show_public_icon}" == "True";
 
        var cache = {}
 
        /*format the look of items in the list*/
 
        var format = function(state){
 
            if (!state.id){
 
              return state.text; // optgroup
 
            }
 
            var obj_dict = state.obj;
 
            var tmpl = '';
 

	
 
            if(obj_dict && state.type == 'repo'){
 
                tmpl += '<span class="repo-icons">';
 
                if(obj_dict['repo_type'] === 'hg'){
 
                    tmpl += '<span class="repotag">hg</span> ';
 
                }
 
                else if(obj_dict['repo_type'] === 'git'){
 
                    tmpl += '<i class="icon-git"></i> ';
 
                    tmpl += '<span class="repotag">git</span> ';
 
                }
 
                if(obj_dict['private']){
 
                    tmpl += '<i class="icon-keyhole-circled"></i> ';
 
                }
 
                else if(visual_show_public_icon){
 
                    tmpl += '<i class="icon-globe"></i> ';
 
                }
 
                tmpl += '</span>';
 
            }
 
            if(obj_dict && state.type == 'group'){
 
                    tmpl += '<i class="icon-folder"></i> ';
 
            }
 
            tmpl += state.text;
 
            return tmpl;
 
        }
 

	
 
        $("#repo_switcher").select2({
 
            placeholder: '<i class="icon-database"></i> ${_('Repositories')}',
 
            dropdownAutoWidth: true,
 
            formatResult: format,
 
            formatSelection: format,
 
            formatNoMatches: function(term){
 
                return "${_('No matches found')}";
 
            },
kallithea/templates/data_table/_dt_elements.html
Show inline comments
 
@@ -49,49 +49,49 @@
 
    </li>
 
  </ul>
 
</%def>
 

	
 
<%def name="repo_name(name,rtype,rstate,private,fork_of,short_name=False,admin=False)">
 
    <%
 
    def get_name(name,short_name=short_name):
 
      if short_name:
 
        return name.split('/')[-1]
 
      else:
 
        return name
 
    %>
 
  <div style="white-space: nowrap; ${'opacity: 0.5' if rstate == 'repo_state_pending' else ''}}">
 
    ##NAME
 
    %if admin:
 
        <a href="${h.url('edit_repo',repo_name=name)}">
 
    %else:
 
        <a href="${h.url('summary_home',repo_name=name)}">
 
    %endif
 

	
 
    ##TYPE OF REPO
 
    %if h.is_hg(rtype):
 
        <span class="repotag" title="${_('Mercurial repository')}">hg</span>
 
    %elif h.is_git(rtype):
 
        <span title="${_('Git repository')}"><i class="icon-git" style="color: #e85634; font-size: 14px;"></i></span>
 
        <span class="repotag" title="${_('Git repository')}">git</span>
 
    %endif
 

	
 
    ##PRIVATE/PUBLIC
 
    %if private and c.visual.show_private_icon:
 
      <i class="icon-keyhole-circled" title="${_('Private repository')}" style="font-size: 16px; vertical-align: -2px; margin: 0px 1px 0px 3px"></i>
 
    %elif not private and c.visual.show_public_icon:
 
      <i class="icon-globe" title="${_('Public repository')}" style="font-size: 16px; vertical-align: -2px; margin: 0px 1px 0px 3px"></i>
 
    %else:
 
      <span style="margin: 0px 8px 0px 8px"></span>
 
    %endif
 
    ${get_name(name)}
 
    </a>
 
    %if fork_of:
 
      <a href="${h.url('summary_home',repo_name=fork_of.repo_name)}"><i class="icon-fork"></i></a>
 
    %endif
 
    %if rstate == 'repo_state_pending':
 
      <i class="icon-wrench" style="color: #036185;" title="${_('Repository creation in progress...')}"></i>
 
    %endif
 
  </div>
 
</%def>
 

	
 
<%def name="last_change(last_change)">
 
  <span class="tooltip" date="${last_change}" title="${h.tooltip(h.fmt_date(last_change))}">${h.age(last_change)}</span>
 
</%def>
kallithea/tests/functional/test_home.py
Show inline comments
 
from kallithea.tests import *
 
from kallithea.tests.fixture import Fixture
 
from kallithea.model.meta import Session
 
from kallithea.model.db import Repository
 
from kallithea.model.repo import RepoModel
 
from kallithea.model.repo_group import RepoGroupModel
 

	
 

	
 
fixture = Fixture()
 

	
 

	
 
class TestHomeController(TestController):
 

	
 
    def test_index(self):
 
        self.log_user()
 
        response = self.app.get(url(controller='home', action='index'))
 
        #if global permission is set
 
        response.mustcontain('Add Repository')
 
        # html in javascript variable:
 
        response.mustcontain('var data = {"totalRecords": %s' % len(Repository.getAll()))
 
        response.mustcontain(r'href=\"/%s\"' % HG_REPO)
 

	
 
        response.mustcontain(r'<i class=\"icon-git\"')
 
        response.mustcontain(r'<span class="repotag">git')
 
        response.mustcontain(r'<i class=\"icon-globe\"')
 

	
 
        response.mustcontain("""fixes issue with having custom format for git-log""")
 
        response.mustcontain("""/%s/changeset/5f2c6ee195929b0be80749243c18121c9864a3b3""" % GIT_REPO)
 

	
 
        response.mustcontain("""disable security checks on hg clone for travis""")
 
        response.mustcontain("""/%s/changeset/96507bd11ecc815ebc6270fdf6db110928c09c1e""" % HG_REPO)
 

	
 
    def test_repo_summary_with_anonymous_access_disabled(self):
 
        with fixture.anon_access(False):
 
            response = self.app.get(url(controller='summary',
 
                                        action='index', repo_name=HG_REPO),
 
                                        status=302)
 
            assert 'login' in response.location
 

	
 
    def test_index_with_anonymous_access_disabled(self):
 
        with fixture.anon_access(False):
 
            response = self.app.get(url(controller='home', action='index'),
 
                                    status=302)
 
            assert 'login' in response.location
 

	
 
    def test_index_page_on_groups(self):
 
        self.log_user()
 
        gr = fixture.create_repo_group('gr1')
kallithea/tests/functional/test_summary.py
Show inline comments
 
@@ -32,98 +32,98 @@ class TestSummaryController(TestControll
 
                                    repo_name=HG_REPO))
 

	
 
        #repo type
 
        response.mustcontain(
 
            """<span class="repotag">hg"""
 
        )
 
        #public/private
 
        response.mustcontain(
 
            """<i class="icon-globe">"""
 
        )
 

	
 
        # clone url...
 
        response.mustcontain('''id="clone_url" readonly="readonly" value="http://test_admin@localhost:80/%s"''' % HG_REPO)
 
        response.mustcontain('''id="clone_url_id" readonly="readonly" value="http://test_admin@localhost:80/_%s"''' % ID)
 

	
 
    def test_index_git(self):
 
        self.log_user()
 
        ID = Repository.get_by_repo_name(GIT_REPO).repo_id
 
        response = self.app.get(url(controller='summary',
 
                                    action='index',
 
                                    repo_name=GIT_REPO))
 

	
 
        #repo type
 
        response.mustcontain(
 
            """<i class="icon-git" """
 
            """<span class="repotag">git"""
 
        )
 
        #public/private
 
        response.mustcontain(
 
            """<i class="icon-globe">"""
 
        )
 

	
 
        # clone url...
 
        response.mustcontain('''id="clone_url" readonly="readonly" value="http://test_admin@localhost:80/%s"''' % GIT_REPO)
 
        response.mustcontain('''id="clone_url_id" readonly="readonly" value="http://test_admin@localhost:80/_%s"''' % ID)
 

	
 
    def test_index_by_id_hg(self):
 
        self.log_user()
 
        ID = Repository.get_by_repo_name(HG_REPO).repo_id
 
        response = self.app.get(url(controller='summary',
 
                                    action='index',
 
                                    repo_name='_%s' % ID))
 

	
 
        #repo type
 
        response.mustcontain(
 
            """<span class="repotag">hg"""
 
        )
 
        #public/private
 
        response.mustcontain(
 
            """<i class="icon-globe">"""
 
        )
 

	
 
    def test_index_by_repo_having_id_path_in_name_hg(self):
 
        self.log_user()
 
        fixture.create_repo(name='repo_1')
 
        response = self.app.get(url(controller='summary',
 
                                    action='index',
 
                                    repo_name='repo_1'))
 

	
 
        try:
 
            response.mustcontain("repo_1")
 
        finally:
 
            RepoModel().delete(Repository.get_by_repo_name('repo_1'))
 
            Session().commit()
 

	
 
    def test_index_by_id_git(self):
 
        self.log_user()
 
        ID = Repository.get_by_repo_name(GIT_REPO).repo_id
 
        response = self.app.get(url(controller='summary',
 
                                    action='index',
 
                                    repo_name='_%s' % ID))
 

	
 
        #repo type
 
        response.mustcontain(
 
            """<i class="icon-git" """
 
            """<span class="repotag">git"""
 
        )
 
        #public/private
 
        response.mustcontain(
 
            """<i class="icon-globe">"""
 
        )
 

	
 
    def _enable_stats(self, repo):
 
        r = Repository.get_by_repo_name(repo)
 
        r.enable_statistics = True
 
        Session().add(r)
 
        Session().commit()
 

	
 
    def test_index_trending(self):
 
        self.log_user()
 
        #codes stats
 
        self._enable_stats(HG_REPO)
 

	
 
        ScmModel().mark_for_invalidation(HG_REPO)
 
        response = self.app.get(url(controller='summary', action='index',
 
                                    repo_name=HG_REPO))
 
        response.mustcontain(
 
            '[["py", {"count": 68, "desc": ["Python"]}], '
 
            '["rst", {"count": 16, "desc": ["Rst"]}], '
 
            '["css", {"count": 2, "desc": ["Css"]}], '
0 comments (0 inline, 0 general)