Changeset b39afb5
- Timestamp:
- 10/23/21 17:48:25 (3 years ago)
- Branches:
- develop, master
- Children:
- a8346eb
- Parents:
- 4b7e2d3
- Files:
-
- 3 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Requests/Dashboard/NewDepartmentRequest.php
r4b7e2d3 rb39afb5 26 26 return [ 27 27 "name" => "required|min:2|max:30|unique:departments,name", 28 "code" => "required|min: 2|max:10|unique:departments,code"28 "code" => "required|min:1|integer|unique:departments,code" 29 29 ]; 30 30 } -
app/Http/Requests/Dashboard/UpdateDepartmentRequest.php
r4b7e2d3 rb39afb5 26 26 return [ 27 27 "name" => "required|min:2|max:30|unique:departments,name,$this->id,id", 28 "code" => "required|min: 2|max:30|unique:departments,code,$this->id,id"28 "code" => "required|min:1|integer|unique:departments,code,$this->id,id" 29 29 ]; 30 30 } -
database/migrations/2021_09_29_121244_create_departments_table.php
r4b7e2d3 rb39afb5 17 17 $table->increments('id'); 18 18 $table->string("name"); 19 $table-> string("code");19 $table->integer("code"); 20 20 $table->integer("user_id")->unsigned(); 21 21 $table->string("location"); -
database/seeders/DatabaseSeeder.php
r4b7e2d3 rb39afb5 21 21 $this->call(FileTypesTableSeeder::class); 22 22 $this->call(FoldersTableSeeder::class); 23 $this->call(FilesTableSeeder::class);23 //$this->call(FilesTableSeeder::class); 24 24 } 25 25 } -
public/assets/js/app.js
r4b7e2d3 rb39afb5 1015 1015 }); 1016 1016 1017 function hasNew(response) {1018 1019 for(var i=0; i<response.length; i++) {1020 if(!response[i].isRead) {1021 return true;1022 }1023 }1024 1025 return false;1026 }1027 1028 function notifications() {1029 1030 var url = "/dashboard/get-notifications";1031 var _token = $("meta[name='csrf-token']").attr("content");1032 1033 $.ajax({1034 url: url,1035 type: "post",1036 dataType: "json",1037 data: {1038 _token : _token,1039 },1040 success: function(response) {1041 1042 $(".dropdown-notifications a:not(:last)").remove();1043 $(".dropdown-notifications-unread .nav-unread").hide();1044 1045 var l = response.length;1046 1047 if(hasNew(response)) {1048 $(".dropdown-notifications .unreadNotificationsInfo").hide();1049 $(".dropdown-notifications-unread .nav-unread").show();1050 }1051 1052 if(l == 0) {1053 $(".dropdown-notifications .unreadNotificationsInfo").show();1054 }1055 1056 if(l > 0) {1057 $(".dropdown-notifications .unreadNotificationsInfo").hide();1058 }1059 1060 for(var i=0; i<l; i++) {1061 1062 var style = response[i].isRead ? "" : "background: #efefef; color: black;";1063 1064 var notificationItem = `1065 <a href="` + response[i].url + `" class="dropdown-item d-flex" style="` + style + `;">1066 <div>1067 ` + response[i].message + `1068 <div class="small text-muted">` + response[i].ago + `</div>1069 </div>1070 </a>`;1071 1072 $(".dropdown-notifications").prepend(notificationItem);1073 }1074 },1075 error: function(response) {1076 console.log(response);1077 }1078 });1079 }1080 1081 $(".dropdown-notifications-unread .nav-unread").hide();1082 notifications();1083 setInterval(function() { notifications(); }, 5000);1084 1085 $(".dropdown-notifications-wrapper").click(function() {1086 $(".dropdown-notifications-unread .nav-unread").hide();1087 });1088 1089 1017 $(document).on('click', '#btn-layout-builder', function () { 1090 1018 -
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"> -
routes/web.php
r4b7e2d3 rb39afb5 111 111 Route::get('files/export', 'Dashboard\ExportExcelController@ExportFiles')->name("dashboard.files.export"); 112 112 113 // Notifications114 Route::get("/notifications", "Dashboard\NotificationsController@notifications")->name("dashboard.notifications.index");115 Route::post("/get-notifications", "Dashboard\NotificationsController@showNotifications")->name("dashboard.notifications.store");116 117 118 113 });
Note:
See TracChangeset
for help on using the changeset viewer.