-
+ {% for message in messages %}
+
- {{message}} + {% endfor %} +
diff --git a/matrixhosting/forms.py b/matrixhosting/forms.py index 6552690..6f60f3c 100644 --- a/matrixhosting/forms.py +++ b/matrixhosting/forms.py @@ -15,16 +15,32 @@ class DomainNameField(forms.CharField): def __init__(self, *args, **kwargs): super(DomainNameField, self).__init__(*args, **kwargs) -class InitialRequestForm(forms.Form): +class MainModelForm(ModelForm): + def __init__(self, *args, **kwargs): + super(MainModelForm, self).__init__(*args, **kwargs) + for visible in self.visible_fields(): + visible.field.widget.attrs['class'] = 'form-control' + +class MainForm(forms.Form): + def __init__(self, *args, **kwargs): + super(MainForm, self).__init__(*args, **kwargs) + for visible in self.visible_fields(): + if (isinstance(visible.field.widget, forms.TextInput)): + visible.field.widget.attrs['class'] = 'form-control' + elif (isinstance(visible.field.widget, forms.CheckboxInput)): + visible.field.widget.attrs['class'] = 'custom-control-input' + + +class InitialRequestForm(MainForm): cores = forms.IntegerField(label='CPU', min_value=1, max_value=48, initial=1) memory = forms.IntegerField(label='RAM', min_value=2, max_value=200, initial=2) storage = forms.IntegerField(label='Storage', min_value=100, max_value=10000, initial=100) pricing_name = forms.CharField(required=True) class RequestHostedVMForm(InitialRequestForm): - matrix_domain = DomainNameField(required=True) - homeserver_domain = DomainNameField(required=True) - webclient_domain = DomainNameField(required=True) + matrix_domain = DomainNameField(required=True, widget=forms.TextInput(attrs={'placeholder': 'Matrix Domain *'})) + homeserver_domain = DomainNameField(required=True, widget=forms.TextInput(attrs={'placeholder': 'Homeserver Domain *'})) + webclient_domain = DomainNameField(required=True, widget=forms.TextInput(attrs={'placeholder': 'Webclient Domain *'})) is_open_registration = forms.BooleanField(required=False, initial=False) def clean(self): @@ -41,7 +57,7 @@ class RequestHostedVMForm(InitialRequestForm): return self.cleaned_data -class BillingAddressForm(ModelForm): +class BillingAddressForm(MainModelForm): class Meta: model = BillingAddress fields = ['full_name', 'street', diff --git a/matrixhosting/static/matrixhosting/css/theme.css b/matrixhosting/static/matrixhosting/css/theme.css index a7049fa..d642d70 100644 --- a/matrixhosting/static/matrixhosting/css/theme.css +++ b/matrixhosting/static/matrixhosting/css/theme.css @@ -535,6 +535,9 @@ body, html { .bg-dark-5 { background-color: #435161 !important; } + .bg-warning-2 { + background-color: #ffe8a3; + } hr { border-top: 1px solid rgba(16, 85, 96, 0.1); @@ -3521,4 +3524,14 @@ body, html { } .logo img { width: 200px; + } + + .errorlist { + padding-left: 0; + list-style: none; + background-color: #e41d25; + color: #fff; + } + #card-errors { + color: #e41d25; } \ No newline at end of file diff --git a/matrixhosting/static/matrixhosting/images/encryption.jpeg b/matrixhosting/static/matrixhosting/images/encryption.jpeg new file mode 100644 index 0000000..1f3f29e Binary files /dev/null and b/matrixhosting/static/matrixhosting/images/encryption.jpeg differ diff --git a/matrixhosting/static/matrixhosting/images/logo.png b/matrixhosting/static/matrixhosting/images/logo.png index 122283f..e5dc7d8 100644 Binary files a/matrixhosting/static/matrixhosting/images/logo.png and b/matrixhosting/static/matrixhosting/images/logo.png differ diff --git a/matrixhosting/static/matrixhosting/images/matrix-bridge-irc.jpg b/matrixhosting/static/matrixhosting/images/matrix-bridge-irc.jpg new file mode 100644 index 0000000..818a820 Binary files /dev/null and b/matrixhosting/static/matrixhosting/images/matrix-bridge-irc.jpg differ diff --git a/matrixhosting/static/matrixhosting/images/matrix.jpg b/matrixhosting/static/matrixhosting/images/matrix.jpg index 1f472e8..cb238ba 100644 Binary files a/matrixhosting/static/matrixhosting/images/matrix.jpg and b/matrixhosting/static/matrixhosting/images/matrix.jpg differ diff --git a/matrixhosting/static/matrixhosting/images/renewable-energy.jpeg b/matrixhosting/static/matrixhosting/images/renewable-energy.jpeg new file mode 100644 index 0000000..c117d27 Binary files /dev/null and b/matrixhosting/static/matrixhosting/images/renewable-energy.jpeg differ diff --git a/matrixhosting/static/matrixhosting/js/payment.js b/matrixhosting/static/matrixhosting/js/payment.js index d009b78..f52aa25 100644 --- a/matrixhosting/static/matrixhosting/js/payment.js +++ b/matrixhosting/static/matrixhosting/js/payment.js @@ -1,59 +1,18 @@ -var cardBrandToPfClass = { - 'visa': 'pf-visa', - 'mastercard': 'pf-mastercard', - 'amex': 'pf-american-express', - 'discover': 'pf-discover', - 'diners': 'pf-diners', - 'jcb': 'pf-jcb', - 'unknown': 'pf-credit-card' -}; function setBrandIcon(brand) { var brandIconElement = document.getElementById('brand-icon'); - var pfClass = 'pf-credit-card'; - if (brand in cardBrandToPfClass) { - pfClass = cardBrandToPfClass[brand]; - } + var pfClass = 'fa-cc-' + brand; for (var i = brandIconElement.classList.length - 1; i >= 0; i--) { brandIconElement.classList.remove(brandIconElement.classList[i]); } - brandIconElement.classList.add('pf'); + brandIconElement.classList.add('fab'); brandIconElement.classList.add(pfClass); } - $(document).ready(function () { - $.ajaxSetup({ - beforeSend: function (xhr, settings) { - function getCookie(name) { - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } - - if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) { - // Only send the token to relative URLs i.e. locally. - xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); - } - } - }); - - var hasCreditcard = window.hasCreditcard || false; if (!hasCreditcard && window.stripeKey) { var stripe = Stripe(window.stripeKey); - if (window.pm_id) { - - } else { + if (window.pm_id == undefined) { var element_style = { fonts: [{ family: 'lato-light', @@ -120,9 +79,9 @@ $(document).ready(function () { } function submitBillingForm(pmId) { - var billing_form = $('#billing-form'); - billing_form.append(''); - billing_form.submit(); + var order_form = $('#order_form'); + order_form.append(''); + order_form.submit(); } var $form_new = $('#payment-form-new'); @@ -133,7 +92,6 @@ $(document).ready(function () { e.preventDefault(); function stripePMHandler(paymentMethod) { // Insert the token ID into the form so it gets submitted to the server - console.log(paymentMethod); $('#id_payment_method').val(paymentMethod.id); submitBillingForm(paymentMethod.id); } diff --git a/matrixhosting/templates/account/base.html b/matrixhosting/templates/account/base.html new file mode 100644 index 0000000..9ee0385 --- /dev/null +++ b/matrixhosting/templates/account/base.html @@ -0,0 +1,97 @@ +{% load static i18n %} {% get_current_language as LANGUAGE_CODE %} + + + +
+ + + + +{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}
+ + + +{% else %} + +{% url 'account_email' as email_url %} + +{% blocktrans %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktrans %}
+ +{% endif %} + +{% endblock %} diff --git a/matrixhosting/templates/account/login.html b/matrixhosting/templates/account/login.html new file mode 100644 index 0000000..d8d92f7 --- /dev/null +++ b/matrixhosting/templates/account/login.html @@ -0,0 +1,43 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account socialaccount %} + +{% block head_title %}{% trans "Sign In" %}{% endblock %} + +{% block content %} +{% trans "Don't have an account?" %}{% trans "Sign Up" %}
+ +{% endblock %} diff --git a/matrixhosting/templates/account/logout.html b/matrixhosting/templates/account/logout.html new file mode 100644 index 0000000..8363f84 --- /dev/null +++ b/matrixhosting/templates/account/logout.html @@ -0,0 +1,18 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Sign Out" %}{% endblock %} + +{% block content %} +{% trans 'Are you sure you want to sign out?' %}
+ +{% endblock %} + diff --git a/matrixhosting/templates/account/password_reset.html b/matrixhosting/templates/account/password_reset.html new file mode 100644 index 0000000..033f84e --- /dev/null +++ b/matrixhosting/templates/account/password_reset.html @@ -0,0 +1,29 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account %} + +{% block head_title %}{% trans "Password Reset" %}{% endblock %} + +{% block content %} + {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} +{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
+ +{% endblock %} diff --git a/matrixhosting/templates/account/password_reset_from_key.html b/matrixhosting/templates/account/password_reset_from_key.html new file mode 100644 index 0000000..16f27e9 --- /dev/null +++ b/matrixhosting/templates/account/password_reset_from_key.html @@ -0,0 +1,23 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% block head_title %}{% trans "Change Password" %}{% endblock %} + +{% block content %} +{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}
+ {% else %} + {% if form %} + + {% else %} +{% trans 'Your password is now changed.' %}
+ {% endif %} + {% endif %} +{% endblock %} diff --git a/matrixhosting/templates/account/signup.html b/matrixhosting/templates/account/signup.html new file mode 100644 index 0000000..dab2230 --- /dev/null +++ b/matrixhosting/templates/account/signup.html @@ -0,0 +1,43 @@ +{% extends "account/base.html" %} + +{% load i18n %} +{% load account socialaccount %} + +{% block head_title %}{% trans "Sign In" %}{% endblock %} + +{% block content %} +{% trans "Already have an account?" %}{% trans "Login" %}
+{% endblock %} diff --git a/matrixhosting/templates/matrixhosting/base.html b/matrixhosting/templates/matrixhosting/base.html index 46b636a..fa4adcf 100644 --- a/matrixhosting/templates/matrixhosting/base.html +++ b/matrixhosting/templates/matrixhosting/base.html @@ -54,7 +54,6 @@ > - {% block js_extra %} {% endblock js_extra %}