Changeset - 1ab38cd72704
[Not reviewed]
default
0 11 0
domruf - 9 years ago 2016-09-20 20:01:59
dominikruf@gmail.com
template: use Bootstrap tooltips and popover instead of handmade tooltips

Based on work from Andrew Shadura <andrew@shadura.me>.

Further modified by Mads Kiilerich.

show_changeset_tooltip is merged into tooltip_activate.
11 files changed with 195 insertions and 131 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changeset.py
Show inline comments
 
@@ -99,25 +99,25 @@ def _ignorews_url(GET, fileid=None):
 
        if ig_ws is None:
 
            params[fileid] += ['WS:1']
 
            lbl = _('Ignore whitespace')
 

	
 
        ctx_key = fileid
 
        ctx_val = 'C:%s' % ln_ctx
 
    # if we have passed in ln_ctx pass it along to our params
 
    if ln_ctx:
 
        params[ctx_key] += [ctx_val]
 

	
 
    params['anchor'] = fileid
 
    icon = h.literal('<i class="icon-strike"></i>')
 
    return h.link_to(icon, h.url.current(**params), title=lbl, class_='tooltip')
 
    return h.link_to(icon, h.url.current(**params), title=lbl, **{'data-toggle': 'tooltip'})
 

	
 

	
 
def get_line_ctx(fid, GET):
 
    ln_ctx_global = GET.get('context')
 
    if fid:
 
        ln_ctx = filter(lambda k: k.startswith('C'), GET.getall(fid))
 
    else:
 
        _ln_ctx = filter(lambda k: k.startswith('C'), GET)
 
        ln_ctx = GET.get(_ln_ctx[0]) if _ln_ctx  else ln_ctx_global
 
        if ln_ctx:
 
            ln_ctx = [ln_ctx]
 

	
 
@@ -159,25 +159,25 @@ def _context_url(GET, fileid=None):
 
    else:
 
        params[fileid] += ['C:%s' % ln_ctx]
 
        ig_ws_key = fileid
 
        ig_ws_val = 'WS:%s' % 1
 

	
 
    if ig_ws:
 
        params[ig_ws_key] += [ig_ws_val]
 

	
 
    lbl = _('Increase diff context to %(num)s lines') % {'num': ln_ctx}
 

	
 
    params['anchor'] = fileid
 
    icon = h.literal('<i class="icon-sort"></i>')
 
    return h.link_to(icon, h.url.current(**params), title=lbl, class_='tooltip')
 
    return h.link_to(icon, h.url.current(**params), title=lbl, **{'data-toggle': 'tooltip'})
 

	
 

	
 
# Could perhaps be nice to have in the model but is too high level ...
 
