Repository: airavata-php-gateway Updated Branches: refs/heads/develop 25d482b36 -> 69a0c0fa4
Making Time common across all UIs in Notices. Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/69a0c0fa Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/69a0c0fa Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/69a0c0fa Branch: refs/heads/develop Commit: 69a0c0fa455f3c1939054908a8e00be50808e820 Parents: 25d482b Author: Nipurn Doshi <[email protected]> Authored: Wed May 4 14:35:22 2016 -0400 Committer: Nipurn Doshi <[email protected]> Committed: Wed May 4 14:35:22 2016 -0400 ---------------------------------------------------------------------- app/libraries/CommonUtilities.php | 25 +++++++++++++++---------- app/views/admin/manage-notices.blade.php | 6 +++--- public/css/bootstrap.min.css | 18 +++++++++++++++--- public/js/time-conversion.js | 3 +-- 4 files changed, 34 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/69a0c0fa/app/libraries/CommonUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php index d04b881..4976324 100644 --- a/app/libraries/CommonUtilities.php +++ b/app/libraries/CommonUtilities.php @@ -251,11 +251,12 @@ class CommonUtilities $textColor = "text-warning"; elseif( $notice->priority == NotificationPriority::HIGH) $textColor = "text-danger"; + $noticesUI .= ' <div class="notification"> <div class="notification-title ' . $textColor . '">' . $notice->title . '</div> - <div class="notification-description"><strong></strong>' . $notice->notificationMessage . '</div> - <div class="notification-ago">' . date("m/d/Y h:i:s A T", $notice->publishedTime/1000) . '</div> + <div class="notification-description"><strong>' . $notice->notificationMessage . '</strong></div> + <div class="notification-ago time" unix-time="' . $notice->publishedTime/1000 . '">' . date("m/d/Y h:i:s A T", $notice->publishedTime/1000) . '</div> <div class="notification-icon"></div> </div> <!-- / .notification --> '; @@ -270,26 +271,30 @@ class CommonUtilities else $newNotices = $countOfNotices; - if( !$newNotices) + if( $newNotices <=0) $notifVisibility = "hide"; $noticesUI = '<li clas="dropdown" style="color:#fff; relative">' . '<a href="#" class="dropdown-toggle notif-link" data-toggle="dropdown">' . '<span class="glyphicon glyphicon-bell notif-bell"></span>' . '<span class="notif-num ' . $notifVisibility . '" data-total-notices="' . $countOfNotices . '">' . $newNotices . '</span>'. - '<div class="dropdown-menu widget-notifications no-padding" style="width: 300px"><div class="slimScrollDiv" style="position: relative; overflow-y: scroll; overflow-x:hidden; width: auto; max-height: 250px;"><div class="notifications-list" id="main-navbar-notifications" style=" width: auto; max-height: 250px;">' + '<div class="dropdown-menu widget-notifications no-padding" style="width: 300px"><div class="slimScrollDiv"><div class="notifications-list" id="main-navbar-notifications">' . $noticesUI; $noticesUI .= ' - </div><div class="slimScrollBar" style="width: 7px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 195.925px; background: rgb(0, 0, 0);"></div> + </div><div class="slimScrollBar" style=""></div> - <div class="slimScrollRail" style="width: 7px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div></div> <!-- / .notifications-list --> - <a href="#" class="notifications-link"><!--MORE NOTIFICATIONS--></a> - </div>'. - '</a>'. - '</li>'; + <div class="slimScrollRail" style=""></div></div> <!-- / .notifications-list -->'; + if (!Session::has("admin")) + { + $noticesUI .= '<a href="' . URL::to('/') . '/admin/dashboard/notices" class="notifications-link">Manage Notifications</a>'; + } + else + $noticesUI .= '<a href="#" class="notifications-link"></a>'; + + $noticesUI .= '</div>'.'</li>'; return $noticesUI; } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/69a0c0fa/app/views/admin/manage-notices.blade.php ---------------------------------------------------------------------- diff --git a/app/views/admin/manage-notices.blade.php b/app/views/admin/manage-notices.blade.php index 04ef689..5594b50 100644 --- a/app/views/admin/manage-notices.blade.php +++ b/app/views/admin/manage-notices.blade.php @@ -282,12 +282,12 @@ var formData = $("#update-notice .notice-form-values").serialize(); var publishedTime = $("#update-notice .notice-publishedTime").val(); if( publishedTime != "") - formData += "&publishedTime="+ publishedTime; + formData += "&publishedTime="+ moment( publishedTime ).utc().format('MM/DD/YYYY hh:mm a'); else formData += "&publishedTime="; var expirationTime = $("#update-notice .notice-expirationTime").val(); if( expirationTime != "") - formData += "&expirationTime="+expirationTime; + formData += "&expirationTime="+ moment( expirationTime ).utc().format('MM/DD/YYYY hh:mm a'); else formData += "&expirationTime="; @@ -376,7 +376,7 @@ var row = "<td>" + noticeObject.title + "</td>" + "<td>" + noticeObject.notificationMessage + "</td>" + "<td class='date'>" + convertTimestamp( noticeObject.publishedTime) + "</td>" + - "<td class='date'>" + convertTimestamp( noticeObject.expirationTime ) + "'</td>" + + "<td class='date'>" + convertTimestamp( noticeObject.expirationTime ) + "</td>" + "<td>" + prioritiesList[noticeObject.priority] + "</td>"+ "<td class='update-notice-icon'><span class='glyphicon glyphicon-pencil'></span></td>"+ "<td class='delete-notice-icon'><span class='glyphicon glyphicon-trash'></span></td>"; http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/69a0c0fa/public/css/bootstrap.min.css ---------------------------------------------------------------------- diff --git a/public/css/bootstrap.min.css b/public/css/bootstrap.min.css index 3e364dd..fa46029 100644 --- a/public/css/bootstrap.min.css +++ b/public/css/bootstrap.min.css @@ -82,17 +82,29 @@ body{ .notif-link, .notif-link:hover, .notif-link:active, .notif-link:focus{ text-decoration: none; cursor: default; - padding: 15px !important; padding-bottom: 0 !important; } .widget-notifications .notification{position:relative;padding:7px 12px; text-decoration:none;} .widget-notifications .notification+.notification{border-top:1px solid #e4e4e4} -.widget-notifications .notifications-list{position:relative} +.widget-notifications .notifications-list{position:relative; width: auto; max-height: 250px;} .widget-notifications .notification-ago,.widget-notifications .notification-description,.widget-notifications .notification-title{display:block;margin-right:35px} .widget-notifications .notification-title{font-size:11px;font-weight:700;padding-bottom:1px}.widget-notifications .notification-description{font-size:11px;color:#666}.widget-notifications .notification-ago{font-size:11px;font-style:italic;color:#bbb} .widget-notifications .notification-icon{width:26px;height:26px;line-height:26px;text-align:center;border-radius:2px;position:absolute;top:50%;right:0;margin:-13px 12px 0 0;font-size:14px} .widget-notifications .notifications-link{text-align:center;padding:8px 0!important;border-top:1px solid #e4e4e4;display:block;text-decoration:none!important;font-size:10px;font-weight:800;color:#999;line-height:18px!important;height:auto!important} .widget-notifications .notifications-link:hover{background:#f4f4f4;color:#555; text-decoration:none;} -.widget-notifications:hover{text-decoration:none;} \ No newline at end of file +.widget-notifications:hover{text-decoration:none;} + +.slimScrollDiv{ + position: relative; + overflow-y: scroll; + overflow-x:hidden; + width: auto; + max-height: 250px; +} + +.slimScrollBar{ + width: 7px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 195.925px; background: rgb(0, 0, 0); +} +.slimScrollRail{width: 7px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/69a0c0fa/public/js/time-conversion.js ---------------------------------------------------------------------- diff --git a/public/js/time-conversion.js b/public/js/time-conversion.js index a9683d6..4146baa 100644 --- a/public/js/time-conversion.js +++ b/public/js/time-conversion.js @@ -27,10 +27,9 @@ function convertTimestamp(timestamp) { } // ie: 2013-02-18, 8:35 AM - time = yyyy + '-' + mm + '-' + dd + ', ' + h + ':' + min + ' ' + ampm; + time = mm + '/' + dd + '/' + yyyy + ', ' + h + ':' + min + ' ' + ampm; var offset = new Date().toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1]; - return time + " - " + offset; }
