From 4bfa0ff04e13bb1ba064d151f4e5bbb1c165784b Mon Sep 17 00:00:00 2001 From: MaertHaekkinen Date: Wed, 23 Oct 2024 02:24:31 +0300 Subject: [PATCH] Update MR --- ajapaik/ajapaik/models.py | 8 +- ajapaik/ajapaik/serializers.py | 5 +- .../css/bootstrap-datetimepicker.css | 486 +++++++++++------- 3 files changed, 307 insertions(+), 192 deletions(-) diff --git a/ajapaik/ajapaik/models.py b/ajapaik/ajapaik/models.py index d692f87b3..8f0852117 100644 --- a/ajapaik/ajapaik/models.py +++ b/ajapaik/ajapaik/models.py @@ -164,11 +164,13 @@ def _make_fullscreen(photo): def _get_pseudo_slug_for_photo(description, source_key, id): - if description is not None and description != '': + slug = None + + if description: slug = '-'.join(slugify(description).split('-')[:6])[:60] - elif source_key is not None and source_key != '': + elif source_key and not slug: slug = slugify(source_key) - else: + elif not slug: slug = slugify(id) return slug diff --git a/ajapaik/ajapaik/serializers.py b/ajapaik/ajapaik/serializers.py index 1da452cd5..afc608106 100644 --- a/ajapaik/ajapaik/serializers.py +++ b/ajapaik/ajapaik/serializers.py @@ -149,13 +149,14 @@ def __init__(self, *args, **kwargs): def get_url(self, instance): return reverse( 'image_thumb', - args=(instance.id, 400, _get_pseudo_slug_for_photo(instance.get_display_text, None, instance.id)) + args=( + instance.id, 400, _get_pseudo_slug_for_photo(instance.get_display_text, instance.source_key, instance.id)) ) def get_permalink(self, instance): return reverse( 'photo', - args=(instance.id, _get_pseudo_slug_for_photo(instance.get_display_text, None, instance.id)) + args=(instance.id, _get_pseudo_slug_for_photo(instance.get_display_text, instance.source_key, instance.id)) ) def get_width(self, instance): diff --git a/ajapaik/ajapaik/static/libs/bootstrap-datetimepicker-4.17.47/css/bootstrap-datetimepicker.css b/ajapaik/ajapaik/static/libs/bootstrap-datetimepicker-4.17.47/css/bootstrap-datetimepicker.css index 9443889d3..b26cffe95 100644 --- a/ajapaik/ajapaik/static/libs/bootstrap-datetimepicker-4.17.47/css/bootstrap-datetimepicker.css +++ b/ajapaik/ajapaik/static/libs/bootstrap-datetimepicker-4.17.47/css/bootstrap-datetimepicker.css @@ -1,12 +1,13 @@ .sr-only, .bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after, .bootstrap-datetimepicker-widget .btn[data-action="clear"]::after, .bootstrap-datetimepicker-widget .btn[data-action="today"]::after, .bootstrap-datetimepicker-widget .picker-switch::after, .bootstrap-datetimepicker-widget table th.prev::after, .bootstrap-datetimepicker-widget table th.next::after { - position: absolute; - width: 1px; - height: 1px; - margin: -1px; - padding: 0; - overflow: hidden; - clip: rect(0, 0, 0, 0); - border: 0; } + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} /*! * Datetimepicker for Bootstrap 3 @@ -14,191 +15,302 @@ * https://github.com/Eonasdan/bootstrap-datetimepicker/ */ .bootstrap-datetimepicker-widget { - list-style: none; } - .bootstrap-datetimepicker-widget.dropdown-menu { + list-style: none; +} + +.bootstrap-datetimepicker-widget.dropdown-menu { margin: 2px 0; padding: 4px; - width: 19em; } - @media (min-width: 576px) { - .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { - width: 38em; } } - @media (min-width: 768px) { - .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { - width: 38em; } } - @media (min-width: 992px) { - .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { - width: 38em; } } - .bootstrap-datetimepicker-widget.dropdown-menu:before, .bootstrap-datetimepicker-widget.dropdown-menu:after { - content: ''; - display: inline-block; - position: absolute; } - .bootstrap-datetimepicker-widget.dropdown-menu.bottom:before { - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-bottom-color: rgba(0, 0, 0, 0.2); - top: -7px; - left: 7px; } - .bootstrap-datetimepicker-widget.dropdown-menu.bottom:after { - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid white; - top: -6px; - left: 8px; } - .bootstrap-datetimepicker-widget.dropdown-menu.top:before { - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-top: 7px solid #ccc; - border-top-color: rgba(0, 0, 0, 0.2); - bottom: -7px; - left: 6px; } - .bootstrap-datetimepicker-widget.dropdown-menu.top:after { - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid white; - bottom: -6px; - left: 7px; } - .bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before { - left: auto; - right: 6px; } - .bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after { - left: auto; - right: 7px; } - .bootstrap-datetimepicker-widget .list-unstyled { - margin: 0; } - .bootstrap-datetimepicker-widget a[data-action] { - padding: 6px 0; } - .bootstrap-datetimepicker-widget a[data-action]:active { - box-shadow: none; } - .bootstrap-datetimepicker-widget .timepicker-hour, .bootstrap-datetimepicker-widget .timepicker-minute, .bootstrap-datetimepicker-widget .timepicker-second { + width: 19em; +} + +@media (min-width: 576px) { + .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { + width: 38em; + } +} + +@media (min-width: 768px) { + .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { + width: 38em; + } +} + +@media (min-width: 992px) { + .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { + width: 38em; + } +} + +.bootstrap-datetimepicker-widget.dropdown-menu:before, .bootstrap-datetimepicker-widget.dropdown-menu:after { + content: ''; + display: inline-block; + position: absolute; +} + +.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before { + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0, 0, 0, 0.2); + top: -7px; + left: 7px; +} + +.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid white; + top: -6px; + left: 8px; +} + +.bootstrap-datetimepicker-widget.dropdown-menu.top:before { + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-top: 7px solid #ccc; + border-top-color: rgba(0, 0, 0, 0.2); + bottom: -7px; + left: 6px; +} + +.bootstrap-datetimepicker-widget.dropdown-menu.top:after { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid white; + bottom: -6px; + left: 7px; +} + +.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before { + left: auto; + right: 6px; +} + +.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after { + left: auto; + right: 7px; +} + +.bootstrap-datetimepicker-widget .list-unstyled { + margin: 0; +} + +.bootstrap-datetimepicker-widget a[data-action] { + padding: 6px 0; +} + +.bootstrap-datetimepicker-widget a[data-action]:active { + box-shadow: none; +} + +.bootstrap-datetimepicker-widget .timepicker-hour, .bootstrap-datetimepicker-widget .timepicker-minute, .bootstrap-datetimepicker-widget .timepicker-second { width: 54px; font-weight: bold; font-size: 1.2em; - margin: 0; } - .bootstrap-datetimepicker-widget button[data-action] { - padding: 6px; } - .bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after { - content: "Increment Hours"; } - .bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after { - content: "Increment Minutes"; } - .bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after { - content: "Decrement Hours"; } - .bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after { - content: "Decrement Minutes"; } - .bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after { - content: "Show Hours"; } - .bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after { - content: "Show Minutes"; } - .bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after { - content: "Toggle AM/PM"; } - .bootstrap-datetimepicker-widget .btn[data-action="clear"]::after { - content: "Clear the picker"; } - .bootstrap-datetimepicker-widget .btn[data-action="today"]::after { - content: "Set the date to today"; } - .bootstrap-datetimepicker-widget .picker-switch { - text-align: center; } - .bootstrap-datetimepicker-widget .picker-switch::after { - content: "Toggle Date and Time Screens"; } - .bootstrap-datetimepicker-widget .picker-switch td { - padding: 0; - margin: 0; - height: auto; - width: auto; - line-height: inherit; } - .bootstrap-datetimepicker-widget .picker-switch td span, .bootstrap-datetimepicker-widget .picker-switch td i { - line-height: 2.5; - height: 2.5em; - width: 100%; } - .bootstrap-datetimepicker-widget table { + margin: 0; +} + +.bootstrap-datetimepicker-widget button[data-action] { + padding: 6px; +} + +.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after { + content: "Increment Hours"; +} + +.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after { + content: "Increment Minutes"; +} + +.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after { + content: "Decrement Hours"; +} + +.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after { + content: "Decrement Minutes"; +} + +.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after { + content: "Show Hours"; +} + +.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after { + content: "Show Minutes"; +} + +.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after { + content: "Toggle AM/PM"; +} + +.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after { + content: "Clear the picker"; +} + +.bootstrap-datetimepicker-widget .btn[data-action="today"]::after { + content: "Set the date to today"; +} + +.bootstrap-datetimepicker-widget .picker-switch { + text-align: center; +} + +.bootstrap-datetimepicker-widget .picker-switch::after { + content: "Toggle Date and Time Screens"; +} + +.bootstrap-datetimepicker-widget .picker-switch td { + padding: 0; + margin: 0; + height: auto; + width: auto; + line-height: inherit; +} + +.bootstrap-datetimepicker-widget .picker-switch td span, .bootstrap-datetimepicker-widget .picker-switch td i { + line-height: 2.5; + height: 2.5em; width: 100%; - margin: 0; } - .bootstrap-datetimepicker-widget table td, .bootstrap-datetimepicker-widget table th { - text-align: center; - border-radius: 0.25rem; - padding: 0.5em; } - .bootstrap-datetimepicker-widget table th { - height: 20px; - line-height: 20px; - width: 20px; } - .bootstrap-datetimepicker-widget table th.picker-switch { - width: 145px; } - .bootstrap-datetimepicker-widget table th.disabled, .bootstrap-datetimepicker-widget table th.disabled:hover { - background: none; - color: #dee2e6; - cursor: not-allowed; } - .bootstrap-datetimepicker-widget table th.prev::after { - content: "Previous Month"; } - .bootstrap-datetimepicker-widget table th.next::after { - content: "Next Month"; } - .bootstrap-datetimepicker-widget table thead tr:first-child th { - cursor: pointer; } - .bootstrap-datetimepicker-widget table thead tr:first-child th:hover { - background: #f8f9fa; } - .bootstrap-datetimepicker-widget table td { - height: 54px; - line-height: 54px; - width: 54px; } - .bootstrap-datetimepicker-widget table td.cw { - font-size: .8em; - height: 20px; - line-height: 20px; - color: #dee2e6; } - .bootstrap-datetimepicker-widget table td.day { - height: 20px; - line-height: 20px; - width: 20px; } - .bootstrap-datetimepicker-widget table td.day:hover, .bootstrap-datetimepicker-widget table td.hour:hover, .bootstrap-datetimepicker-widget table td.minute:hover, .bootstrap-datetimepicker-widget table td.second:hover { - background: #f8f9fa; - cursor: pointer; } - .bootstrap-datetimepicker-widget table td.old, .bootstrap-datetimepicker-widget table td.new { - color: #dee2e6; } - .bootstrap-datetimepicker-widget table td.today { - position: relative; } - .bootstrap-datetimepicker-widget table td.today:before { - content: ''; - display: inline-block; - border: solid transparent; - border-width: 0 0 7px 7px; - border-bottom-color: #dee2e6; - border-top-color: rgba(0, 0, 0, 0.2); - position: absolute; - bottom: 4px; - right: 4px; } - .bootstrap-datetimepicker-widget table td.active, .bootstrap-datetimepicker-widget table td.active:hover { - background-color: #dee2e6; - color: #007bff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } - .bootstrap-datetimepicker-widget table td.active.today:before { - border-bottom-color: #fff; } - .bootstrap-datetimepicker-widget table td.disabled, .bootstrap-datetimepicker-widget table td.disabled:hover { - background: none; - color: #dee2e6; - cursor: not-allowed; } - .bootstrap-datetimepicker-widget table td span, .bootstrap-datetimepicker-widget table td i { - display: inline-block; - width: 54px; - height: 54px; - line-height: 54px; - margin: 2px 1.5px; - cursor: pointer; - border-radius: 0.25rem; } - .bootstrap-datetimepicker-widget table td span:hover, .bootstrap-datetimepicker-widget table td i:hover { - background: #f8f9fa; } - .bootstrap-datetimepicker-widget table td span.active, .bootstrap-datetimepicker-widget table td i.active { - background-color: #dee2e6; - color: #007bff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } - .bootstrap-datetimepicker-widget table td span.old, .bootstrap-datetimepicker-widget table td i.old { - color: #dee2e6; } - .bootstrap-datetimepicker-widget table td span.disabled, .bootstrap-datetimepicker-widget table td span.disabled:hover, .bootstrap-datetimepicker-widget table td i.disabled, .bootstrap-datetimepicker-widget table td i.disabled:hover { - background: none; - color: #dee2e6; - cursor: not-allowed; } - .bootstrap-datetimepicker-widget.usetwentyfour td.hour { +} + +.bootstrap-datetimepicker-widget table { + width: 100%; + margin: 0; +} + +.bootstrap-datetimepicker-widget table td, .bootstrap-datetimepicker-widget table th { + text-align: center; + border-radius: 0.25rem; + padding: 0.5em; +} + +.bootstrap-datetimepicker-widget table th { + height: 20px; + line-height: 20px; + width: 20px; +} + +.bootstrap-datetimepicker-widget table th.picker-switch { + width: 145px; +} + +.bootstrap-datetimepicker-widget table th.disabled, .bootstrap-datetimepicker-widget table th.disabled:hover { + background: none; + color: #dee2e6; + cursor: not-allowed; +} + +.bootstrap-datetimepicker-widget table th.prev::after { + content: "Previous Month"; +} + +.bootstrap-datetimepicker-widget table th.next::after { + content: "Next Month"; +} + +.bootstrap-datetimepicker-widget table thead tr:first-child th { + cursor: pointer; +} + +.bootstrap-datetimepicker-widget table thead tr:first-child th:hover { + background: #f8f9fa; +} + +.bootstrap-datetimepicker-widget table td { + height: 54px; + line-height: 54px; + width: 54px; +} + +.bootstrap-datetimepicker-widget table td.cw { + font-size: .8em; + height: 20px; + line-height: 20px; + color: #dee2e6; +} + +.bootstrap-datetimepicker-widget table td.day { + height: 20px; + line-height: 20px; + width: 20px; +} + +.bootstrap-datetimepicker-widget table td.day:hover, .bootstrap-datetimepicker-widget table td.hour:hover, .bootstrap-datetimepicker-widget table td.minute:hover, .bootstrap-datetimepicker-widget table td.second:hover { + background: #f8f9fa; + cursor: pointer; +} + +.bootstrap-datetimepicker-widget table td.old, .bootstrap-datetimepicker-widget table td.new { + color: #dee2e6; +} + +.bootstrap-datetimepicker-widget table td.today { + position: relative; +} + +.bootstrap-datetimepicker-widget table td.today:before { + content: ''; + display: inline-block; + border: solid transparent; + border-width: 0 0 7px 7px; + border-bottom-color: #dee2e6; + border-top-color: rgba(0, 0, 0, 0.2); + position: absolute; + bottom: 4px; + right: 4px; +} + +.bootstrap-datetimepicker-widget table td.active, .bootstrap-datetimepicker-widget table td.active:hover { + background-color: #dee2e6; + color: #007bff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.bootstrap-datetimepicker-widget table td.active.today:before { + border-bottom-color: #fff; +} + +.bootstrap-datetimepicker-widget table td.disabled, .bootstrap-datetimepicker-widget table td.disabled:hover { + background: none; + color: #dee2e6; + cursor: not-allowed; +} + +.bootstrap-datetimepicker-widget table td span, .bootstrap-datetimepicker-widget table td i { + display: inline-block; + width: 54px; + height: 54px; + line-height: 54px; + margin: 2px 1.5px; + cursor: pointer; + border-radius: 0.25rem; +} + +.bootstrap-datetimepicker-widget table td span:hover, .bootstrap-datetimepicker-widget table td i:hover { + background: #f8f9fa; +} + +.bootstrap-datetimepicker-widget table td span.active, .bootstrap-datetimepicker-widget table td i.active { + background-color: #dee2e6; + color: #007bff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.bootstrap-datetimepicker-widget table td span.old, .bootstrap-datetimepicker-widget table td i.old { + color: #dee2e6; +} + +.bootstrap-datetimepicker-widget table td span.disabled, .bootstrap-datetimepicker-widget table td span.disabled:hover, .bootstrap-datetimepicker-widget table td i.disabled, .bootstrap-datetimepicker-widget table td i.disabled:hover { + background: none; + color: #dee2e6; + cursor: not-allowed; +} + +.bootstrap-datetimepicker-widget.usetwentyfour td.hour { height: 27px; - line-height: 27px; } + line-height: 27px; +} .input-group.date .input-group-addon { - cursor: pointer; } - -/*# sourceMappingURL=bootstrap-datetimepicker-build.css.map */ \ No newline at end of file + cursor: pointer; +}