diff --git a/weblate_web/models.py b/weblate_web/models.py index d681a78aac..8c19f28eea 100644 --- a/weblate_web/models.py +++ b/weblate_web/models.py @@ -508,17 +508,56 @@ def expires(self): def get_suggestions(self): if not self.support_subscriptions.exists(): - yield "basic", _("Basic support") + yield ( + "basic", + _("Basic support"), + _( + "This will give you more of this and that. " + "You can't resist, because it is a huge deal." + ), + "img/Support-Basic.svg", + _("Get more support"), + ) + if ( not self.hosted_subscriptions.exists() and not self.shared_subscriptions.exists() ): if not self.premium_subscriptions.exists(): - yield "premium", _("Extended support") + yield ( + "premium", + _("Premium support"), + _( + "This will give you more of this and that. " + "You can't resist, because it is a huge deal." + ), + "img/Support-Plus.svg", + _("Get more support"), + ) + if not self.extended_subscriptions.exists(): - yield "extended", _("Extended support") + yield ( + "extended", + _("Extended support"), + _( + "This will give you more of this and that. " + "You can't resist, because it is a huge deal." + ), + "img/Support-Premium.svg", + _("Get more support"), + ) + if not self.backup_subscriptions.exists(): - yield "backup", _("Backup service") + yield ( + "backup", + _("Backup service"), + _( + "This will give you more of this and that. " + "You can't resist, because it is a huge deal." + ), + "img/Support-Backup.svg", + _("Get more support"), + ) def update_status(self): status = "community" diff --git a/weblate_web/static/custom.js b/weblate_web/static/custom.js index 0300124208..dacf4b1354 100644 --- a/weblate_web/static/custom.js +++ b/weblate_web/static/custom.js @@ -207,3 +207,7 @@ ready(() => { new ClipboardJS("[data-clipboard-text]"); }); + +function removeUser(userId) { + document.getElementById(`server_user_${userId}_form`).submit(); +} diff --git a/weblate_web/static/img/ArrowR.png b/weblate_web/static/img/ArrowR.png new file mode 100644 index 0000000000..6b4faf26ef Binary files /dev/null and b/weblate_web/static/img/ArrowR.png differ diff --git a/weblate_web/static/img/Shield.png b/weblate_web/static/img/Shield.png new file mode 100644 index 0000000000..4b68a15632 Binary files /dev/null and b/weblate_web/static/img/Shield.png differ diff --git a/weblate_web/static/img/delete.png b/weblate_web/static/img/delete.png new file mode 100644 index 0000000000..7cd9c54c59 Binary files /dev/null and b/weblate_web/static/img/delete.png differ diff --git a/weblate_web/static/img/donations-picture.png b/weblate_web/static/img/donations-picture.png new file mode 100644 index 0000000000..1563dfff4b Binary files /dev/null and b/weblate_web/static/img/donations-picture.png differ diff --git a/weblate_web/static/img/dowload.png b/weblate_web/static/img/dowload.png new file mode 100644 index 0000000000..ab39f4afaa Binary files /dev/null and b/weblate_web/static/img/dowload.png differ diff --git a/weblate_web/static/style-rtl.css b/weblate_web/static/style-rtl.css index 07ac9b60af..f2c61ce1ce 100644 --- a/weblate_web/static/style-rtl.css +++ b/weblate_web/static/style-rtl.css @@ -4196,3 +4196,502 @@ input.fullwidth { bottom: 12px; } } + +.testimonial { + width: 365px; + border-radius: 30px; + background-color: #ffffff; + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); + margin-left: 10px; +} + +.icon-review { + text-align: right; +} +.icon-review img { + margin-right: 50px; +} +.icon-review p { + margin-right: 35px; + margin-top: -25px; + width: 70%; + font-size: 15px; + line-height: 18px; + letter-spacing: 0.5px; + color: #2a3744; +} + +.circle-user { + width: 40px; + height: 40px; + border-radius: 50%; + position: relative; + right: 32px; + margin-top: 20px; +} +.circle-user img { + margin: 0px; + border-radius: 50%; +} + +.icon-user { + display: flex; + text-align: right; + padding-bottom: 25px; +} +.content-user { + margin-top: 20px; + margin-right: 45px; +} +.content-user a { + color: #1fa385; + line-height: 23px; + text-decoration: underline; +} +.content-logo { + margin: 0px !important; +} + +.slider-slide { + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + -webkit-justify-content: center; + justify-content: center; +} + +.simple-slider { + height: 400px; +} + +.simple-slider .slider-btn.slider-btn-prev { + left: 11px !important; + background-position: left !important; + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1) !important; + background: white !important; + border-radius: 50% !important; + width: 50px !important; + height: 50px !important; +} + +.simple-slider .slider-btn.slider-btn-next { + right: 4px !important; + background-position: right !important; + border-radius: 50% !important; + width: 50px !important; + height: 50px !important; + background: white !important; + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1) !important; +} + +.simple-slider .slider-btn.slider-btn-next img { + padding: 18px; + margin: 0px; +} + +.simple-slider .slider-btn.slider-btn-prev img { + padding: 18px; + margin: 0px; +} + +/* Services CSS */ + +/* Services CSS (Button Sizes) */ + +.button-med-140 { + min-width: 140px !important; + min-height: 50px !important; +} + +.button-med-120 { + min-width: 120px !important; + min-height: 50px !important; +} + +.med2 { + display: none; +} + +.button-med-100 { + min-width: 100px !important; + min-height: 50px !important; +} +.button-med-150 { + min-width: 150px !important; + min-height: 50px !important; +} + +.button-med-170 { + min-width: 170px !important; + min-height: 50px !important; +} + +/* Services CSS (More Weblate Grid) */ + +.inner-grid { + display: grid; + grid-template-columns: auto auto auto; + grid-column-gap: 0px; + grid-row-gap: 25px; +} + +.grid-item2 p { + color: #2e344b; + font-size: 18px; + font-weight: 600; + letter-spacing: 0; + line-height: 30px; +} + +.grid-item2 t { + color: #2e354a; + font-size: 16px; + letter-spacing: 0; + line-height: 10px; +} + +.grid-item1 { + padding-top: 5px; +} + +.grid-item2 { + padding-right: 15px; +} + +.grid-item3 { + padding-top: 5px; +} + +/* Services CSS (Inputs and placeholders) */ + +input[type="email"] { + height: 50px; + width: 70%; + border-radius: 5px 5px 0 0; + background-color: #e9eaec; + border-bottom: 2px solid #c4c6cb; + border-top: none; + border-right: none; + border-left: none; + padding: 13px 5px; +} + +::placeholder { + color: #bfc3c7; + font-size: 18px; + letter-spacing: 0; + line-height: 23px; + padding-right: 10px; +} + +input.fullwidth { + box-sizing: border-box; + height: 50px; + width: 100%; + border: 2px solid #bfc3c7; + border-radius: 5px; +} + +/* Services CSS (Users section) */ + +.user-slot { + height: 60px; + width: 330px; + border: 1px solid #00d2e6; + border-radius: 30px; + margin-bottom: 10px; + opacity: 0.8; + position: relative; +} + +.user-slot-content p { + color: #1fa385; + font-size: 14px; + letter-spacing: 0.86px; + line-height: 0px !important; + padding-bottom: 3px; +} + +.user-slot-content t { + color: #2a3744; + font-size: 17px; + letter-spacing: 0; + line-height: 0px !important; +} + +.user-img { + position: relative; + top: -14px; + right: 288px; +} + +.user-slot-content { + position: relative; + top: 19px; + right: 30px; +} + +/* Services CSS (Payments Section) */ + +.payment-listing { + border-bottom: 1px solid #e9eaec; +} + +.payment-listing:last-child { + border-bottom: none; +} + +/* Services CSS (Services) */ + +.service-variant { + display: flex; + justify-content: space-between; + height: 120px; + align-items: center; +} +.service-variant p { + color: #2b3646; + font-size: 40px; + letter-spacing: -1px; + line-height: 44px; + padding-right: 40px; + padding-top: 10px; +} + +.service-time { + display: grid; + text-align: center; + padding-top: 20px; + padding-left: 40px; + color: #bfc3c7; + font-size: 17px; +} + +/* Services CSS (Custom paddings, styles and margins) */ + +.bdr-btm { + border-bottom: none !important; +} + +.style { + padding-top: 0px !important; + padding-bottom: 0px !important; +} + +.pt-pb { + padding-top: 0px !important; + padding-bottom: 0px !important; +} + +.p-top { + padding-top: 22px !important; +} + +.service-text-formatting > div { + font-size: 18px !important; + line-height: 30px !important; + color: #2c3548; + padding-top: 15x; + padding-bottom: 20px; +} + +.user-text-formatting t { + font-size: 16px; + line-height: 30px; + padding-right: 21px; + font-weight: 600; + letter-spacing: 0; +} + +.pl-1 { + font-size: 16px; + padding-right: 20px; +} + +/* Services CSS (Days check color) */ + +.grey { + color: #bfc3c7 !important; + font-size: 16px; +} + +.orange { + color: #f6664c !important; + font-size: 16px; +} + +/* For change in font size of payments */ +.payment-font-size { + font-size: 16px !important; +} + +.payment-font-size a { + padding-right: 40px; + text-decoration: none !important; +} + +.payment-font-size a img { + position: relative; + top: 1px; + padding-right: 25px; +} + +/* User.html CSS */ + +/* User.html CSS(Service Title) */ + +.updated-service-title { + direction: ltr; +} + +.updated-service-title span { + color: #00a481; + font-size: 16px; + margin-left: 40.5px; +} + +.updated-service-title span a { + color: #00a481; + font-size: 16px; + letter-spacing: 0; + line-height: 20px; +} + +.updated-service-title span img { + height: 15px; + width: 10px; + position: relative; + top: 3px; + margin-right: 5px; +} + +/* User.html CSS(Donation Box) */ + +.payment-form-donationbox { + height: 100px; + width: 100%; + max-width: 530px; + border-radius: 20px; + background-color: #ffffff; + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); + margin: 0 auto; + display: flex; + align-items: center; + justify-content: center; +} + +.payment-form-donationbox a { + min-width: 0px; +} + +.line-right-donationbox { + font-size: 18px; + padding-left: 30px; +} + +/* User.html CSS(Line-left and Line-Right Custom Variants) */ + +.get-reward-left-line { + display: flex; + font-size: 40px !important; + letter-spacing: -1px; + line-height: 44px; + width: unset !important; + justify-content: space-between; + font-weight: unset !important; + color: #2c3647; +} + +.donation-left-line { + display: flex; + justify-content: space-between; + border: none; + margin-bottom: 20px; +} + +.reward-line-right { + color: #3f85ff; + font-size: 18px; + font-weight: 600; + letter-spacing: 0; + line-height: 23px; + margin-top: 17px; + margin-left: 40px; +} + +.inner-content { + display: flex; +} + +.inner-content-child-width { + width: 77.84%; +} + +.inner-content-child-width-auto { + width: auto; +} + +.inner-content-child-width-auto img { + max-height: 267px; + max-width: 192px; + float: left; + -webkit-transform: scaleX(-1); +} + +/* User.html CSS(Custom Styles and Custom Margin and Paddings) */ + +.payment-padding { + padding-bottom: 0px !important; +} + +.user-text-formatting > div { + font-size: 18px !important; + line-height: 30px !important; + color: #2c3548; + padding-top: 15x; + padding-bottom: 20px; +} + +.user-text-formatting-donation { + width: unset !important; + margin-left: 0px !important; +} + +.user-text-formatting-donation span { + font-weight: bold; +} + +.custom-gradient { + height: 20px; + background: linear-gradient(180deg, #e9eaec -45%, #ffffff 100%); + border: none; +} + +.subscription-note { + font-size: 16px; + color: #bfc3c7; +} + +.subscription-note span { + color: #2c3548 !important; +} + +.user-text-formatting-payment t { + font-size: 18px; + line-height: 30px; + padding-left: 55px !important; + padding-right: 0px !important; + font-weight: 400 !important; + letter-spacing: 0; +} + +.user-text-formatting-payment { + height: 86px; +} + +/* User.html CSS(Payments section updated) */ + +.payment-updated { + display: flow-root; +} diff --git a/weblate_web/static/style.css b/weblate_web/static/style.css index f922976cf9..6c933ce14b 100644 --- a/weblate_web/static/style.css +++ b/weblate_web/static/style.css @@ -4188,3 +4188,505 @@ input.fullwidth { bottom: 12px; } } + +/*Testimonial and Slider CSS*/ + +.testimonial { + width: 365px; + border-radius: 30px; + background-color: #ffffff; + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); + margin-left: 10px; +} + +.icon-review { + text-align: left; +} +.icon-review img { + margin-left: 50px; +} +.icon-review p { + margin-left: 35px; + margin-top: -25px; + width: 70%; + font-size: 15px; + line-height: 18px; + letter-spacing: 0.5px; + color: #2a3744; +} + +.circle-user { + width: 40px; + height: 40px; + border-radius: 50%; + position: relative; + left: 32px; + margin-top: 20px; +} +.circle-user img { + margin: 0px; + border-radius: 50%; +} + +.icon-user { + display: flex; + text-align: left; + padding-bottom: 25px; +} +.content-user { + margin-top: 20px; + margin-left: 45px; +} +.content-user a { + color: #1fa385; + line-height: 23px; + text-decoration: underline; +} +.content-logo { + margin: 0px !important; +} + +.slider-slide { + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + -webkit-justify-content: center; + justify-content: center; +} + +.simple-slider { + height: 400px; +} + +.simple-slider .slider-btn.slider-btn-prev { + left: 11px !important; + background-position: left !important; + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1) !important; + background: white !important; + border-radius: 50% !important; + width: 50px !important; + height: 50px !important; +} + +.simple-slider .slider-btn.slider-btn-next { + right: 4px !important; + background-position: right !important; + border-radius: 50% !important; + width: 50px !important; + height: 50px !important; + background: white !important; + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1) !important; +} + +.simple-slider .slider-btn.slider-btn-next img { + padding: 18px; + margin: 0px; +} + +.simple-slider .slider-btn.slider-btn-prev img { + padding: 18px; + margin: 0px; +} + +/* Services CSS */ + +/* Services CSS (Button Sizes) */ + +.button-med-140 { + min-width: 140px !important; + min-height: 50px !important; +} + +.button-med-120 { + min-width: 120px !important; + min-height: 50px !important; +} + +.med2 { + display: none; +} + +.button-med-100 { + min-width: 100px !important; + min-height: 50px !important; +} +.button-med-150 { + min-width: 150px !important; + min-height: 50px !important; +} + +.button-med-170 { + min-width: 170px !important; + min-height: 50px !important; +} + +/* Services CSS (More Weblate Grid) */ + +.inner-grid { + display: grid; + grid-template-columns: auto auto auto; + grid-column-gap: 0px; + grid-row-gap: 25px; +} + +.grid-item2 p { + color: #2e344b; + font-size: 18px; + font-weight: 600; + letter-spacing: 0; + line-height: 30px; +} + +.grid-item2 t { + color: #2e354a; + font-size: 16px; + letter-spacing: 0; + line-height: 10px; +} + +.grid-item1 { + padding-top: 5px; +} + +.grid-item2 { + padding-left: 15px; +} + +.grid-item3 { + padding-top: 5px; +} + +/* Services CSS (Inputs and placeholders) */ + +input[type="email"] { + height: 50px; + width: 70%; + border-radius: 5px 5px 0 0; + background-color: #e9eaec; + border-bottom: 2px solid #c4c6cb; + border-top: none; + border-right: none; + border-left: none; + padding: 13px 5px; +} + +::placeholder { + color: #bfc3c7; + font-size: 18px; + letter-spacing: 0; + line-height: 23px; + padding-left: 10px; +} + +input.fullwidth { + box-sizing: border-box; + height: 50px; + width: 100%; + border: 2px solid #bfc3c7; + border-radius: 5px; +} + +/* Services CSS (Users section) */ + +.user-slot { + height: 60px; + width: 330px; + border: 1px solid #00d2e6; + border-radius: 30px; + margin-bottom: 10px; + opacity: 0.8; + position: relative; +} + +.user-slot-content p { + color: #1fa385; + font-size: 14px; + letter-spacing: 0.86px; + line-height: 0px !important; + padding-bottom: 3px; +} + +.user-slot-content t { + color: #2a3744; + font-size: 17px; + letter-spacing: 0; + line-height: 0px !important; +} + +.user-img { + position: relative; + top: -14px; + left: 288px; +} + +.user-slot-content { + position: relative; + top: 19px; + left: 30px; +} + +/* Services CSS (Payments Section) */ + +.payment-listing { + border-bottom: 1px solid #e9eaec; +} + +.payment-listing:last-child { + border-bottom: none; +} + +/* Services CSS (Services) */ + +.service-variant { + display: flex; + justify-content: space-between; + height: 120px; + align-items: center; +} +.service-variant p { + color: #2b3646; + font-size: 40px; + letter-spacing: -1px; + line-height: 44px; + padding-left: 40px; + padding-top: 10px; +} + +.service-time { + display: grid; + text-align: center; + padding-top: 20px; + padding-right: 40px; + color: #bfc3c7; + font-size: 17px; +} + +/* Services CSS (Custom paddings, styles and margins) */ + +.bdr-btm { + border-bottom: none !important; +} + +.style { + padding-top: 0px !important; + padding-bottom: 0px !important; +} + +.pt-pb { + padding-top: 0px !important; + padding-bottom: 0px !important; +} + +.p-top { + padding-top: 22px !important; +} + +.service-text-formatting > div { + font-size: 18px !important; + line-height: 30px !important; + color: #2c3548; + padding-top: 15x; + padding-bottom: 20px; +} + +.user-text-formatting t { + font-size: 16px; + line-height: 30px; + padding-left: 21px; + font-weight: 600; + letter-spacing: 0; +} + +.pl-1 { + font-size: 16px; + padding-left: 20px; +} + +/* Services CSS (Days check color) */ + +.grey { + color: #bfc3c7 !important; + font-size: 16px; +} + +.orange { + color: #f6664c !important; + font-size: 16px; +} + +/* For change in font size of payments */ +.payment-font-size { + font-size: 16px !important; +} + +.payment-font-size a { + padding-left: 40px; + text-decoration: none !important; +} + +.payment-font-size a img { + position: relative; + top: 1px; + padding-left: 25px; +} + +/* User.html CSS */ + +/* User.html CSS(Service Title) */ + +.updated-service-title span { + color: #00a481; + font-size: 16px; + margin-left: 40.5px; +} + +.updated-service-title span a { + color: #00a481; + font-size: 16px; + letter-spacing: 0; + line-height: 20px; +} + +.updated-service-title span img { + height: 15px; + width: 10px; + position: relative; + top: 3px; + margin-left: 5px; +} + +/* User.html CSS(Donation Box) */ + +.payment-form-donationbox { + height: 100px; + width: 100%; + max-width: 530px; + border-radius: 20px; + background-color: #ffffff; + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); + margin: 0 auto; + display: flex; + align-items: center; + justify-content: center; +} + +.payment-form-donationbox a { + min-width: 0px; +} + +.line-right-donationbox { + font-size: 18px; + padding-right: 30px; +} + +/* User.html CSS(Line-left and Line-Right Custom Variants) */ + +.get-reward-left-line { + display: flex; + font-size: 40px !important; + letter-spacing: -1px; + line-height: 44px; + width: unset !important; + justify-content: space-between; + font-weight: unset !important; + color: #2c3647; +} + +.donation-left-line { + display: flex; + justify-content: space-between; + border: none; + margin-bottom: 20px; +} + +.reward-line-right { + color: #3f85ff; + font-size: 18px; + font-weight: 600; + letter-spacing: 0; + line-height: 23px; + margin-top: 17px; + margin-right: 40px; +} + +.inner-content { + display: flex; +} + +.inner-content-child-width { + width: 77.84%; +} + +.inner-content-child-width-auto { + width: auto; +} + +.inner-content-child-width-auto img { + max-height: 267px; + max-width: 192px; + float: right; +} + +/* User.html CSS(Custom Styles and Custom Margin and Paddings) */ + +.payment-padding { + padding-bottom: 0px !important; +} + +.user-text-formatting > div { + font-size: 18px !important; + line-height: 30px !important; + color: #2c3548; + padding-top: 15x; + padding-bottom: 20px; +} + +.user-text-formatting-donation { + width: unset !important; + margin-right: 0px !important; +} + +.user-text-formatting-donation span { + font-weight: bold; +} + +.custom-gradient { + height: 20px; + background: linear-gradient(180deg, #e9eaec -45%, #ffffff 100%); + border: none; +} + +.subscription-note { + font-size: 16px; + color: #bfc3c7; +} + +.subscription-note span { + color: #2c3548 !important; +} + +.user-text-formatting-payment t { + font-size: 18px; + line-height: 30px; + padding-left: 0px !important; + padding-right: 55px; + font-weight: 400 !important; + letter-spacing: 0; +} + +.user-text-formatting-payment { + height: 86px; +} + +/* User.html CSS(Payments section updated) */ + +.payment-updated { + display: flow-root; +} + +/* bottom.html CSS(Donation Box Adjustment) */ + +.donation-box-updated { + display: flex; +} diff --git a/weblate_web/templates/service.html b/weblate_web/templates/service.html index 4e8c9b88fd..88ac7d6bc1 100644 --- a/weblate_web/templates/service.html +++ b/weblate_web/templates/service.html @@ -1,8 +1,8 @@ {% extends "base.html" %} {% load i18n %} - -{% block title %}{% trans "Service" %}{% endblock %} - +{% block title %} +{% trans "Service" %} +{% endblock %} {% block content %}
diff --git a/weblate_web/templates/snippets/bottom.html b/weblate_web/templates/snippets/bottom.html index b767d37321..9db3bf9a23 100644 --- a/weblate_web/templates/snippets/bottom.html +++ b/weblate_web/templates/snippets/bottom.html @@ -1,6 +1,6 @@ {% load i18n %}
-
+
{% include "snippets/box-join.html" %} {% include "snippets/box-donate.html" %} diff --git a/weblate_web/templates/snippets/payment.html b/weblate_web/templates/snippets/payment.html index 5d5a301c36..f3867b90ef 100644 --- a/weblate_web/templates/snippets/payment.html +++ b/weblate_web/templates/snippets/payment.html @@ -1,33 +1,35 @@ {% load i18n %} {% load humanize %} -
-
- {{ payment.get_amount_display|intcomma }} {{ payment.get_currency_display }} -
- {{ payment.description }}
+{% load date_diff %} +{% load static %} - {% if payment.invoice %} -
- {% if payment.invoice_filename_valid %} - {{ payment.invoice_filename }} - {% else %} - {{ payment.invoice_filename }} - {% endif %} -
- {% elif payment.state != 5 %} -
- {% if payment.is_waiting_for_user %} - {{ payment.get_state_display }} - {% elif payment.details.reject_reason %} - {{ payment.get_state_display }}: {{ payment.details.reject_reason }} - {% else %} - {{ payment.get_state_display }} - {% endif %} -
- {% endif %} +
+
+ {{ payment.get_amount_display|intcomma }} {{ payment.get_currency_display }} + {% if payment.invoice %} + + {% elif payment.state != 5 %} +
+ {% if payment.is_waiting_for_user %} + {{ payment.get_state_display }} + {% elif payment.details.reject_reason %} + {{ payment.get_state_display }}: {{ payment.details.reject_reason }} + {% else %} + {{ payment.get_state_display }} + {% endif %} +
+ {% endif %}
+
+ {{ payment.description }} {% if payment.end|days_diff_from_today < 365 %} + {% trans "monthly" %} + {% else %} + {% trans "yearly" %} + {% endif %}
{% if payment.start %} - {% blocktrans with created=payment.start|date:"SHORT_DATE_FORMAT" expires=payment.end|date:"SHORT_DATE_FORMAT" context "Date range" %}{{ created }}–{{ expires }}{% endblocktrans %} +
{% blocktrans with created=payment.start|date:"d M Y" expires=payment.end|date:"d M Y" context "Date range" %}{{ created }}{{ expires }}{% endblocktrans %}
{% endif %}
diff --git a/weblate_web/templates/snippets/service.html b/weblate_web/templates/snippets/service.html index 1ca44320ae..d54f2f43bc 100644 --- a/weblate_web/templates/snippets/service.html +++ b/weblate_web/templates/snippets/service.html @@ -1,94 +1,154 @@ {% load i18n %} +{% load static %} +{% load date_diff %} -
-
-
{% trans "Service" %}
+
+
+
+

{{ service.get_status_display }}

+
+ {% with subscriptions=service.subscription_set.all %} + {% for subscription in subscriptions %} + {% with days_from_today=subscription.expires|days_diff_from_today %} + {% if days_from_today < 30 %} + {% if days_from_today < 2 and days_from_today >= 0 %} + {{ days_from_today}} {% trans "day remaining" %} + {% elif days_from_today < 0 %} + {% trans "Expired" %} + {% else %} + {{ days_from_today}} {% trans "days remaining" %} + {% endif %} + {% else %} + {{ days_from_today}} {% trans "days remaining" %} + {% endif %} + {% endwith %} + {% endfor %} + {% endwith %} +
+
+
+
+ +
+
{% trans "Users" %}
- {{ service.get_status_display }} - {% if not service.check_in_limits %} -
- {% trans "Exceeds selected service offering." %} -
- {% endif %} + {% for owner in service.users.all %} +
+
+
+

{{ owner.last_name }}

+ {{ owner.email }}
+ {% if owner == user %} +
Shield
+ {% else %} + {% csrf_token %} + + {% endif %} +
+ {% csrf_token %} + {% if owner != user %} + + + {% endif %} +
+ {% endfor %} +
+ {% csrf_token %} + + +
+ {% if service.needs_token %} -
-
{% trans "Activation token" %}
+
+
{% trans "Activation token" %}

- {% trans "Copy" %} + {% trans "Copy" %}
{% csrf_token %} - +
{% endif %} {% if service.backup_repository %} -
-
{% trans "Backup repository" %}
+ {% endif %} -
+
{% trans "Server URL" %}
{% if service.last_report %} {{ service.last_report.site_title|default:"Weblate" }} {% else %}

- {% trans "Use an activation token to connect your Weblate installation to the support portal. This step is optional, you can use support services without it as well." %} - {% trans "See documentation on subscription management." %} + {% trans "You can use use support services on our webite. Or, for more comfort, use an activation token to connect your Weblate installation to the support portal. More in " %} + {% trans "Documentation." %}

{% endif %}
- {% if service.note %} -
-
{% trans "Note" %}
-
-

{{ service.note }}

-
-
-
- {% endif %} {% with subscriptions=service.subscription_set.all %} {% for subscription in subscriptions %} -
+
{% trans "Subscription" %}
- {{ subscription.get_package_display }} +

{{ subscription.get_package_display }} + {% with days_from_today=subscription.expires|days_diff_from_today %} + {% if days_from_today < 365 %} + {% trans "monthly" %} + {% else %} + {% trans "yearly" %} + {% endif %}

+ {% endwith %} + {{ subscription.created|date:"d M Y" }}{{ subscription.expires|date:"d M Y" }} + + {% with days_from_today=subscription.expires|days_diff_from_today %} + {% if days_from_today < 30 %} + {% if days_from_today < 2 and days_from_today >= 0 %} + {{ days_from_today}} {% trans "day remaining" %} + {% elif days_from_today < 0 %} + Expired + {% else %} + {{ days_from_today}} {% trans "days remaining" %} + {% endif %} + {% else %} + {{ days_from_today}} {% trans "days remaining" %} + {% endif %} + {% endwith %} + + +
+ {% if service.note %} + {% trans "Note" %}: + + {{ service.note }} + + + {% endif %} + {% if service.status == "shared" %} {% trans "Change plan" %} {% endif %}
+ {% if subscription.get_repeat %} -
-
{% trans "Validity" %}
-
{% blocktrans with created=subscription.created|date:"SHORT_DATE_FORMAT" expires=subscription.expires|date:"SHORT_DATE_FORMAT" context "Date range" %}{{ created }}–{{ expires }}{% endblocktrans %}
-
-
- {% else %} -
-
{% trans "Creation date" %}
-
{{ subscription.created|date:"SHORT_DATE_FORMAT" }}
-
-
- {% endif %} - {% if subscription.get_repeat %} -
-
{% trans "State" %}
+
+
{% trans "Billing" %}
{% if not subscription.active %} {% trans "Expired" %} @@ -101,7 +161,7 @@ {% csrf_token %} {% if subscription.yearly_package %} - + {% trans "and" %}{% trans "save 20%" %}/strong> {% endif %} {% if subscription.payment_obj.recurring %} @@ -115,7 +175,7 @@
{% endif %} {% endfor %} -
+
{% trans "Payments" %}
{% for subscription in subscriptions %} @@ -127,36 +187,27 @@
{% endwith %} -
-
{% trans "Users" %}
-
- {% for owner in service.users.all %} -
- {{ owner.last_name }} <{{ owner.email }}> - {% csrf_token %} - {% if owner != user %} - - - {% endif %} -
- {% endfor %} -
- {% csrf_token %} - - -
-
-
-
-
-
{% trans "Get more services" %}
+ +
+
{% trans "More Weblate" %}
- {% for package, name in service.get_suggestions %} - {{ name }} +
+ {% for package, name, desc, image, text in service.get_suggestions %} +
+ logo +
+
+

{{ name }}

+ {{ desc }} +
+ {% empty %} - {% trans "Congratulations, your Weblate instance is fully covered." %} + {% trans "Congratulations, You are fully covered." %} {% endfor %}
-
+
+
diff --git a/weblate_web/templates/user.html b/weblate_web/templates/user.html index 97646160bb..01c3d3d3f7 100644 --- a/weblate_web/templates/user.html +++ b/weblate_web/templates/user.html @@ -1,9 +1,12 @@ {% extends "base.html" %} {% load i18n %} - +{% load static %} +{% load date_diff %} {% block title %}{% trans "User profile at Weblate" %}{% endblock %} {% block content %} + +
@@ -14,47 +17,56 @@

{% trans "User profile" %}

{% with services=user.service_set.all %} {% if services %} -

{% trans "Your services" %}

+
+

{% trans "My services" %}{% trans "See user profile " %}>

+
{% for service in services %} - {% include "snippets/service.html" %} + {% include "snippets/service.html" %} {% endfor %} {% endif %} {% endwith %} -

{% trans "Your donations" %}

+

{% trans "My donations" %}

{% for donation in user.donation_set.all %} -
-
-
{% trans "Creation date" %}
-
{{ donation.created|date:"SHORT_DATE_FORMAT" }}
-
-
-
-
{% trans "Reward" %}
-
- {{ donation.get_reward_display }} - {% if donation.reward %} - {% trans "Edit reward" %} - {% endif %} -
-
+
+
+
{{ donation.get_reward_display }}
+
{% trans "Your reward" %}
+
+
+
{% if donation.link_url %} -
-
{% trans "Link URL" %}
-
{{ donation.link_url }}
+
+
{% trans "Link" %}
+
{{ donation.link_url }}
{% endif %} -
-
{% trans "Expiry date" %}
-
{{ donation.expires|date:"SHORT_DATE_FORMAT" }}
+
+
{% trans "Active" %}
+
{{ donation.expires|date:"d M Y" }}{{ donation.created|date:"d M Y" }} + {% with days_from_today_donation=donation.expires|days_diff_from_today %} + {% if days_from_today_donation < 30 %} + {% if days_from_today_donation < 2 and days_from_today_donation >= 0 %} + {{ days_from_today_donation}} {% trans "day remaining" %} + {% elif days_from_today_donation < 0 %} + {% trans "Expired" %} + {% else %} + {{ days_from_today_donation}} {% trans "days remaining" %} + {% endif %} + {% else %} + {{ days_from_today_donation}} {% trans "days remaining" %} + {% endif %} + {% endwith %} +
-
-
{% trans "State" %}
-
+
+
+ +
{% if not donation.active %} {% trans "Expired" %} {% elif donation.payment_obj.recurring %} @@ -64,38 +76,40 @@

{% trans "Your donations" %}

{% endif %}
{% csrf_token %} - +
{% if donation.active and donation.payment_obj.recurring %}
{% csrf_token %} - +
{% endif %}
-
-
{% trans "Payments" %}
-
- {% for payment in donation.list_payments %} - {% include "snippets/payment.html" %} - {% endfor %}
-
+
+ Puppy +
+
+
+
+
{% trans "Payments" %}
+
+ {% for payment in donation.list_payments %} + {% include "snippets/payment.html" %} + {% endfor %}
-
+
{% empty %} -
-
-
{% trans "Donate to see a nice message here." %}
-
-
-
-
- {% trans "Donate" %} + +
+ +
{% trans "Wanna see a nice message here?" %}
+ + {% trans "Donate now" %}
{% endfor %}
diff --git a/weblate_web/templatetags/date_diff.py b/weblate_web/templatetags/date_diff.py new file mode 100644 index 0000000000..58884d2a86 --- /dev/null +++ b/weblate_web/templatetags/date_diff.py @@ -0,0 +1,9 @@ +from django.template import Library +from django.utils import timezone + +register = Library() + + +@register.filter +def days_diff_from_today(end): + return (end - timezone.now()).days + 1 diff --git a/weblate_web/tests.py b/weblate_web/tests.py index fa1f800673..7af87bfddc 100644 --- a/weblate_web/tests.py +++ b/weblate_web/tests.py @@ -634,7 +634,7 @@ def test_your_donations(self): expires=timezone.now() + relativedelta(years=1), payment=self.create_payment()[0].pk, ) - self.assertContains(self.client.get(reverse("user")), "Your donations") + self.assertContains(self.client.get(reverse("user")), "My donations") def test_link(self): self.create_donation()