Jelajahi Sumber

не работает перелистывание расписания и между временем нужно – использовать http://clip2net.com/s/3N6E5hY
+ в подвале лого не отображается
лишняя запятая http://clip2net.com/s/3N6Ek20

alexlcdee 8 tahun lalu
induk
melakukan
9eebfea189

+ 71 - 0
app/assets/scripts/doctor-schedule.js

@@ -0,0 +1,71 @@
+/// <reference path="../../node_modules/moment/moment.d.ts"/>
+/// <reference path="../../node_modules/@types/jquery/index.d.ts"/>
+// import moment = require("moment");
+var DoctorSchedule;
+(function (DoctorSchedule_1) {
+    var recalculateDate = function (dateSpec, action) {
+        dateSpec = parseDate(dateSpec);
+        dateSpec.push((new Date).getFullYear());
+        dateSpec = dateSpec.reverse();
+        dateSpec[1]--;
+        var momentDate = moment(dateSpec);
+        momentDate[action](7, 'days');
+        return momentDate.format('DD.MM');
+    };
+    var parseDate = function (string) {
+        return string.split('.').map(function (data) {
+            return parseInt(data);
+        });
+    };
+    var getDateColumn = function (row) {
+        return row.find('td:first-child');
+    };
+    var nextDate = function (prev, next) {
+        getRows(next).each(function (index) {
+            var date = getDateColumn($(this)).html();
+            getDateColumn($(this)).html(recalculateDate(date, 'add'));
+        });
+        setButtonsText(prev, next, 'add');
+    };
+    var prevDate = function (prev, next) {
+        getRows(next).each(function (index) {
+            var date = getDateColumn($(this)).html();
+            getDateColumn($(this)).html(recalculateDate(date, 'subtract'));
+        });
+        setButtonsText(prev, next, 'subtract');
+    };
+    var setButtonsText = function (prev, next, action) {
+        setButtonDate(prev, action);
+        setButtonDate(next, action);
+    };
+    var setButtonDate = function (button, action) {
+        var dates = button.html().trim().split(' – ');
+        console.log(dates);
+        button.html(recalculateDate(dates[0], action) + ' &ndash; ' + recalculateDate(dates[1], action));
+    };
+    var getRows = function (element) {
+        return element.parent().find('tr');
+    };
+    var DoctorSchedule = (function () {
+        function DoctorSchedule(prevBtn, nextBtn) {
+            var next = nextDate.bind(this);
+            var prev = prevDate.bind(this);
+            prevBtn.on('click', function (e) {
+                e.preventDefault();
+                prev(prevBtn, nextBtn);
+            });
+            nextBtn.on('click', function (e) {
+                e.preventDefault();
+                next(prevBtn, nextBtn);
+            });
+        }
+
+        return DoctorSchedule;
+    }());
+
+    function init($prevBtn, $nextBtn) {
+        return new DoctorSchedule($prevBtn, $nextBtn);
+    }
+
+    DoctorSchedule_1.init = init;
+})(DoctorSchedule || (DoctorSchedule = {}));

+ 1 - 1
app/assets/scripts/main.js

@@ -39,7 +39,7 @@
         if (minutes <= 9) minutes = "0" + minutes;
         if (seconds <= 9) seconds = "0" + seconds;
 
-        var date_time = day + " " + month[month_num] + ", " + weekday[weekday_num] + ", ";
+        var date_time = day + " " + month[month_num] + ", " + weekday[weekday_num] + " ";
         if (document.layers) {
             document.layers.today_day.document.write(date_time);
             document.layers.today_day.document.close();

+ 2 - 0
app/assets/styles/content/centerbar/doctors.scss

@@ -102,6 +102,7 @@
     font-size: 13px;
     color: #929292;
     margin: 5px 0;
+    cursor: pointer;
 }
 
 .rach-content-dolznosti-grafik-next {
@@ -111,6 +112,7 @@
     color: #929292;
     text-align: right;
     margin: 5px 0;
+    cursor: pointer;
 }
 
 .rach-content-dolznosti-grafik-prev::before {

+ 1 - 0
app/assets/styles/footer/copyright.scss

@@ -6,6 +6,7 @@
     justify-content: flex-start;
     align-items: flex-start;
     align-content: flex-start;
+    margin-right: 22px;
 
     &__link {
         position: relative;

+ 10 - 0
app/assets/styles/footer/footer.scss

@@ -20,4 +20,14 @@
         align-items: flex-end;
         align-content: flex-end;
     }
+    &__logo {
+        width: 104px;
+        margin-right: 18px;
+        padding-top: 12px;
+
+        &-img {
+            max-width: 100%;
+            height: auto;
+        }
+    }
 }

+ 77 - 0
app/assets/ts/doctor-schedule.ts