def create_comment(text, status, f_path, line_no, revision=None, pull_request_id=None, closing_pr=None):
 
    """Comment functionality shared between changesets and pullrequests"""
 
    f_path = f_path or None
 
    line_no = line_no or None
 

	
 
    comment = ChangesetCommentsModel().create(
 
        text=text,
 
        repo=c.db_repo.repo_id,
 
        author=c.authuser.user_id,
kallithea/lib/helpers.py
Show inline comments
 
@@ -302,37 +302,36 @@ def pygmentize_annotation(repo_name, fil
 
        if cs in color_dict:
 
            col = color_dict[cs]
 
        else:
 
            col = color_dict[cs] = cgenerator.next()
 
        return "color: rgb(%s)! important;" % (', '.join(col))
 

	
 
    def url_func(repo_name):
 

	
 
        def _url_func(changeset):
 
            author = escape(changeset.author)
 
            date = changeset.date
 
            message = escape(changeset.message)
 
            tooltip_html = ("<div style='font-size:0.8em'><b>Author:</b>"
 
                            " %s<br/><b>Date:</b> %s</b><br/><b>Message:"
 
                            "</b> %s<br/></div>") % (author, date, message)
 
            tooltip_html = ("<b>Author:</b> %s<br/>"
 
                            "<b>Date:</b> %s</b><br/>"
 
                            "<b>Message:</b> %s") % (author, date, message)
 

	
 
            lnk_format = show_id(changeset)
 
            uri = link_to(
 
                    lnk_format,
 
                    url('changeset_home', repo_name=repo_name,
 
                        revision=changeset.raw_id),
 
                    style=get_color_string(changeset.raw_id),
 
                    class_='safe-html-title',
 
                    title=tooltip_html,
 
                    **{'data-toggle': 'tooltip'}
 
                    **{'data-toggle': 'popover',
 
                       'data-content': tooltip_html}
 
                  )
 

	
 
            uri += '\n'
 
            return uri
 
        return _url_func
 

	
 
    return literal(markup_whitespace(annotate_highlight(filenode, url_func(repo_name), **kwargs)))
 

	
 

	
 
class _Message(object):
 
    """A message returned by ``Flash.pop_messages()``.
 

	
 
@@ -559,25 +558,25 @@ def action_parser(user_log, feed=False, 
 
                    else:
 
                        lbl = 'Unknown operation %s' % rev.op
 
                else:
 
                    lazy_cs = True
 
                    lbl = rev.short_id[:8]
 
                    url_ = url('changeset_home', repo_name=repo_name,
 
                               revision=rev.raw_id)
 
            else:
 
                # changeset cannot be found - it might have been stripped or removed
 
                lbl = rev[:12]
 
                title_ = _('Changeset %s not found') % lbl
 
            if parse_cs:
 
                return link_to(lbl, url_, title=title_, class_='tooltip')
 
                return link_to(lbl, url_, title=title_, **{'data-toggle': 'tooltip'})
 
            return link_to(lbl, url_, class_='lazy-cs' if lazy_cs else '',
 
                           **{'data-raw_id':rev.raw_id, 'data-repo_name':repo_name})
 

	
 
        def _get_op(rev_txt):
 
            _op = None
 
            _name = rev_txt
 
            if len(rev_txt.split('=>')) == 2:
 
                _op, _name = rev_txt.split('=>')
 
            return _op, _name
 

	
 
        revs = []
 
        if len(filter(lambda v: v != '', revs_ids)) > 0:
kallithea/public/css/style.css
Show inline comments
 
@@ -2615,55 +2615,24 @@ table.code-browser i[class^='icon-'] {
 

	
 
.info_box_elem {
 
    display: inline-block;
 
    padding: 0 2px;
 
}
 

	
 
.yui-overlay, .yui-panel-container {
 
    visibility: hidden;
 
    position: absolute;
 
    z-index: 2;
 
}
 

	
 
#tip-box {
 
    position: absolute;
 

	
 
    background-color: #FFF;
 
    border: 2px solid #577632;
 
    font: 100% sans-serif;
 
    width: auto;
 
    opacity: 1;
 
    padding: 8px;
 

	
 
    white-space: pre-wrap;
 
    border-radius: 8px 8px 8px 8px;
 
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
 
    z-index: 100000;
 
}
 

	
 
.hl-tip-box {
 
    z-index: 1;
 
    position: absolute;
 
    color: #666;
 
    background-color: #FFF;
 
    border: 2px solid #577632;
 
    font: 100% sans-serif;
 
    width: auto;
 
    opacity: 1;
 
    padding: 8px;
 
    white-space: pre-wrap;
 
    border-radius: 8px 8px 8px 8px;
 
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
 
}
 

	
 

	
 
.mentions-container {
 
    width: 90% !important;
 
}
 
.mentions-container .yui-ac-content {
 
    width: 100% !important;
 
}
 

	
 
.ac {
 
    vertical-align: top;
 
}
 

	
 
@@ -2974,25 +2943,25 @@ input.btn {
 

	
 
.btn::-moz-focus-inner {
 
    border: 0;
 
    padding: 0;
 
}
 

	
 
.btn.badge {
 
    cursor: default !important;
 
}
 

	
 
input[disabled].btn,
 
.btn.disabled {
 
    color: #999;
 
    opacity: 0.5;
 
}
 

	
 
.label,
 
.btn.btn-sm {
 
    padding: 3px 8px;
 
}
 

	
 
.btn.btn-xs {
 
    padding: 1px 5px;
 
}
 

	
 
.btn:focus {
 
@@ -4425,12 +4394,153 @@ body table.dataTable thead .sorting_desc
 
.text-nowrap {
 
    white-space: nowrap;
 
}
 

	
 
div.codeblock div.code-header div.author {
 
    height: auto;
 
    min-height: 25px;
 
}
 

	
 
ul.user_group_member li {
 
    clear: both;
 
}
 

	
 
.tooltip {
 
    position: absolute;
 
    z-index: 1070;
 
    display: block;
 
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
 
    font-size: 12px;
 
    font-style: normal;
 
    font-weight: 400;
 
    line-height: 1.42857143;
 
    text-align: left;
 
    text-align: start;
 
    text-decoration: none;
 
    text-shadow: none;
 
    text-transform: none;
 
    letter-spacing: normal;
 
    word-break: normal;
 
    word-spacing: normal;
 
    word-wrap: normal;
 
    white-space: normal;
 
}
 
.tooltip-arrow {
 
    position: absolute;
 
    width: 0;
 
    height: 0;
 
    border-color: transparent;
 
    border-style: solid;
 
}
 
.tooltip-inner {
 
    max-width: 200px;
 
    padding: 3px 8px;
 
    color: #fff;
 
    text-align: center;
 
    background-color: #000;
 
    border-radius: 4px;
 
}
 

	
 
.tooltip.top {
 
    padding: 5px 0;
 
    margin-top: -3px;
 
}
 
.tooltip.top .tooltip-arrow {
 
    bottom: 0;
 
    left: 50%;
 
    margin-left: -5px;
 
    border-width: 5px 5px 0;
 
    border-top-color: #000;
 
}
 

	
 
.tooltip.bottom {
 
    padding: 5px 0;
 
    margin-top: 3px;
 
}
 
.tooltip.bottom .tooltip-arrow {
 
    top: 0;
 
    left: 50%;
 
    margin-left: -5px;
 
    border-width: 0 5px 5px;
 
    border-bottom-color: #000;
 
}
 

	
 

	
 
.popover {
 
    position: absolute;
 
    top: 0;
 
    left: 0;
 
    z-index: 1060;
 
    max-width: 276px;
 
    padding: 1px;
 
    background-color: #fff;
 
    background-clip: padding-box;
 
    border: 1px solid #ccc;
 
    border: 1px solid rgba(0,0,0,.2);
 
    border-radius: 6px;
 
    box-shadow: 0 5px 10px rgba(0,0,0,.2);
 
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
 
    font-size: 12px;
 
    font-style: normal;
 
    font-weight: 400;
 
    line-height: 1.42857143;
 
    text-align: left;
 
    text-align: start;
 
    text-decoration: none;
 
    text-shadow: none;
 
    text-transform: none;
 
    letter-spacing: normal;
 
    word-break: normal;
 
    word-spacing: normal;
 
    word-wrap: normal;
 
    white-space: normal;
 
}
 

	
 
.popover > .arrow {
 
    border-width: 11px;
 
}
 
.popover > .arrow,
 
.popover > .arrow::after {
 
    position: absolute;
 
    display: block;
 
    width: 0;
 
    height: 0;
 
    border-color: transparent;
 
    border-style: solid;
 
}
 

	
 
.popover-title {
 
    padding: 8px 14px;
 
    margin: 0;
 
    font-size: 14px;
 
    background-color: #f7f7f7;
 
    border-bottom: 1px solid #ebebeb;
 
    border-radius: 5px 5px 0 0;
 
}
 

	
 
.popover-content {
 
    padding: 9px 14px;
 
}
 

	
 
.popover.top {
 
    margin-top: -10px;
 
}
 
.popover.top > .arrow {
 
    bottom: -11px;
 
    left: 50%;
 
    margin-left: -11px;
 
    border-top-color: #999;
 
    border-top-color: rgba(0,0,0,.25);
 
    border-bottom-width: 0;
 
}
 

	
 
.popover.bottom {
 
    margin-top: 10px;
 
}
 
.popover.bottom > .arrow {
 
    top: -11px;
 
    left: 50%;
 
    margin-left: -11px;
 
    border-top-width: 0;
 
    border-bottom-color: #999;
 
    border-bottom-color: rgba(0,0,0,.25);
 
}
kallithea/public/js/base.js
Show inline comments
 
@@ -402,43 +402,24 @@ var ajaxPOST = function(url, postData, s
 
 * activate .show_more links
 
 * the .show_more must have an id that is the the id of an element to hide prefixed with _
 
 * the parentnode will be displayed
 
 */
 
var show_more_event = function(){
 
    $('.show_more').click(function(e){
 
        var el = e.currentTarget;
 
        $('#' + el.id.substring(1)).hide();
 
        $(el.parentNode).show();
 
    });
 
};
 

	
 
/**
 
 * activate .lazy-cs mouseover for showing changeset tooltip
 
 */
 
var show_changeset_tooltip = function(){
 
    $('.lazy-cs').mouseover(function(e){
 
        var $target = $(e.currentTarget);
 
        var rid = $target.data('raw_id');
 
        var repo_name = $target.data('repo_name');
 
        if(rid && !$target.hasClass('tooltip')){
 
            _show_tooltip(e, _TM['loading ...']);
 
            var url = pyroutes.url('changeset_info', {"repo_name": repo_name, "revision": rid});
 
            ajaxGET(url, function(json){
 
                    $target.addClass('tooltip');
 
                    _show_tooltip(e, json['message']);
 
                    _activate_tooltip($target);
 
                });
 
        }
 
    });
 
};
 

	
 
var _onSuccessFollow = function(target){
 
    var $target = $(target);
 
    var $f_cnt = $('#current_followers_count');
 
    if ($target.hasClass('follow')) {
 
        $target.removeClass('follow').addClass('following');
 
        $target.prop('title', _TM['Stop following this repository']);
 
        if ($f_cnt.html()) {
 
            var cnt = Number($f_cnt.html())+1;
 
            $f_cnt.html(cnt);
 
        }
 
    } else {
 
@@ -466,94 +447,74 @@ var showRepoSize = function(target, repo
 
    if(!$("#" + target).hasClass('loaded')){
 
        $("#" + target).html(_TM['Loading ...']);
 
        var url = pyroutes.url('repo_size', {"repo_name":repo_name});
 
        $.post(url, args, function(data) {
 
            $("#" + target).html(data);
 
            $("#" + target).addClass('loaded');
 
        });
 
    }
 
    return false;
 
};
 

	
 
/**
 
 * tooltips
 
 * load tooltips dynamically based on data attributes, used for .lazy-cs changeset links
 
 */
 

	
 
var tooltip_activate = function(){
 
    $(document).ready(_init_tooltip);
 
};
 

	
 
var _activate_tooltip = function($tt){
 
    $tt.mouseover(_show_tooltip);
 
    $tt.mousemove(_move_tooltip);
 
    $tt.mouseout(_close_tooltip);
 
};
 
var get_changeset_tooltip = function() {
 
    var $target = $(this);
 
    var tooltip = $target.data('tooltip');
 
    if (!tooltip) {
 
        var raw_id = $target.data('raw_id');
 
        var repo_name = $target.data('repo_name');
 
        var url = pyroutes.url('changeset_info', {"repo_name": repo_name, "revision": raw_id});
 

	
 
var _init_tooltip = function(){
 
    var $tipBox = $('#tip-box');
 
    if(!$tipBox.length){
 
        $tipBox = $('<div id="tip-box"></div>');
 
        $(document.body).append($tipBox);
 
        $.ajax(url, {
 
            async: false,
 
            success: function(data) {
 
                tooltip = data["message"];
 
    }
 

	
 
    $tipBox.hide();
 
    $tipBox.css('position', 'absolute');
 
    $tipBox.css('max-width', '600px');
 

	
 
    _activate_tooltip($('[data-toggle="tooltip"]'));
 
        });
 
        $target.data('tooltip', tooltip);
 
    }
 
    return tooltip;
 
};
 

	
 
var _show_tooltip = function(e, tipText, safe){
 
    e.stopImmediatePropagation();
 
    var el = e.currentTarget;
 
    var $el = $(el);
 
    if(tipText){
 
        // just use it
 
    } else if(el.tagName.toLowerCase() === 'img'){
 
        tipText = el.alt ? el.alt : '';
 
/**
 
 * activate tooltips and popups
 
 */
 
var tooltip_activate = function(){
 
    function placement(p, e){
 
        if(e.getBoundingClientRect().top > 2*$(window).height()/3){
 
            return 'top';
 
    } else {
 
        tipText = el.title ? el.title : '';
 
        safe = safe || $el.hasClass("safe-html-title");
 
            return 'bottom';
 
        }
 
    }
 

	
 
    if(tipText !== ''){
 
        // save org title
 
        $el.attr('tt_title', tipText);
 
        // reset title to not show org tooltips
 
        $el.prop('title', '');
 

	
 
        var $tipBox = $('#tip-box');
 
        if (safe) {
 
            $tipBox.html(tipText);
 
        } else {
 
            $tipBox.text(tipText);
 
        }
 
        $tipBox.css('display', 'block');
 
    }
 
    $(document).ready(function(){
 
        $('[data-toggle="tooltip"]').tooltip({
 
            placement: placement
 
        });
 
        $('[data-toggle="popover"]').popover({
 
            html: true,
 
            container: 'body',
 
            placement: placement,
 
            trigger: 'hover',
 
            template: '<div class="popover cs-popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
 
        });
 
        $('.lazy-cs').tooltip({
 
            title: get_changeset_tooltip,
 
            placement: placement
 
        });
 
    });
 
};
 

	
 
var _move_tooltip = function(e){
 
    e.stopImmediatePropagation();
 
    var $tipBox = $('#tip-box');
 
    $tipBox.css('top', (e.pageY + 15) + 'px');
 
    $tipBox.css('left', (e.pageX + 15) + 'px');
 
};
 

	
 
var _close_tooltip = function(e){
 
    e.stopImmediatePropagation();
 
    var $tipBox = $('#tip-box');
 
    $tipBox.hide();
 
    var el = e.currentTarget;
 
    $(el).prop('title', $(el).attr('tt_title'));
 
};
 

	
 
/**
 
 * Quick filter widget
 
 *
 
 * @param target: filter input target
 
 * @param nodes: list of nodes in html we want to filter.
 
 * @param display_element function that takes current node from nodes and
 
 *    does hide or show based on the node
 
 */
 
var q_filter = (function() {
 
    var _namespace = {};
 
    var namespace = function (target) {
kallithea/templates/admin/admin_log.html
Show inline comments
 
@@ -35,25 +35,24 @@
 
        <td>${l.user_ip}</td>
 
    </tr>
 
    %endfor
 
</table>
 

	
 
<script type="text/javascript">
 
  $(document).ready(function(){
 
    var $user_log = $('#user_log');
 
    $user_log.on('click','.pager_link',function(e){
 
      asynchtml(e.target.href, $user_log, function(){
 
        show_more_event();
 
        tooltip_activate();
 
        show_changeset_tooltip();
 
      });
 
      e.preventDefault();
 
    });
 
    $user_log.on('click','.show_more',function(e){
 
      var el = e.target;
 
      $('#'+el.id.substring(1)).show();
 
      $(el.parentNode).hide();
 
    });
 
  });
 
</script>
 

	
 
<ul class="pagination">
kallithea/templates/base/root.html
Show inline comments
 
@@ -72,25 +72,24 @@
 
            (function(window,undefined){
 
                var History = window.History; // Note: We are using a capital H instead of a lower h
 
                if ( !History.enabled ) {
 
                     // History.js is disabled for this browser.
 
                     // This is because we can optionally choose to support HTML4 browsers or not.
 
                    return false;
 
                }
 
            })(window);
 

	
 
            $(document).ready(function(){
 
              tooltip_activate();
 
              show_more_event();
 
              show_changeset_tooltip();
 
              // routes registration
 
              pyroutes.register('home', "${h.url('home')}", []);
 
              pyroutes.register('new_gist', "${h.url('new_gist')}", []);
 
              pyroutes.register('gists', "${h.url('gists')}", []);
 
              pyroutes.register('new_repo', "${h.url('new_repo')}", []);
 

	
 
              pyroutes.register('summary_home', "${h.url('summary_home', repo_name='%(repo_name)s')}", ['repo_name']);
 
              pyroutes.register('changelog_home', "${h.url('changelog_home', repo_name='%(repo_name)s')}", ['repo_name']);
 
              pyroutes.register('files_home', "${h.url('files_home', repo_name='%(repo_name)s',revision='%(revision)s',f_path='%(f_path)s')}", ['repo_name', 'revision', 'f_path']);
 
              pyroutes.register('edit_repo', "${h.url('edit_repo', repo_name='%(repo_name)s')}", ['repo_name']);
 
              pyroutes.register('edit_repo_perms', "${h.url('edit_repo_perms', repo_name='%(repo_name)s')}", ['repo_name']);
 
              pyroutes.register('pullrequest_home', "${h.url('pullrequest_home', repo_name='%(repo_name)s')}", ['repo_name']);
kallithea/templates/data_table/_dt_elements.html
Show inline comments
 
@@ -36,25 +36,25 @@
 
      <i class="icon-wrench" title="${_('Repository creation in progress...')}"></i>
 
    %endif
 
  </div>
 
</%def>
 

	
 
<%def name="last_change(last_change)">
 
  <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="tooltip" title="${'%s:\n\n%s' % (h.escape(author), h.escape(last_msg))}" class="revision-link safe-html-title" 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="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>
 

	
 
<%def name="rss(name)">
 
  %if c.authuser.username != 'default':
 
    <a title="${_('Subscribe to %s rss feed')% name}" href="${h.url('rss_feed_home',repo_name=name,api_key=c.authuser.api_key)}"><i class="icon-rss-squared"></i></a>
 
  %else:
 
    <a title="${_('Subscribe to %s rss feed')% name}" href="${h.url('rss_feed_home',repo_name=name)}"><i class="icon-rss-squared"></i></a>
 
  %endif
kallithea/templates/files/files_source.html
Show inline comments
 
@@ -30,29 +30,29 @@
 
              %if c.annotate:
 
                ${h.link_to(_('Show Source'),    h.url('files_home',         repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="btn btn-default btn-xs")}
 
              %else:
 
                ${h.link_to(_('Show Annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="btn btn-default btn-xs")}
 
              %endif
 
              ${h.link_to(_('Show as Raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="btn btn-default btn-xs")}
 
              ${h.link_to(_('Download as Raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="btn btn-default btn-xs")}
 
              %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
 
               %if c.on_branch_head and not c.file.is_binary:
 
                ${h.link_to(_('Edit on Branch: %s') % c.changeset.branch, h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-default btn-xs")}
 
                ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-danger btn-xs")}
 
               %elif c.on_branch_head and c.file.is_binary:
 
                ${h.link_to(_('Edit'), '#', class_="btn btn-default btn-xs disabled tooltip", title=_('Editing binary files not allowed'))}
 
                ${h.link_to(_('Edit'), '#', class_="btn btn-default btn-xs disabled", title=_('Editing binary files not allowed'),**{'data-toggle':'tooltip'})}
 
                ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-danger btn-xs")}
 
               %else:
 
                ${h.link_to(_('Edit'), '#', class_="btn btn-default btn-xs disabled tooltip", title=_('Editing files allowed only when on branch head revision'))}
 
                ${h.link_to(_('Delete'), '#', class_="btn btn-danger btn-xs disabled tooltip", title=_('Deleting files allowed only when on branch head revision'))}
 
                ${h.link_to(_('Edit'), '#', class_="btn btn-default btn-xs disabled", title=_('Editing files allowed only when on branch head revision'),**{'data-toggle':'tooltip'})}
 
                ${h.link_to(_('Delete'), '#', class_="btn btn-danger btn-xs disabled", title=_('Deleting files allowed only when on branch head revision'),**{'data-toggle':'tooltip'})}
 
               %endif
 
              %endif
 
        </div>
 
        </div>
 
        <div class="author">
 
            ${h.gravatar_div(h.email_or_none(c.changeset.author), size=16)}
 
            <div title="${c.changeset.author}" class="user">${h.person(c.changeset.author)}</div>
 
        </div>
 
        <div class="commit">${h.urlify_text(c.changeset.message,c.repo_name)}</div>
 
    </div>
 
    <div class="code-body">
 
      %if c.file.is_browser_compatible_image():
kallithea/templates/followers/followers.html
Show inline comments
 
@@ -23,19 +23,18 @@ ${self.repo_context_bar('followers')}
 
        <div id="followers">
 
            <%include file='followers_data.html'/>
 
        </div>
 
    </div>
 
</div>
 
<script type="text/javascript">
 
  $(document).ready(function(){
 
    var $followers = $('#followers');
 
    $followers.on('click','.pager_link',function(e){
 
        asynchtml(e.target.href, $followers, function(){
 
            show_more_event();
 
            tooltip_activate();
 
            show_changeset_tooltip();
 
        });
 
        e.preventDefault();
 
    });
 
  });
 
</script>
 
</%def>
kallithea/templates/forks/forks.html
Show inline comments
 
@@ -23,19 +23,18 @@ ${self.repo_context_bar('showforks')}
 
        <div id="forks">
 
            <%include file='forks_data.html'/>
 
        </div>
 
    </div>
 
</div>
 
<script type="text/javascript">
 
  $(document).ready(function(){
 
      var $forks = $('#forks');
 
      $forks.on('click','.pager_link',function(e){
 
          asynchtml(e.target.href, $forks, function(){
 
              show_more_event();
 
              tooltip_activate();
 
              show_changeset_tooltip();
 
          });
 
          e.preventDefault();
 
      });
 
  });
 
</script>
 
</%def>
kallithea/templates/journal/journal.html
Show inline comments
 
@@ -53,38 +53,36 @@
 
    });
 
    $('#filter_form').submit(function(e){
 
        e.preventDefault();
 
        var val = $('#j_filter').val();
 
        window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val);
 
    });
 
    fix_j_filter_width($('#j_filter').val().length);
 

	
 
    $('#refresh').click(function(e){
 
        asynchtml("${h.url.current(filter=c.search_term)}", $("#journal"), function(){
 
            show_more_event();
 
            tooltip_activate();
 
            show_changeset_tooltip();
 
            });
 
        e.preventDefault();
 
    });
 

	
 
</script>
 

	
 
<script type="text/javascript">
 
    $(document).ready(function(){
 
        var $journal = $('#journal');
 
        $journal.on('click','.pager_link',function(e){
 
            asynchtml(e.target.href, $journal, function(){
 
                show_more_event();
 
                tooltip_activate();
 
                show_changeset_tooltip();
 
            });
 
            e.preventDefault();
 
        });
 
        $('#journal').on('click','.show_more',function(e){
 
            var el = e.target;
 
            $('#'+el.id.substring(1)).show();
 
            $(el.parentNode).hide();
 
        });
 
    });
 
</script>
 
</%def>
0 comments (0 inline, 0 general)