Changeset - 80ae9f5e9b32
[Not reviewed]
default
0 5 0
Mads Kiilerich - 8 years ago 2017-06-18 01:09:18
mads@kiilerich.com
notifications: remove custom 'container' class to avoid conflict with Bootstrap ... and rewrite things to use plain Bootstrap

Most of the markup and styling turned out to be easy to replace with plain
Bootstrap markup.
5 files changed with 19 insertions and 68 deletions:
0 comments (0 inline, 0 general)
kallithea/public/css/style.css
Show inline comments
 
@@ -2956,46 +2956,6 @@ input.status_change_radio {
 
    border-radius: 4px !important;
 
}
 

	
 
.notification-header {
 
    padding-top: 6px;
 
}
 
.notification-header .desc {
 
    font-size: 16px;
 
    height: 24px;
 
    float: left
 
}
 
.notification-list .container.unread {
 
    background: none repeat scroll 0 0 rgba(255, 255, 180, 0.6);
 
}
 
.notification-header .gravatar {
 
    background: none repeat scroll 0 0 transparent;
 
    padding: 0px 0px 0px 8px;
 
}
 
.notification-list .container .notification-header .desc {
 
    font-weight: bold;
 
    font-size: 17px;
 
}
 
.notification-header .delete-notifications {
 
    float: right;
 
    padding-top: 8px;
 
    cursor: pointer;
 
}
 
.notification-header .read-notifications {
 
    float: right;
 
    padding-top: 8px;
 
    cursor: pointer;
 
}
 
.notification-subject {
 
    clear: both;
 
    border-bottom: 1px solid #eee;
 
    padding: 5px 0px;
 
}
 

	
 
.notification-body {
 
    clear: both;
 
    margin: 34px 2px 2px 8px
 
}
 

	
 
/****
 
PULL REQUESTS
 
*****/
kallithea/public/js/base.js
Show inline comments
 
@@ -971,7 +971,7 @@ var deleteNotification = function(url, n
 
var readNotification = function(url, notification_id, callbacks){
 
    var success = function(o){
 
            var $obj = $("#notification_"+notification_id);
 
            $obj.removeClass('unread');
 
            $obj.removeClass('list-group-item-warning');
 
            $obj.find('.read-notification').remove();
 
            _run_callbacks(callbacks);
 
        };
kallithea/templates/admin/notifications/notifications.html
Show inline comments
 
@@ -21,9 +21,9 @@
 

	
 
    <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>
 
            <a class="btn btn-default btn-sm" href="${h.url.current()}">${_('All')}</a>
 
            <a class="btn btn-default btn-sm" href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a>
 
            <a class="btn btn-default btn-sm" href="${h.url.current(type=c.pull_request_type)}">${_('Pull Requests')}</a>
 
      </div>
 
      %if c.notifications:
 
        <span id='mark_all_read' class="btn btn-default btn-sm pull-right">${_('Mark All Read')}</span>
kallithea/templates/admin/notifications/notifications_data.html
Show inline comments
 

	
 
%if c.notifications:
 
<%
 
unread = lambda n:{False:'unread'}.get(n)
 
%>
 

	
 
<div class="notification-list notification-table list-group">
 
<div class="list-group">
 
%for notification in c.notifications:
 
  <div id="notification_${notification.notification.notification_id}" class="list-group-item ${unread(notification.read)}">
 
    <div>
 
  <div id="notification_${notification.notification.notification_id}" class="list-group-item ${'' if notification.read else 'list-group-item-warning'} clearfix">
 
      ${h.gravatar_div(notification.notification.created_by_user.email, size=24)}
 
      <span class="desc ${unread(notification.read)}">
 
      <span class="pull-left">
 
        <a href="${url('notification', notification_id=notification.notification.notification_id)}">${notification.notification.description}</a>
 
      </span>
 
      <span class="delete-notifications" title="${_('Delete')}">
 
        <span id="${notification.notification.notification_id}" class="delete-notification"><i class="btn icon-minus-circled"></i></span>
 
      <span class="pull-right">
 
        %if not notification.read:
 
          <span id="${notification.notification.notification_id}" class="btn btn-default btn-xs read-notification"><i class="icon-ok"></i>${_('Mark as read')}</span>
 
        %endif
 
        <span id="${notification.notification.notification_id}" class="btn btn-default btn-xs delete-notification"><i class="icon-minus-circled"></i>${_('Delete')}</span>
 
      </span>
 
      %if not notification.read:
 
      <span class="read-notifications" title="${_('Mark as read')}">
 
        <span id="${notification.notification.notification_id}" class="read-notification"><i class="btn icon-ok"></i></span>
 
      </span>
 
      %endif
 
    </div>
 
    <div class="notification-subject"></div>
 
  </div>
 
%endfor
 
</div>
kallithea/templates/admin/notifications/show_notification.html
Show inline comments
 
@@ -22,17 +22,17 @@
 
    </div>
 
    <div class="panel-body">
 
      <div id="notification_${c.notification.notification_id}">
 
        <div class="notification-header">
 
        <div class="clearfix">
 
          ${h.gravatar_div(c.notification.created_by_user.email, size=24)}
 
          <span class="desc">
 
          <span class="pull-left">
 
              ${c.notification.description}
 
          </span>
 
          <span class="delete-notifications">
 
            <span id="${c.notification.notification_id}" class="delete-notification action"><i class="btn icon-minus-circled"></i></span>
 
          </span>
 
          <span id="${c.notification.notification_id}" class="delete-notification btn btn-default pull-right"><i class="icon-minus-circled"></i>${_('Delete')}</span>
 
        </div>
 
        <div class="notification-body">
 
            <div class="notification-subject">${h.literal(c.notification.subject)}</div>
 
        <div>
 
            %if c.notification.subject:
 
                <div class="h4">${h.literal(c.notification.subject)}</div>
 
            %endif
 
            <div class="well">
 
            %if c.notification.body:
 
                ${h.render_w_mentions(c.notification.body)}
0 comments (0 inline, 0 general)