@@ -0,0 +1,77 @@
+/// <reference path="../../node_modules/moment/moment.d.ts"/>
+/// <reference path="../../node_modules/@types/jquery/index.d.ts"/>
+
+// import moment = require("moment");
+
+namespace DoctorSchedule {
+
+    let recalculateDate = function (dateSpec, action) {
+        dateSpec = parseDate(dateSpec);
+        dateSpec.push((new Date).getFullYear());
+        dateSpec = dateSpec.reverse();
+        dateSpec[1]--;
+        let momentDate = moment(dateSpec);
+        momentDate[action](7, 'days');
+        return momentDate.format('DD.MM');
+    };
+
+    let parseDate = function (string) {
+        return string.split('.').map(data => parseInt(data));
+    };
+
+    let getDateColumn = function (row: JQuery) {
+        return row.find('td:first-child');
+    };
+
+    let nextDate = function (prev: JQuery, next: JQuery) {
+        getRows(next).each(function (index) {
+            let date = getDateColumn($(this)).html();
+            getDateColumn($(this)).html(recalculateDate(date, 'add'));
+        });
+        setButtonsText(prev, next, 'add');
+    };
+
+    let prevDate = function (prev: JQuery, next: JQuery) {
+        getRows(next).each(function (index) {
+            let date = getDateColumn($(this)).html();
+            getDateColumn($(this)).html(recalculateDate(date, 'subtract'));
+        });
+        setButtonsText(prev, next, 'subtract');
+    };
+
+    let setButtonsText = function (prev: JQuery, next: JQuery, action) {
+        setButtonDate(prev, action);
+        setButtonDate(next, action);
+    };
+
+    let setButtonDate = function (button: JQuery, action) {
+        let dates = button.html().trim().split(' – ');
+        console.log(dates);
+        button.html(recalculateDate(dates[0], action) + ' &ndash; ' + recalculateDate(dates[1], action));
+    };
+
+    let getRows = function (element: JQuery) {
+        return element.parent().find('tr');
+    };
+
+    class DoctorSchedule {
+
+        constructor(prevBtn, nextBtn) {
+            let next = nextDate.bind(this);
+            let prev = prevDate.bind(this);
+            prevBtn.on('click', function (e) {
+                e.preventDefault();
+                prev(prevBtn, nextBtn);
+            });
+            nextBtn.on('click', function (e) {
+                e.preventDefault();
+                next(prevBtn, nextBtn);
+            });
+        }
+    }
+
+
+    export function init($prevBtn: JQuery, $nextBtn: JQuery) {
+        return new DoctorSchedule($prevBtn, $nextBtn);
+    }
+}

+ 1 - 0
app/gulpfile.js

@@ -83,6 +83,7 @@ gulp.task('scripts', function () {
         'assets/scripts/specfilter.js',
         'assets/scripts/comments.js',
         'assets/scripts/region-selection.js',
+        'assets/scripts/doctor-schedule.js',
         'assets/scripts/main.js'
     ])
         .pipe(plumber())

+ 2 - 1
app/package.json

@@ -30,7 +30,8 @@
   },
   "dependencies": {
     "@types/fancybox": "^2.1.29",
-    "@types/jquery": "^2.0.46"
+    "@types/jquery": "^2.0.46",
+    "moment": "^2.18.1"
   },
   "browserslist": {
     "production": [

+ 16 - 1
app/www/css/all.css

@@ -3657,6 +3657,7 @@ organization-info--active .organization-info__menu-vrachi-link {
     font-size: 13px;
     color: #929292;
     margin: 5px 0;
+    cursor: pointer;
 }
 
 .rach-content-dolznosti-grafik-next {
@@ -3666,6 +3667,7 @@ organization-info--active .organization-info__menu-vrachi-link {
     color: #929292;
     text-align: right;
     margin: 5px 0;
+    cursor: pointer;
 }
 
 .rach-content-dolznosti-grafik-prev::before {
@@ -3944,6 +3946,17 @@ organization-info--active .organization-info__menu-vrachi-link {
     align-items: flex-end;
     align-content: flex-end; }
 
+.footer__logo {
+    width: 104px;
+    margin-right: 18px;
+    padding-top: 12px;
+}
+
+.footer__logo-img {
+    max-width: 100%;
+    height: auto;
+}
+
 .copyright {
   display: -webkit-flex;
   display: -ms-flex;
@@ -3951,7 +3964,9 @@ organization-info--active .organization-info__menu-vrachi-link {
   flex-direction: column;
   justify-content: flex-start;
   align-items: flex-start;
-  align-content: flex-start; }
+    align-content: flex-start;
+    margin-right: 22px;
+}
   .copyright__link {
     position: relative;
     line-height: 25px;

File diff ditekan karena terlalu besar
+ 0 - 0
app/www/css/all.css.map


File diff ditekan karena terlalu besar
+ 0 - 0
app/www/css/all.min.css


File diff ditekan karena terlalu besar
+ 0 - 0
app/www/js/all.min.js


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini