view kallithea/templates/admin/notifications/notifications.html @ 6422:1f02a239c23c

style: use panel, panel-heading, panel-title, panel-body and settings This imply lots of tweaking of header handling and panel spacing. Not converted yet: codeblock code-header code-body. Based on work by Dominik Ruf.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 09 Jan 2017 00:41:30 +0100
parents e34cf36e024a
children 3dcf1f82311a
line wrap: on
line source

## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>

<%block name="title">
    ${_('My Notifications')} ${c.authuser.username}
</%block>

<%def name="breadcrumbs_links()">
    ${_('My Notifications')}
</%def>

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

<%def name="main()">
<div class="panel panel-primary">
    <div class="panel-heading clearfix">
        ${self.breadcrumbs()}
    </div>

    <div class="panel-body">
      <div class="pull-left">
            <span id='all' class="btn btn-default btn-sm"><a href="${h.url.current()}">${_('All')}</a></span>
            <span id='comment' class="btn btn-default btn-sm"><a href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a></span>
            <span id='pull_request' class="btn btn-default btn-sm"><a href="${h.url.current(type=c.pull_request_type)}">${_('Pull Requests')}</a></span>
      </div>
      %if c.notifications:
        <span id='mark_all_read' class="btn btn-default btn-sm pull-right">${_('Mark All Read')}</span>
      %endif
    </div>
    <div id="notification_data" class="panel-body">
        <%include file='notifications_data.html'/>
    </div>
</div>
<script type="text/javascript">
var url_delete = "${url('notification_delete', notification_id='__NOTIFICATION_ID__')}";
var url_read = "${url('notification_update', notification_id='__NOTIFICATION_ID__')}";
var run = function(){
  $('.delete-notification').click(function(e){
    var notification_id = e.currentTarget.id;
    deleteNotification(url_delete,notification_id);
  });
  $('.read-notification').click(function(e){
    var notification_id = e.currentTarget.id;
    readNotification(url_read,notification_id);
  });
}
run();
$('#mark_all_read').click(function(){
    var url = "${h.url('notifications_mark_all_read', **request.GET.mixed())}";
    asynchtml(url, $('#notification_data'), function(){run();});
});

var current_filter = "${c.current_filter}";
$('#'+current_filter).addClass('active');
</script>
</%def>