diff --git a/Changelog b/Changelog index d838a022..4659401b 100644 --- a/Changelog +++ b/Changelog @@ -5,9 +5,14 @@ * [datacenterlight] Fix initially shown price 1.0.2: 2017-05-28 * [datacenterlight] Fixed login redirecting to blank page after logout +1.0.3: 2017-06-02 + * [datacenterlight] Hotfix, remove footer on mobile devices next: * [datacenterlight] Add German translations * [datacenterlight] Change beta access to subscriptions * [hosting] Add German translations * [blog] Add German translation for header + * [opennebula_api] Improve testing, add ssh key functions + * [opennebula_api] Remove template views + * [datacenterlight] Allow user to have multiple ssh keys diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index f3c7a9a0..6650beb0 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -235,7 +235,6 @@

{% trans "We are cutting down the costs significantly!" %}

{% trans "Affordable VM hosting based in Switzerland" %}

- {% trans "More Info" %}
diff --git a/hosting/forms.py b/hosting/forms.py index c94c4822..1c7f7e88 100644 --- a/hosting/forms.py +++ b/hosting/forms.py @@ -4,6 +4,7 @@ from django import forms from membership.models import CustomUser from django.contrib.auth import authenticate +from django.utils.translation import ugettext_lazy as _ from utils.stripe_utils import StripeUtils @@ -57,21 +58,19 @@ class HostingUserSignupForm(forms.ModelForm): class UserHostingKeyForm(forms.ModelForm): - private_key = forms.CharField(widget=forms.PasswordInput(), required=False) - public_key = forms.CharField(widget=forms.PasswordInput(), required=False) - user = forms.models.ModelChoiceField(queryset=CustomUser.objects.all(), required=False) - name = forms.CharField(required=False) + private_key = forms.CharField(widget=forms.HiddenInput(), required=False) + public_key = forms.CharField(widget=forms.Textarea(), required=False, + help_text=_('Paste here your public key')) + user = forms.models.ModelChoiceField(queryset=CustomUser.objects.all(), + required=False, widget=forms.HiddenInput()) + name = forms.CharField(required=True) def __init__(self, *args, **kwargs): self.request = kwargs.pop("request") super(UserHostingKeyForm, self).__init__(*args, **kwargs) - # self.initial['user'].initial = self.request.user.id - # print(self.fields) def clean_name(self): - return "dcl-priv-key-%s" % ( - ''.join(random.choice(string.ascii_lowercase) for i in range(7)) - ) + return self.data.get('name') def clean_user(self): return self.request.user @@ -90,4 +89,4 @@ class UserHostingKeyForm(forms.ModelForm): class Meta: model = UserHostingKey - fields = ['user', 'public_key', 'name'] + fields = ['user', 'name', 'public_key'] diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index c420290e..ca06753d 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-05-30 13:47+0000\n" +"POT-Creation-Date: 2017-06-01 21:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,6 +18,10 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: hosting/forms.py:63 +msgid "Paste here your public key" +msgstr "Fügen Sie Ihren public key ein" + #: hosting/templates/hosting/base_short.html:68 #: hosting/templates/hosting/base_short.html:139 msgid "My Virtual Machines" @@ -143,7 +147,7 @@ msgid "Customers" msgstr "Kunden" #: hosting/templates/hosting/bills.html:16 -#: hosting/templates/hosting/virtual_machine_key.html:45 +#: hosting/templates/hosting/virtual_machine_key.html:42 msgid "Name" msgstr "" @@ -330,7 +334,7 @@ msgstr "Betrag" #: hosting/templates/hosting/orders.html:19 #: hosting/templates/hosting/virtual_machine_detail.html:30 -#: hosting/templates/hosting/virtual_machine_key.html:47 +#: hosting/templates/hosting/virtual_machine_key.html:44 #: hosting/templates/hosting/virtual_machines.html:31 msgid "Status" msgstr "" @@ -449,7 +453,7 @@ msgstr "Beenden" msgid "Access Key" msgstr "Zugriffsschlüssel" -#: hosting/templates/hosting/virtual_machine_key.html:22 +#: hosting/templates/hosting/virtual_machine_key.html:25 msgid "Upload your own key. " msgstr "Laden Sie ihren Schlüssel hoch" @@ -461,7 +465,7 @@ msgstr "Schlüssel hochladen" msgid "Or generate a new key pair." msgstr "Oder erstellen Sie ein neues Schlüsselpaar" -#: hosting/templates/hosting/virtual_machine_key.html:37 +#: hosting/templates/hosting/virtual_machine_key.html:31 msgid "Generate Key Pair" msgstr "Schlüsselpaar generieren" @@ -472,30 +476,30 @@ msgstr "" "Verwenden Sie Ihren privaten SSH Schlüssel um sich mit Ihren Maschinen zu " "verbinden. Falls Sie ihn verloren haben kontaktieren Sie uns." -#: hosting/templates/hosting/virtual_machine_key.html:46 +#: hosting/templates/hosting/virtual_machine_key.html:43 msgid "Created at" msgstr "Erstellt am" -#: hosting/templates/hosting/virtual_machine_key.html:68 -#: hosting/templates/hosting/virtual_machine_key.html:81 +#: hosting/templates/hosting/virtual_machine_key.html:66 +#: hosting/templates/hosting/virtual_machine_key.html:79 msgid "Warning!" msgstr "Achtung!" -#: hosting/templates/hosting/virtual_machine_key.html:68 +#: hosting/templates/hosting/virtual_machine_key.html:66 msgid "You can download your SSH private key once. Don't lost your key" msgstr "" "Sie können ihren privaten SSH Schlüssel nur einmal herunterladen. Bewaren " "Sie ihn sicher auf." -#: hosting/templates/hosting/virtual_machine_key.html:76 +#: hosting/templates/hosting/virtual_machine_key.html:74 msgid "Copy to Clipboard" msgstr "Kopieren" -#: hosting/templates/hosting/virtual_machine_key.html:77 +#: hosting/templates/hosting/virtual_machine_key.html:75 msgid "Download" msgstr "" -#: hosting/templates/hosting/virtual_machine_key.html:81 +#: hosting/templates/hosting/virtual_machine_key.html:79 msgid "" "Your SSH private key was already generated and downloaded, if you lost it, " "contact us. " @@ -503,7 +507,7 @@ msgstr "" "Ihr privater SSH Schlüssel wurde bereits generiert und heruntergeladen, " "falls Sie ihn verloren haben kontaktieren Sie uns." -#: hosting/templates/hosting/virtual_machine_key.html:84 +#: hosting/templates/hosting/virtual_machine_key.html:82 msgid "Generate my key" msgstr "Generiere meinen Schlüssel" diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index 864c8835..022629b0 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -73,11 +73,7 @@ {% trans "My Orders"%} -
  • - - {% trans "Keys"%} - -
  • +
  • {% trans "Notifications "%} @@ -88,6 +84,11 @@ {{request.user.name}}