- Timestamp:
- 10/23/21 17:48:25 (3 years ago)
- Branches:
- develop, master
- Children:
- a8346eb
- Parents:
- 4b7e2d3
- Location:
- resources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/assets/js/custom.js
r4b7e2d3 rb39afb5 108 108 }); 109 109 110 function hasNew(response) {111 112 for(var i=0; i<response.length; i++) {113 if(!response[i].isRead) {114 return true;115 }116 }117 118 return false;119 }120 121 function notifications() {122 123 var url = "/dashboard/get-notifications";124 var _token = $("meta[name='csrf-token']").attr("content");125 126 $.ajax({127 url: url,128 type: "post",129 dataType: "json",130 data: {131 _token : _token,132 },133 success: function(response) {134 135 $(".dropdown-notifications a:not(:last)").remove();136 $(".dropdown-notifications-unread .nav-unread").hide();137 138 var l = response.length;139 140 if(hasNew(response)) {141 $(".dropdown-notifications .unreadNotificationsInfo").hide();142 $(".dropdown-notifications-unread .nav-unread").show();143 }144 145 if(l == 0) {146 $(".dropdown-notifications .unreadNotificationsInfo").show();147 }148 149 if(l > 0) {150 $(".dropdown-notifications .unreadNotificationsInfo").hide();151 }152 153 for(var i=0; i<l; i++) {154 155 var style = response[i].isRead ? "" : "background: #efefef; color: black;";156 157 var notificationItem = `158 <a href="` + response[i].url + `" class="dropdown-item d-flex" style="` + style + `;">159 <div>160 ` + response[i].message + `161 <div class="small text-muted">` + response[i].ago + `</div>162 </div>163 </a>`;164 165 $(".dropdown-notifications").prepend(notificationItem);166 }167 },168 error: function(response) {169 console.log(response);170 }171 });172 }173 174 $(".dropdown-notifications-unread .nav-unread").hide();175 notifications();176 setInterval(function() { notifications(); }, 5000);177 178 $(".dropdown-notifications-wrapper").click(function() {179 $(".dropdown-notifications-unread .nav-unread").hide();180 });181 182 110 $(document).on('click', '#btn-layout-builder', function () { 183 111 -
resources/views/dashboard/departments/index.blade.php
r4b7e2d3 rb39afb5 134 134 <div class="form-group"> 135 135 <label class="form-label">Code</label> 136 <input type=" text" name="code" value="{{ $department->code }}" minlength="2" maxlength="30" class="form-control" placeholder="Code" required>136 <input type="number" name="code" value="{{ $department->code }}" minlength="1" class="form-control" placeholder="Code" required> 137 137 </div> 138 138 </div> … … 174 174 <div class="form-group"> 175 175 <label>Code</label> 176 <input type=" text" name="code" value="{{ old('code') }}" minlength="2" maxlength="30" class="form-control" placeholder="Code" required>176 <input type="number" name="code" value="{{ old('code') }}" minlength="1" class="form-control" placeholder="Code" required> 177 177 </div> 178 178 </div> -
resources/views/layouts/app.blade.php
r4b7e2d3 rb39afb5 125 125 <!-- end::header fullscreen --> 126 126 127 <!-- begin::header notification dropdown -->128 <li class="nav-item dropdown">129 {{-- <div class="dropdown dropdown-notifications-wrapper dropdown-menu-right dropdown-menu-big">--}}130 {{-- <a href="javascript:void(0)" class="nav-link dropdown-notifications-unread icon" data-toggle="dropdown">--}}131 {{-- <i data-feather="bell"></i>--}}132 {{-- <span class="nav-unread"></span>--}}133 {{-- </a>--}}134 {{-- <div class="dropdown-menu dropdown-notifications dropdown-menu-right dropdown-menu-big">--}}135 {{-- <div class="bg-dark p-4 text-center d-flex justify-content-between align-items-center">--}}136 {{-- <h5 class="mb-0">Notifications</h5>--}}137 {{-- </div>--}}138 {{-- <div class="p-4 text-center align-items-center">--}}139 {{-- <p class='text-center unreadNotificationsInfo'>No unread notifications</p>--}}140 {{-- </div>--}}141 {{-- <div class="dropdown-divider"></div>--}}142 {{-- <a href="{{ route("dashboard.notifications.index") }}" class="dropdown-item text-center text-muted-dark">See all</a>--}}143 {{-- </div>--}}144 {{-- </div>--}}145 146 <div class="dropdown dropdown-notifications-wrapper d-none d-md-flex">147 <a class="nav-link dropdown-notifications-unread icon" data-toggle="dropdown">148 <i class="fe fe-bell"></i>149 <span class="nav-unread"></span>150 </a>151 <div class="dropdown-menu dropdown-notifications dropdown-menu-right dropdown-menu-arrow">152 <p class='text-center unreadNotificationsInfo'>No unread notifications</p>153 <div class="dropdown-divider"></div>154 <a href="{{ route("dashboard.notifications.index") }}" class="dropdown-item text-center text-muted-dark">See all</a>155 </div>156 </div>157 </li>158 159 {{-- </li>--}}160 <!-- end::header notification dropdown -->161 162 127 <!-- begin::user menu --> 163 128 <li class="nav-item dropdown">
Note:
See TracChangeset
for help on using the changeset viewer.