From a49c50f91e14f3c46b1fcaf204ab78f9b666b52c Mon Sep 17 00:00:00 2001 From: muahahahh Date: Sat, 9 Jan 2021 18:31:20 +0100 Subject: [PATCH] redesigned --- db.sqlite3 | Bin 176128 -> 176128 bytes .../static/css/employee_module_base.css | 27 +++++--- .../static/js/employee_module_base.js | 12 ++++ .../js/employee_module_show_schedule.js | 29 +++++++- .../static/js/employee_module_show_timelog.js | 28 +++++++- .../templates/employee_module_base.html | 4 +- hr_module/__pycache__/urls.cpython-38.pyc | Bin 1189 -> 1188 bytes hr_module/__pycache__/views.cpython-38.pyc | Bin 10274 -> 10311 bytes .../__pycache__/insert_to_plan.cpython-38.pyc | Bin 3472 -> 3702 bytes .../handling_functions/insert_to_plan.py | 23 ++++++- hr_module/static/css/calendar.css | 4 +- hr_module/static/css/calendar_local.css | 39 ++++++++++- hr_module/static/css/hr_module_base.css | 26 ++++--- .../static/css/hr_module_create_schedule.css | 19 +++-- hr_module/static/css/hr_module_import.css | 21 +++++- .../css/hr_module_schedule_creation_log.css | 1 + .../static/css/hr_module_show_schedule.css | 3 +- .../static/css/hr_module_show_timelog.css | 44 ++++++++++++ hr_module/static/js/hr_module_base.js | 12 ++++ .../static/js/hr_module_create_schedule.js | 65 +++++++++++------- .../static/js/hr_module_show_schedule.js | 32 ++++++++- hr_module/static/js/hr_module_show_timelog.js | 21 ++++-- hr_module/templates/hr_module_base.html | 21 +++--- .../templates/hr_module_create_schedule.html | 2 +- .../templates/hr_module_creation_log.html | 2 + hr_module/templates/hr_module_home.html | 2 +- .../templates/hr_module_show_timelog.html | 2 +- hr_module/urls.py | 2 +- hr_module/views.py | 4 +- ...portsadmin_2021-01-09T12:59:57.041734.xlsx | Bin 0 -> 5169 bytes ...portsadmin_2021-01-09T13:47:38.410800.xlsx | Bin 0 -> 5331 bytes ...portsadmin_2021-01-09T13:48:24.371867.xlsx | Bin 0 -> 5357 bytes ...portsadmin_2021-01-09T16:40:19.182956.xlsx | Bin 0 -> 5112 bytes static/css/base.css | 2 +- 34 files changed, 363 insertions(+), 84 deletions(-) create mode 100644 employee_module/static/js/employee_module_base.js create mode 100644 hr_module/static/css/hr_module_schedule_creation_log.css create mode 100644 hr_module/static/css/hr_module_show_timelog.css create mode 100644 hr_module/static/js/hr_module_base.js create mode 100644 import_reportsadmin_2021-01-09T12:59:57.041734.xlsx create mode 100644 import_reportsadmin_2021-01-09T13:47:38.410800.xlsx create mode 100644 import_reportsadmin_2021-01-09T13:48:24.371867.xlsx create mode 100644 import_reportsadmin_2021-01-09T16:40:19.182956.xlsx diff --git a/db.sqlite3 b/db.sqlite3 index e7ff30944a982b0047b4973d620ab3af97f5cf5c..0927f72fbee4175d8c07a04d75765c6315cc8d2d 100644 GIT binary patch delta 4526 zcmb7|YiuJ|701UjPB!D%_p)8K={~%1l6@qb+Mbu~8J9Mg*x5MiBzB&gw2K+Xj^B^< zBeA`$X5B3krBatPh_ppegcg;4s!X&5p-TM#g)bEg60JnLK*ggHVpj#q;{zaZW9Q)+ zH=7_i_WX6`cm6Z?&N*{$u6>}n_JQUrCsfy0P7bQBSHEzx^Fb2!s^FjCYcLDngwMhE z;OF50?5$P+>^ORuFsmY2e=;2`BtrgtG#N^y!{q9K`P9+Y2O!bc5X>aR6uX)=dsOQ6 zH_e};j(~Tu*7jF17;S$Qd{*}j?SHjX)yisnTje~i!zz7_)!(FMjx!WP8!7Y=3^Z%! ztagqyQ8X{G)GC*@!n3WlQ`_{%ENx_0$Er6qra&mcPVpvzWf=>*{&qrxt1%2)U8&qy zkEXwFKsWa!2LBHK2;YT2g+D+y`7*l2C##hJlmOACil>*wL@pkUiKJY%$>kxrY?aFv zxm3#~A(wbNp(i8J{INtRD+V>_YFpu382lH!2Y(NL1#iQ*)(>B+!qt1Plbx+3(V-H9 z$!Mx&=SaPCM6BO?z2h%hHN1<#f5N}QyYSx#y#r6H2~wrr{315La5bSK@l7K&yobU6 zAgjN@d+5wxBa`2DXw@K#!SBOG@Mn-k0|TUGHHkUSxcwxlYMdUW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nG-d!Vr`R9e1wqZ(Sp^@)E6kY>Y@vgrhz2QV>$^*y3ma? z;36QXWfrM|6>J4v)iLO73jGHPq6?`ei(0Ut5)g!Dp@L(CZ}mHibG~!*ZMVMdelSR< z7LQ+~Q`YQiz$ZYV_=*>(Vgq;a2{TYE;}lFKHtc7Iz=dhPnwl?X7SwF2qNcT@W;J$= zveriILi{ixgqJjeg8V_A^gNdSNSb9_mjpxNJ;VqT^M*Rz+Em?4Fud$PSu0JO%i4bP zq#A1#%a4L9F5N3IbP0Oswhro_(dw=Z{BY17!5)4&=o^l>IFT|JM@8m#JQ;cfztMBF z@9_6EjuS;sU&;}@LC%Q*JNK3@$5&i0{}~hsUZZFkGhkO)GZbLHrXFB-e1hB{c!#H` z;S&7vu58N<%c#h9W0c*b{SOf#_=0t(o;)riVi^NyMih2zB(#q|F*qcM>Ov`9yOq^S z<+PfsWpZ=5xqP9nW~=E;Gq11_KF0B(NVNG-VZj5LY$aW-&u6uI++J7M6|b|w62VXG z;v+Vl6<*;PmRg~T4)ghK$zDyd*&t8lHj&$wabIS%uxL!$?RzXtd5R7}$LZlcnw=-? ov;%esb{w#U;UVt4n2aYA(Rd=7Oa>DZ=bRfqI~qSTF*Y{-7uk84q5uE@ diff --git a/employee_module/static/css/employee_module_base.css b/employee_module/static/css/employee_module_base.css index 48d0000..a52efea 100644 --- a/employee_module/static/css/employee_module_base.css +++ b/employee_module/static/css/employee_module_base.css @@ -1,32 +1,39 @@ #hr_module_main_container { - padding: 1%; + padding-top: 10px; + padding-left: 10px; float: left; - width: 80%; + width: 78%; height: 100%; background-color: whitesmoke; text-align: center; } - -.sidebar { - background-color: #8b0000; +#sidebar { + background-color: #202831; width: 18%; height: 100%; float: left; + padding: 10px; } .sidebar_item { - background-color: navajowhite; - margin-right: 6px; - margin-left: 6px; - margin-top: 6px; + background-color: #202831; padding: 10px; font-size: 20px; + color: #7F8B94; +} +.sidebar_item_active { + background-color: #191E24; + color: #53B6FF; +} + +a { + text-decoration: none; } .sidebar_item:hover { - background-color: white; + background-color: #43505e; cursor: pointer; } diff --git a/employee_module/static/js/employee_module_base.js b/employee_module/static/js/employee_module_base.js new file mode 100644 index 0000000..21da12f --- /dev/null +++ b/employee_module/static/js/employee_module_base.js @@ -0,0 +1,12 @@ + +window.addEventListener('load', function(){ + var sidebarItems = document.getElementById('sidebar').getElementsByTagName('a') + var pathName = window.location.pathname + for (var i = 0; i < sidebarItems.length; i++){ + var pathLink = sidebarItems[i].getAttribute('href') + if (pathName == pathLink){ + sidebarItems[i].firstElementChild.classList.add('sidebar_item_active') + } + } +}) + diff --git a/employee_module/static/js/employee_module_show_schedule.js b/employee_module/static/js/employee_module_show_schedule.js index 54cbfad..e6ae452 100644 --- a/employee_module/static/js/employee_module_show_schedule.js +++ b/employee_module/static/js/employee_module_show_schedule.js @@ -7,6 +7,7 @@ const csrftoken = getCookie('csrftoken'); window.addEventListener('load', function(){ var parent = document.getElementById('calendar_box') parent.appendChild(addCalendar(monthsAhead=3)) + appendLegend() fetchDays() formatCalendarContainerSize(document.getElementById('calendar_container')) document.getElementById('calendar_button_back').addEventListener('click', function(){ @@ -120,14 +121,16 @@ function formatCalendarContainerSize(calendarContainer){ var monthsBlock = calendarContainer.querySelector('#months_block') var calendarButton = calendarContainer.querySelector('#calendar_button_back') var dateSelector = calendarContainer.querySelector('#date_selector') + var legendSelector = calendarContainer.querySelector('#legend_container') var widthMonths = monthsBlock.offsetWidth var heightMonths = monthsBlock.offsetHeight var heightDateSelector = dateSelector.offsetHeight + var heightLegend = legendSelector.offsetHeight var widthCalendarButton = calendarButton.offsetWidth * 2 var widthTotal = widthMonths + widthCalendarButton - var heightTotal = heightMonths + heightDateSelector + var heightTotal = heightMonths + heightDateSelector + heightLegend calendarContainer.setAttribute('style','height:' + heightTotal +'px; width:' + widthTotal + 'px'); } @@ -172,3 +175,27 @@ function getCookie(name) { } return cookieValue; } + + +function appendLegend(){ + var calendar = document.getElementById('calendar_container') + var container = document.createElement('div') + container.id = 'legend_container' + var activityTypes = ['work', 'vacation', 'sickness', 'parental_leave'] + for(var i = 0; i < activityTypes.length; i++){ + var legendElementContainer = document.createElement('div') + legendElementContainer.className = 'legend_element_container' + + var legendDivText = document.createElement('div') + legendDivText.innerText = activityTypes[i] + legendDivText.className = 'legend_label' + + var legendDivBox = document.createElement('div') + legendDivBox.classList.add('legend_cube') + legendDivBox.classList.add('days_of_month_' + activityTypes[i]) + legendElementContainer.appendChild(legendDivText) + legendElementContainer.appendChild(legendDivBox) + container.appendChild(legendElementContainer) + } + calendar.appendChild(container) +} \ No newline at end of file diff --git a/employee_module/static/js/employee_module_show_timelog.js b/employee_module/static/js/employee_module_show_timelog.js index a7d2205..a639d2a 100644 --- a/employee_module/static/js/employee_module_show_timelog.js +++ b/employee_module/static/js/employee_module_show_timelog.js @@ -7,6 +7,7 @@ const csrftoken = getCookie('csrftoken'); window.addEventListener('load', function(){ var parent = document.getElementById('calendar_box') parent.appendChild(addCalendar(monthsAhead=3)) + appendLegend() fetchDays() formatCalendarContainerSize(document.getElementById('calendar_container')) document.getElementById('calendar_button_back').addEventListener('click', function(){ @@ -121,14 +122,16 @@ function formatCalendarContainerSize(calendarContainer){ var monthsBlock = calendarContainer.querySelector('#months_block') var calendarButton = calendarContainer.querySelector('#calendar_button_back') var dateSelector = calendarContainer.querySelector('#date_selector') + var legendSelector = calendarContainer.querySelector('#legend_container') var widthMonths = monthsBlock.offsetWidth var heightMonths = monthsBlock.offsetHeight var heightDateSelector = dateSelector.offsetHeight + var heightLegend = legendSelector.offsetHeight var widthCalendarButton = calendarButton.offsetWidth * 2 var widthTotal = widthMonths + widthCalendarButton - var heightTotal = heightMonths + heightDateSelector + var heightTotal = heightMonths + heightDateSelector + heightLegend calendarContainer.setAttribute('style','height:' + heightTotal +'px; width:' + widthTotal + 'px'); } @@ -173,3 +176,26 @@ function getCookie(name) { } return cookieValue; } + +function appendLegend(){ + var calendar = document.getElementById('calendar_container') + var container = document.createElement('div') + container.id = 'legend_container' + var activityTypes = ['work', 'vacation', 'sickness', 'parental_leave'] + for(var i = 0; i < activityTypes.length; i++){ + var legendElementContainer = document.createElement('div') + legendElementContainer.className = 'legend_element_container' + + var legendDivText = document.createElement('div') + legendDivText.innerText = activityTypes[i] + legendDivText.className = 'legend_label' + + var legendDivBox = document.createElement('div') + legendDivBox.classList.add('legend_cube') + legendDivBox.classList.add('days_of_month_' + activityTypes[i]) + legendElementContainer.appendChild(legendDivText) + legendElementContainer.appendChild(legendDivBox) + container.appendChild(legendElementContainer) + } + calendar.appendChild(container) +} \ No newline at end of file diff --git a/employee_module/templates/employee_module_base.html b/employee_module/templates/employee_module_base.html index eb12e0d..f9bb572 100644 --- a/employee_module/templates/employee_module_base.html +++ b/employee_module/templates/employee_module_base.html @@ -10,7 +10,7 @@ {% block core_content %} -