changeset 6702:80ae9f5e9b32

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.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 18 Jun 2017 01:09:18 +0200
parents f2c7bf6f72d5
children a181d4bd4c3d
files kallithea/public/css/style.css kallithea/public/js/base.js kallithea/templates/admin/notifications/notifications.html kallithea/templates/admin/notifications/notifications_data.html kallithea/templates/admin/notifications/show_notification.html
diffstat 5 files changed, 19 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/css/style.css	Sun Jun 18 01:09:18 2017 +0200
+++ b/kallithea/public/css/style.css	Sun Jun 18 01:09:18 2017 +0200
@@ -2956,46 +2956,6 @@
     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
 *****/
--- a/kallithea/public/js/base.js	Sun Jun 18 01:09:18 2017 +0200
+++ b/kallithea/public/js/base.js	Sun Jun 18 01:09:18 2017 +0200
@@ -971,7 +971,7 @@
 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);
         };
--- a/kallithea/templates/admin/notifications/notifications.html	Sun Jun 18 01:09:18 2017 +0200
+++ b/kallithea/templates/admin/notifications/notifications.html	Sun Jun 18 01:09:18 2017 +0200
@@ -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>
--- a/kallithea/templates/admin/notifications/notifications_data.html	Sun Jun 18 01:09:18 2017 +0200
+++ b/kallithea/templates/admin/notifications/notifications_data.html	Sun Jun 18 01:09:18 2017 +0200
@@ -1,27 +1,18 @@
-
 %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>
--- a/kallithea/templates/admin/notifications/show_notification.html	Sun Jun 18 01:09:18 2017 +0200
+++ b/kallithea/templates/admin/notifications/show_notification.html	Sun Jun 18 01:09:18 2017 +0200
@@ -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)}