Optimize for Pypi packaging
This commit is contained in:
parent
d6f4a0e348
commit
8c31b877f5
82 changed files with 308 additions and 2093 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -0,0 +1,3 @@
|
|||
[submodule "kb/kb"]
|
||||
path = kb/kb
|
||||
url = http://github.com/apescale/kb
|
|
@ -8,25 +8,12 @@ class ControllerPayments:
|
|||
self.args = args
|
||||
|
||||
def balance_update(self, transaction_id, amount):
|
||||
"""
|
||||
Обновление баланса пользователя
|
||||
:param transaction_id:
|
||||
:param amount:
|
||||
:return:
|
||||
"""
|
||||
user = models.UsersBalanceTransactions.select().where(models.UsersBalanceTransactions.id == transaction_id)[0]
|
||||
balance = models.UsersBalance.get(models.UsersBalance.user == user.user.id)
|
||||
balance.balance += float(amount)
|
||||
balance.save()
|
||||
|
||||
def transaction_create(self, user_id, amount, status='process'):
|
||||
"""
|
||||
Создание записи о транзакции со статусом 'proccess'
|
||||
:param user_id:
|
||||
:param amount:
|
||||
:param status:
|
||||
:return:
|
||||
"""
|
||||
# create transaction data to database
|
||||
transaction = models.UsersBalanceTransactions(user=user_id, amount=amount, status=status)
|
||||
transaction.save()
|
||||
|
@ -40,12 +27,6 @@ class ControllerPayments:
|
|||
return True
|
||||
|
||||
def transaction_set_status(self, transaction_id, status):
|
||||
"""
|
||||
Обновить статус [fail, success, process]
|
||||
:param transaction_id:
|
||||
:param status:
|
||||
:return:
|
||||
"""
|
||||
# update transaction signature
|
||||
transaction = models.UsersBalanceTransactions.get(models.UsersBalanceTransactions.id == transaction_id)
|
||||
transaction.status = status
|
||||
|
|
|
@ -157,8 +157,6 @@ class ControllerUsersDetails(ControllerUsers):
|
|||
x.country = kwargs['country']
|
||||
if 'state' in kwargs:
|
||||
x.state = kwargs['state']
|
||||
if 'phone' in kwargs:
|
||||
x.phone = kwargs['phone']
|
||||
if 'zipcode' in kwargs:
|
||||
x.zipcode = kwargs['zipcode']
|
||||
x.save()
|
||||
|
|
|
@ -94,25 +94,9 @@ class UsersDetails(PgSQLModel):
|
|||
city = CharField(null=True)
|
||||
country = CharField(null=True)
|
||||
state = CharField(null=True)
|
||||
phone = CharField(null=True)
|
||||
zipcode = IntegerField(null=True)
|
||||
|
||||
|
||||
# class UsersBillingDetails(PgSQLModel):
|
||||
# user = ForeignKeyField(Users)
|
||||
# fname = CharField(null=True)
|
||||
# lname = CharField(null=True)
|
||||
# city = CharField(null=True)
|
||||
# address = CharField(null=True)
|
||||
# country = CharField(null=True)
|
||||
# state = CharField(null=True)
|
||||
# zipcode = IntegerField(null=True)
|
||||
# ccno = CharField(null=True)
|
||||
# ccmonth = CharField(null=True)
|
||||
# ccyear = CharField(null=True)
|
||||
# cccvc = CharField(null=True)
|
||||
#
|
||||
|
||||
class UsersBalance(PgSQLModel):
|
||||
user = ForeignKeyField(Users, related_name='usersbalance')
|
||||
balance = FloatField(default=0, null=False)
|
||||
|
|
|
@ -120,12 +120,7 @@
|
|||
<li><a href="{{ url_for('administrator.ips_index') }}"><i class="fa fa-fw fa-table"></i> IPs</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="{{ url_for('administrator.settings_index') }}"><i class="fa fa-fw fa-table"></i> Settings</a>
|
||||
<ul>
|
||||
<li><a href="{{ url_for('administrator.settings_index') }}"><i class="fa fa-fw fa-table"></i> SMTP</a></li>
|
||||
<li><a href="{{ url_for('administrator.settings_index') }}"><i class="fa fa-fw fa-table"></i> Payments</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="{{ url_for('administrator.settings_index') }}"><i class="fa fa-fw fa-table"></i> Settings</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.navbar-collapse -->
|
||||
|
|
|
@ -5,30 +5,27 @@
|
|||
<nav class="top-bar" data-topbar role="navigation" data-options="sticky_on: large">
|
||||
<ul class="title-area">
|
||||
<li class="name">
|
||||
<h1><a href="{{ url_for('homepage.index') }}">Puluttar</a></h1>
|
||||
<!--<h1><a href="{{ url_for('homepage.index') }}"><img src="{{ url_for('static', filename='images/logo/procdn-logo-24.png') }}" border="0" /></a></h1>-->
|
||||
<h1><a href="{{ url_for('homepage.index') }}">GoCloud</a></h1>
|
||||
</li>
|
||||
</ul>
|
||||
<section class="top-bar-section">
|
||||
{% if session['user_id'] %}
|
||||
<ul class="right">
|
||||
<li><a href="{{ url_for('settings.index') }}">{{ _("Settings") }}</a></li>
|
||||
<li><a href="{{ url_for('account.logout') }}">{{ _("Logout") }}</a></li>
|
||||
<li><a href="{{ url_for('account.index') }}">Учётная запись</a></li>
|
||||
<li><a href="{{ url_for('account.billing') }}">Биллинг</a></li>
|
||||
<li><a href="{{ url_for('account.logout') }}">Выход</a></li>
|
||||
</ul>
|
||||
<ul class="left">
|
||||
<<<<<<< HEAD:app/templates/default/_header.html
|
||||
<li><a href="{{ url_for('containers.index') }}">{{ _("Containers") }}</a></li>
|
||||
<li><a href="{{ url_for('containers.create') }}">{{ _("Create new") }}</a></li>
|
||||
=======
|
||||
<li><a href="{{ url_for('containers.index') }}">Контейнеры</a></li>
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/templates/default/_header.html
|
||||
</ul>
|
||||
{% else %}
|
||||
<ul class="right">
|
||||
<li class="active"><a href="{{ url_for('account.login') }}">{{ _("Login") }}</a></li>
|
||||
<li><a href="{{ url_for('account.registration') }}">{{ _("Registration") }}</a></li>
|
||||
<li class="active"><a href="{{ url_for('account.login') }}">Вход</a></li>
|
||||
<li><a href="{{ url_for('account.registration') }}">Регистрация</a></li>
|
||||
</ul>
|
||||
<ul class="left">
|
||||
<li><a href="{{ url_for('homepage.index') }}">{{ _("Home") }}</a></li>
|
||||
<li><a href="{{ url_for('homepage.index') }}">Главная</a></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<script src="{{ url_for('static', filename='js/vendor/modernizr.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/foundation/foundation.min.js') }}"></script>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/foundation.min.css') }}" />
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/app.css') }}" />
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/gocloud.css') }}" />
|
||||
<meta name='shareinstock' content='' />
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _('New container') }}{% endblock %}
|
||||
{% block title %}Новый{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _('New container') }}</h3>
|
||||
<h3>Новый контейнер</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -29,9 +29,9 @@
|
|||
<div class="row">
|
||||
<form action="{{ url_for('containers.create') }}" method="post" id="containercreateform">
|
||||
<div class="small-12 columns">
|
||||
<label for="datacenter">
|
||||
{{ _('Data center') }}
|
||||
<select name="datacenter" class="form" id="datacenter">
|
||||
<label for="backend">
|
||||
Датацентр
|
||||
<select name="datacenter" class="form">
|
||||
{% for datacenter in datacenters['items'] %}
|
||||
<option value="{{ datacenter.id }}">{{ datacenter.name }}: {{ datacenter.country }}, {{ datacenter.city }}</option>
|
||||
{% endfor %}
|
||||
|
@ -39,7 +39,7 @@
|
|||
</label>
|
||||
</div>
|
||||
<div class="small-12 columns">
|
||||
<input type="submit" value="{{ _('Create container') }}" class="button success" id="submitform" />
|
||||
<input type="submit" value="Создать контейнер" class="button success" id="submitform" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _('Delete container') }}{% endblock %}
|
||||
{% block title %}Удаление контейнера{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _('Delete container') }}</h3>
|
||||
<h3>Удаление контейнера</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -20,10 +20,10 @@
|
|||
<form action="{{ url_for('containers.delete', container_id=container.id) }}" method="post">
|
||||
<input type="hidden" name="id" value="{{ container.id }}" />
|
||||
<p>
|
||||
{{ _('Do you really want to delete container?') }}<br/>
|
||||
Вы действительно хотите удалить контейнер?<br/>
|
||||
</p>
|
||||
<input type="submit" value="{{ _('Yes, I want!') }}" class="button alert" />
|
||||
<a href="{{ url_for('containers.index') }}" class="">{{ _('Cancel') }}</a>
|
||||
<input type="submit" value="Удалить" class="button alert" />
|
||||
<a href="{{ url_for('containers.index') }}" class="">Отмена</a>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -1,43 +1,30 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
<<<<<<< HEAD:app/templates/default/containers/index.html
|
||||
{% block title %}{{ _('Containers') }}{% endblock %}
|
||||
=======
|
||||
{% block title %}Контейнеры{% endblock %}
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/templates/default/containers/index.html
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _('List') }} <a href="{{ url_for('containers.create') }}">+</a></h3>
|
||||
<h3>Список <a href="{{ url_for('containers.create') }}">+</a></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<table id="containers" width="100%">
|
||||
<table id="zones" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<<<<<<< HEAD:app/templates/default/containers/index.html
|
||||
<th width="45%">{{ _('ID') }}</th>
|
||||
<th>{{ _('IP address') }}</th>
|
||||
<th>{{ _('Storage') }}</th>
|
||||
<th>{{ _('Status') }}</th>
|
||||
=======
|
||||
<th width="45%">ID</th>
|
||||
<th>IP</th>
|
||||
<th>Диск</th>
|
||||
<th>Память</th>
|
||||
<th>Статус</th>
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/templates/default/containers/index.html
|
||||
<th width="10%"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if containers.total == 0 %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ _('No one container created yet. <a href="%s">Create one</a>.' % url_for('containers.create')) }}
|
||||
</td>
|
||||
<td>Нет ни одного контейнера. <a href="{{ url_for('containers.create') }}">Добавить</a>.</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
{% for container in containers['items'] %}
|
||||
|
@ -52,21 +39,6 @@
|
|||
{{ '%0.2f' | format(size_gb|float) }}GB
|
||||
</td>
|
||||
<td>
|
||||
<<<<<<< HEAD:app/templates/default/containers/index.html
|
||||
{% if container['status'] == 0 %}
|
||||
{{ _('Inactive') }}
|
||||
{% elif container['status'] == 1 %}
|
||||
{{ _('Active') }}
|
||||
{% elif container['status'] == 2 %}
|
||||
{{ _('Activation') }}
|
||||
{% elif container['status'] == 3 %}
|
||||
{{ _('Deactivation') }}
|
||||
{% elif container['status'] == 4 %}
|
||||
{{ _('Creation...') }}
|
||||
{% elif container['status'] == 5 %}
|
||||
{{ _('Deletion...') }}
|
||||
{% endif %}
|
||||
=======
|
||||
<a href="{{ url_for('containers.stats', container_id=container.id) }}">
|
||||
{% if container['status'] == 1 %}
|
||||
{% set memory_mb = (container.memory / 1024 / 1024) %}
|
||||
|
@ -90,10 +62,9 @@
|
|||
{% elif container['status'] == 5 %}
|
||||
Удаление...
|
||||
{% endif %}
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/templates/default/containers/index.html
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('containers.settings', container_id=container.id) }}">{{ _('Settings') }}</a>
|
||||
<a href="{{ url_for('containers.settings', container_id=container.id) }}">Настройки</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _('Settings') }}{% endblock %}
|
||||
{% block title %}Статистика{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _('Settings') }}</h3>
|
||||
<h3>Настройки</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -19,25 +19,25 @@
|
|||
</div>
|
||||
{% else %}
|
||||
<div class="large-12 columns">
|
||||
<h4>{{ _('Status') }}</h4>
|
||||
<h4>Статус</h4>
|
||||
{% if container.status == 0 %}
|
||||
<p style="color: red">{{ _('Inactive') }}</p>
|
||||
<p style="color: red">Неактивен</p>
|
||||
{% else %}
|
||||
<p style="color: green">{{ _('Active') }}</p>
|
||||
<p style="color: green">Активен</p>
|
||||
{% endif %}
|
||||
<form action="{{ url_for('containers.settings', container_id=container.id) }}" method="post">
|
||||
<input type="hidden" name="action" value="set_status">
|
||||
<div class="input-group">
|
||||
<select name="status">
|
||||
<option value="active">{{ _('Activate') }}</option>
|
||||
<option value="inactive">{{ _('Deactivate') }}</option>
|
||||
<option value="active">Активировать</option>
|
||||
<option value="inactive">Деактивировать</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="submit" value="{{ _('Change status') }}" class="button success small">
|
||||
<input type="submit" value="Изменить статус" class="button success small">
|
||||
</form>
|
||||
<h4>{{ _('Delete container') }}</h4>
|
||||
<h4>Удалить</h4>
|
||||
<a href="{{ url_for('containers.delete', container_id=container.id) }}">
|
||||
<button class="button alert">{{ _('Delete') }}</button>
|
||||
<button class="button alert">Удалить</button>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _('Documents') }}{% endblock %}
|
||||
{% block title %}Документы{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<ul class="inline-list">
|
||||
<li><a href="{{ url_for('account.password_update') }}">{{ _("Password update") }}</a></li>
|
||||
<li><a href="{{ url_for('account.sshkey') }}">{{ _("SSH-key") }}</a></li>
|
||||
<li><a href="{{ url_for('account.api') }}">{{ _("API") }}</a></li>
|
||||
<li><a href="{{ url_for('account.index') }}">Учётная запись</a></li>
|
||||
<li><a href="{{ url_for('account.billing') }}">Биллинг</a></li>
|
||||
{# <li><a href="{{ url_for('account.settings') }}">Настройки</a></li>#}
|
||||
<li><a href="{{ url_for('account.password_update') }}">Смена пароля</a></li>
|
||||
<li><a href="{{ url_for('account.sshkey') }}">SSH ключ</a></li>
|
||||
<li><a href="{{ url_for('account.api') }}">API</a></li>
|
||||
</ul>
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("API") }}{% endblock %}
|
||||
{% block title %}Баланс{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Account") }}</h2>
|
||||
<h2>Учётная запись</h2>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
{% include "default/id/_menu.html" %}
|
||||
|
@ -13,9 +13,10 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _("API") }}</h3>
|
||||
<h3>API</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
{% if g.errors['total'] > 0 %}
|
||||
|
@ -27,19 +28,26 @@
|
|||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form action="{{ url_for('account.api_update') }}" method="post">
|
||||
<input type="hidden" name="method" value="secret_update" />
|
||||
<label for="email">{{ _("Email") }}</label>
|
||||
<input type="text" name="email" value="{{ session['email'] }}" id="email" disabled />
|
||||
<label for="secret">{{ _("API-key") }}</label>
|
||||
<input type="text" name="secret" value="{{ user_secret.secret }}" id="secret" />
|
||||
<label for="acl">IP</label>
|
||||
<input type="text" name="acl" value="{{ user_secret.acl }}" id="acl" />
|
||||
<input type="button" value="{{ _('Update API-key') }}" class="button small default" id="generate_secret" />
|
||||
<input type="submit" value="{{ _('Save changes') }}" class="button small success" />
|
||||
|
||||
<input type="radio" name="status" value="0" {% if user_secret.status == 0 or not user_secret.status %}checked="checked"{% endif %} /> {{ _("Inactive") }}
|
||||
<input type="radio" name="status" value="1" {% if user_secret.status == 1 %}checked="checked"{% endif %} /> {{ _("Active") }}
|
||||
<label>
|
||||
Email
|
||||
<input type="text" name="email" value="{{ session['email'] }}" disabled />
|
||||
</label>
|
||||
<label>
|
||||
Ключ API
|
||||
<input type="text" name="secret" value="{{ user_secret.secret }}" id="secret" />
|
||||
</label>
|
||||
<label for="acl">
|
||||
IP
|
||||
<input type="text" name="acl" value="{{ user_secret.acl }}" id="acl" />
|
||||
</label>
|
||||
<input type="button" value="Обновить ключ API" class="button small default" id="generate_secret" />
|
||||
<input type="submit" value="Сохранить изменения" class="button small success" />
|
||||
|
||||
<input type="radio" name="status" value="0" {% if user_secret.status == 0 or not user_secret.status %}checked="checked"{% endif %} /> Неактивно
|
||||
<input type="radio" name="status" value="1" {% if user_secret.status == 1 %}checked="checked"{% endif %} /> Активно
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Balance") }}{% endblock %}
|
||||
{% block title %}Баланс{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Account") }}</h2>
|
||||
<h2>Учётная запись</h2>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
{% include "default/id/_menu.html" %}
|
||||
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _("Balance") }}</h3>
|
||||
<h3>Баланс</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -23,32 +23,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<form id="myCCForm" action="/order" method="post">
|
||||
<input id="token" name="token" type="hidden" value="">
|
||||
<div>
|
||||
<label>
|
||||
<span>Card Number</span>
|
||||
</label>
|
||||
<input id="ccNo" type="text" size="20" value="" autocomplete="off" required />
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<span>Expiration Date (MM/YYYY)</span>
|
||||
</label>
|
||||
<input type="text" size="2" id="expMonth" required />
|
||||
<span> / </span>
|
||||
<input type="text" size="2" id="expYear" required />
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<span>CVC</span>
|
||||
</label>
|
||||
<input id="cvv" size="4" type="text" value="" autocomplete="off" required />
|
||||
</div>
|
||||
<input type="submit" value="Submit Payment">
|
||||
</form>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
<h4>Пополнить</h4>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _('Account') }}{% endblock %}
|
||||
{% block title %}Учётная запись{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _('Account') }}</h2>
|
||||
<h2>Учётная запись</h2>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
{% include "default/id/_menu.html" %}
|
||||
|
|
|
@ -1,28 +1,34 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Login") }}{% endblock %}
|
||||
{% block title %}Вход{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Login") }}</h2>
|
||||
<h3>Вход</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div data-alert class="alert-box alert">
|
||||
{% for error in g.errors['items'] %}{{ error }}{% endfor %}
|
||||
{% for error in g.errors['items'] %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form action="{{ url_for('account.login') }}" method="post">
|
||||
<input type="hidden" name="method" value="login" />
|
||||
<label for="email">{{ _("Email") }}</label>
|
||||
<input type="text" name="email" value="" placeholder="my@email.com" class="" id="email" />
|
||||
<label for="password">{{ _("Password") }}</label>
|
||||
<input type="password" name="password" value="" placeholder="" class="" id="password" />
|
||||
<input type="submit" value="{{ _('Login') }}" class="button success" />
|
||||
<a href="{{ url_for('account.password_reset') }}">{{ _("Reset password") }}</a>
|
||||
<label>
|
||||
Адрес ел. почты
|
||||
<input type="text" name="email" value="" placeholder="my@email.com" class="" />
|
||||
</label>
|
||||
<label>
|
||||
Пароль
|
||||
<input type="password" name="password" value="" placeholder="" class="" />
|
||||
</label>
|
||||
<input type="submit" value="Войти" class="button success" />
|
||||
<a href="{{ url_for('account.password_reset') }}">Сбросить пароль</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Password reset") }}{% endblock %}
|
||||
{% block title %}Сброс пароля{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Password reset") }}</h2>
|
||||
<h2>Восстановление пароля</h2>
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div data-alert class="alert-box alert">
|
||||
{% for error in g.errors['items'] %}
|
||||
|
@ -14,11 +14,13 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
<form action="{{ url_for('account.password_reset') }}" method="post">
|
||||
<label for="email">{{ _("Email") }}</label>
|
||||
<input type="text" name="email" value="" id='email' />
|
||||
<input type="submit" value="{{ _('Send verify code') }}" class="button success" />
|
||||
<label for="email">
|
||||
Адрес е.почты
|
||||
<input type="text" name="email" value="" id='email' />
|
||||
</label>
|
||||
<input type="submit" value="Отправить проверочный код" class="button success" />
|
||||
|
||||
<a href="{{ url_for('account.password_reset_step2') }}">{{ _("I have a verification code") }}</a>
|
||||
<a href="{{ url_for('account.password_reset_step2') }}">Есть проверочный код</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Password reset") }}{% endblock %}
|
||||
{% block title %}Сброс пароля{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Password reset") }}</h2>
|
||||
<h2>Сброс пароля. Шаг №2</h2>
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div data-alert class="alert-box alert">
|
||||
{% for error in g.errors['items'] %}
|
||||
|
@ -15,13 +15,16 @@
|
|||
{% endif %}
|
||||
<form action="{{ url_for('account.password_reset_step2') }}" method="post">
|
||||
<input type="hidden" name="recovery" value="1" />
|
||||
<label for='email'>{{ _("Email") }}</label>
|
||||
<input type="text" name="email" value="" id='email' />
|
||||
<label for='code'>{{ _("Verification code") }}</label>
|
||||
<input type="text" name="recovery_code" value="" id='code' />
|
||||
<input type="submit" value="{{ _('Reset password') }}" class="button success" />
|
||||
|
||||
<a href="{{ url_for('account.password_reset') }}">{{ _("I have no verification code") }}</a>
|
||||
<label for='email'>
|
||||
Адрес е.почты
|
||||
<input type="text" name="email" value="" id='email' />
|
||||
</label>
|
||||
<label for='code'>
|
||||
Введите проверочный код
|
||||
<input type="text" name="recovery_code" value="" id='code' />
|
||||
</label>
|
||||
<input type="submit" value="Сбросить пароль" class="button success" />
|
||||
<a href="{{ url_for('account.password_reset') }}">Получить код</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Update password") }}{% endblock %}
|
||||
{% block title %}Смена пароля{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Account") }}</h2>
|
||||
<h2>Учётная запись</h2>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
{% include "default/id/_menu.html" %}
|
||||
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _("Update password") }}</h3>
|
||||
<h3>Смена пароля</h3>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
{% if g.errors['total'] > 0 %}
|
||||
|
@ -24,14 +24,20 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
<form action="{{ url_for('account.password_update') }}" method="post">
|
||||
<label for="old_password">{{ _("Old password") }}</label>
|
||||
<input type="password" name="old_password" value="" id="old_password" />
|
||||
<label for="new_password">{{ _("New password") }}</label>
|
||||
<input type="password" name="new_password" value="" id="new_password" />
|
||||
<label for="new_password2">{{ _("New password (again)") }}</label>
|
||||
<input type="password" name="new_password_confirm" value="" id="new_password2" />
|
||||
<input type="submit" value="{{ _('Update password') }}" class="button success" />
|
||||
<a href="{{ url_for('account.index') }}" class="button secondary">{{ _("Cancel") }}</a>
|
||||
<label>
|
||||
Старый пароль
|
||||
<input type="password" name="old_password" value="" />
|
||||
</label>
|
||||
<label>
|
||||
Новый пароль
|
||||
<input type="password" name="new_password" value="" />
|
||||
</label>
|
||||
<label>
|
||||
Новый пароль (повторно)
|
||||
<input type="password" name="new_password_confirm" value="" />
|
||||
</label>
|
||||
<input type="submit" value="Сменить пароль" class="button success" />
|
||||
<a href="{{ url_for('account.index') }}" class="button secondary">Отмена</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,27 +1,37 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _('Registration') }}{% endblock %}
|
||||
{% block title %}Регистрация{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<h2>{{ _('Registration') }}</h2>
|
||||
<h2>Регистрация</h2>
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div id='errors'>
|
||||
<ul>
|
||||
{% for error in g.errors['items'] %}<li>{{ error }}</li>{% endfor %}
|
||||
{% for error in g.errors['items'] %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<form action="{{ url_for('account.registration') }}" method="post">
|
||||
<input type="hidden" name="method" value="member_add" />
|
||||
<label for="email">{{ _('Email') }}</label>
|
||||
<input type="text" name="email" value="" class="email" id="email" />
|
||||
<label for="password">{{ _('Password') }}</label>
|
||||
<input type="password" name="password" value="" id="password" />
|
||||
<label for="password2">{{ _('Password (again)') }}</label>
|
||||
<input type="password" name="password2" value="" id="password2" />
|
||||
<input type="submit" value="{{ _('Sign up') }}" class="button success" />
|
||||
<label for="email">
|
||||
Адрес ел. почты
|
||||
<input type="text" name="email" value="" class="email" id="email" />
|
||||
</label>
|
||||
<label for="password">
|
||||
Пароль
|
||||
<input type="password" name="password" value="" id="password" />
|
||||
</label>
|
||||
<label for="password2">
|
||||
Пароль (повторно)
|
||||
<input type="password" name="password2" value="" id="password2" />
|
||||
</label>
|
||||
{# <input type="checkbox" name="agree1" value="1" /> I agree <a href="">″Terms of Service″</a><br/>#}
|
||||
{# <input type="checkbox" name="agree2" value="1" /> I agree <a href="">″Privacy Policy″</a><br/>#}
|
||||
<input type="submit" value="Зарегистрироваться" class="button success" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="large-6">
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("SSH-key") }}{% endblock %}
|
||||
{% block title %}SSH-ключ{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Account") }}</h2>
|
||||
<h2>Учётная запись</h2>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
{% include "default/id/_menu.html" %}
|
||||
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _("SSH-key") }}</h3>
|
||||
<h3>SSH-ключ</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -21,13 +21,13 @@
|
|||
{% if sshkey.exists %}
|
||||
<form action="{{ url_for('account.sshkey_delete') }}" method="post">
|
||||
<input type="text" value="{{ sshkey.sshkey }}" disabled />
|
||||
<input type="submit" value="Delete" class="button alert" />
|
||||
<input type="submit" value="Удалить ключ" class="button alert" />
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="{{ url_for('account.sshkey') }}" method="post">
|
||||
<label for="sshkey">SSH-key</label>
|
||||
<label for="sshkey">SSH-ключ</label>
|
||||
<input type="text" name="sshkey" value="" id="sshkey" class="form" />
|
||||
<input type="submit" value="Add" class="button button-success" />
|
||||
<input type="submit" value="Добавить ключ" class="button button-success" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Knowledge base") }}{% endblock %}
|
||||
{% block title %}База знаний{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
<body>
|
||||
<h1>Успешная оплата</h1>
|
||||
<p>Баланс успешно пополнен.</p>
|
||||
<p><a href='{{ url_for("account.billing") }}'>В личный кабинет</a></p>
|
||||
<p><a href="{{ url_for("account.billing") }}">В личный кабинет</a></p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,32 +1,26 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Support{% endblock %}
|
||||
{% block title %}Поддержка{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>Support</h2>
|
||||
<h2>Поддержка</h2>
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<div class="large-12 columns">
|
||||
<form action="{{ url_for('support.index') }}" method="post">
|
||||
{% if not session['email'] %}
|
||||
<label for="email">Email</label>
|
||||
<input type="text" name="email" id="email" value="" />
|
||||
<label for="email">Адрес ел. почты</label>
|
||||
<input type="text" name="email" id="email" value="" />
|
||||
{% else %}
|
||||
<input type="hidden" name="email" value="{{ session['email'] }}" />
|
||||
<input type="hidden" name="email" value="{{ session['email'] }}" />
|
||||
{% endif %}
|
||||
<label for="title">Title</label>
|
||||
<label for="title">Заголовок</label>
|
||||
<input type="text" name="title" id="title" value="">
|
||||
<label for="message">Message</label>
|
||||
<label for="message">Сообщение</label>
|
||||
<textarea rows="14" name="message" id="message"></textarea>
|
||||
<input type="submit" class="button success" value="Send" />
|
||||
<input type="submit" class="button success" value="Отправить" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<h3>{{ _("Contacts") }}</h3>
|
||||
<p>Email: support@puluttar.com</p>
|
||||
<h3>Address</h3>
|
||||
<p>127322, Milashenkova st. 18, of. 256, Moscow</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +1,14 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Thank You!") }}{% endblock %}
|
||||
{% block title %}Спасибо{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Thank you!") }}</h2>
|
||||
<h2>Спасибо!</h2>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
<p>{{ _("Thank you for contacting support. We will reply you as soon as possible.") }}</p>
|
||||
<p>Спасибо за обращение в поддержку. Мы ответим вам в кротчайшее время.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -2,21 +2,6 @@
|
|||
|
||||
from flask import Blueprint, g, render_template, session, redirect, url_for, request
|
||||
from sshpubkeys import SSHKey
|
||||
<<<<<<< HEAD:app/cloud/views/account/__init__.py
|
||||
from flask import render_template, session, redirect, url_for, request
|
||||
from flask import g
|
||||
from flask import Blueprint
|
||||
# from flask.ext.babel import gettext
|
||||
from app import models
|
||||
from app.cloud.controllers.common import special_match
|
||||
from app.cloud.controllers.common import ControllerMessagesEmail
|
||||
from app.cloud.controllers.users import ControllerUsers
|
||||
from app.cloud.controllers.users import ControllerAPI
|
||||
from app.cloud.controllers.users import ControllerSSHKey
|
||||
from app.cloud.controllers.users import ControllerUsersDetails
|
||||
from app.cloud.controllers.users import ControllerUsersRecoveryCodes
|
||||
from app.cloud.controllers.billing import ControllerBilling
|
||||
=======
|
||||
from SWSCloudCore.controllers.billing import ControllerBilling
|
||||
from SWSCloudCore.controllers.common import ControllerMessagesEmail
|
||||
from SWSCloudCore.controllers.common import special_match
|
||||
|
@ -26,11 +11,120 @@ from SWSCloudCore.controllers.users import ControllerUsers
|
|||
from SWSCloudCore.controllers.users import ControllerUsersDetails
|
||||
from SWSCloudCore.controllers.users import ControllerUsersRecoveryCodes
|
||||
from SWSCloudCore import models
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/views/account/__init__.py
|
||||
|
||||
viewAccount = Blueprint('account', __name__, url_prefix='/account')
|
||||
|
||||
|
||||
@viewAccount.route('/', methods=['GET', 'POST'])
|
||||
def index():
|
||||
# check session
|
||||
if not ControllerUsers().check_session():
|
||||
return redirect(url_for("account.logout"))
|
||||
# auth user
|
||||
if not ControllerUsers().auth(session['email'], session['password']):
|
||||
return redirect(url_for("account.logout"))
|
||||
|
||||
cud = ControllerUsersDetails(session['user_id'])
|
||||
user = cud.details_get()
|
||||
|
||||
# проверяем, есть ли запись в таблице usersdetails, чтобы небыло ошибок
|
||||
if not cud.details_exists():
|
||||
# если нет, то делаем запись в таблицу, чтобы небыло ошибок
|
||||
cud.details_create()
|
||||
|
||||
# извлекаем из базы детали пользователя
|
||||
user_details = cud.details_get()
|
||||
|
||||
return render_template(
|
||||
'default/id/index.html',
|
||||
user=user,
|
||||
user_details=user_details
|
||||
)
|
||||
|
||||
|
||||
@viewAccount.route('/edit', methods=['GET', 'POST'])
|
||||
def edit():
|
||||
# check session
|
||||
if not ControllerUsers().check_session():
|
||||
return redirect(url_for("account.logout"))
|
||||
# auth user
|
||||
if not ControllerUsers().auth(session['email'], session['password']):
|
||||
return redirect(url_for("account.logout"))
|
||||
|
||||
cud = ControllerUsersDetails(session['user_id'])
|
||||
user = cud.details_get()
|
||||
|
||||
if not cud.details_exists():
|
||||
cud.details_create()
|
||||
|
||||
if request.method == "POST":
|
||||
if not request.form['zipcode'].isdigit():
|
||||
g.errors['items'].append(u'Индекс должен содержать только цифры')
|
||||
g.errors['total'] += 1
|
||||
|
||||
if g.errors['total'] == 0:
|
||||
cud.details_update(
|
||||
fname=request.form['fname'],
|
||||
lname=request.form['lname'],
|
||||
address=request.form['address'],
|
||||
city=request.form['city'],
|
||||
country=request.form['country'],
|
||||
state=request.form['state'],
|
||||
zipcode=request.form['zipcode']
|
||||
)
|
||||
return redirect(url_for('account.edit'))
|
||||
# get user details
|
||||
user_details = cud.details_get()
|
||||
|
||||
return render_template('default/id/edit.html', user=user, user_details=user_details)
|
||||
|
||||
|
||||
@viewAccount.route('/settings', methods=['GET', 'POST'])
|
||||
def settings():
|
||||
# check session
|
||||
if not ControllerUsers().check_session():
|
||||
return redirect(url_for("account.logout"))
|
||||
# auth user
|
||||
if not ControllerUsers().auth(session['email'], session['password']):
|
||||
return redirect(url_for("account.logout"))
|
||||
# get user data
|
||||
user = ControllerUsers(session['user_id']).get()
|
||||
|
||||
return render_template('default/id/index.html', user_details=user)
|
||||
|
||||
|
||||
@viewAccount.route('/billing', methods=['GET', 'POST'])
|
||||
def billing():
|
||||
# check session
|
||||
if not ControllerUsers().check_session():
|
||||
return redirect(url_for("account.logout"))
|
||||
# auth user
|
||||
if not ControllerUsers().auth(session['email'], session['password']):
|
||||
return redirect(url_for("account.logout"))
|
||||
|
||||
user_id = session['user_id']
|
||||
|
||||
if models.UsersBalance.select().where(models.UsersBalance.user == user_id).count() == 0:
|
||||
models.UsersBalance.create(user=user_id, balance=10)
|
||||
user_balance = models.UsersBalance.select().where(models.UsersBalance.user == user_id).limit(1)[0].balance
|
||||
|
||||
user_details = models.Users.select().where(models.Users.id == session['user_id']).limit(1)[0]
|
||||
|
||||
# выгрузка истории платежей
|
||||
history = dict()
|
||||
history['total'] = models.UsersBalanceTransactions.select().\
|
||||
where(models.UsersBalanceTransactions.user == user_id).count()
|
||||
history['items'] = models.UsersBalanceTransactions.select().\
|
||||
where(models.UsersBalanceTransactions.user == user_id)
|
||||
|
||||
return render_template(
|
||||
'default/id/balance.html',
|
||||
user_details=user_details,
|
||||
user_balance=user_balance,
|
||||
history=history
|
||||
)
|
||||
|
||||
|
||||
@viewAccount.route('/registration', methods=['GET', 'POST'])
|
||||
def registration():
|
||||
# check session
|
||||
|
@ -62,15 +156,21 @@ def registration():
|
|||
# ControllerU
|
||||
# send mail message with recovery code
|
||||
message = u"""
|
||||
Email: %s
|
||||
Password: %s
|
||||
Е-почта: %s
|
||||
Пароль: %s
|
||||
""" % (request.form['email'], request.form['password'])
|
||||
subject = u'Puluttar.ru: Successful registration'
|
||||
lead = u'Congratulations upon successful registration.'
|
||||
callout = u'Use the <a href="http://puluttar.com/account/login">login page</a> to enter your account.'
|
||||
subject = u'GoCloud.ru: Успешная регистрация'
|
||||
lead = u"""
|
||||
Поздравляем с успешной зарегистрацией.
|
||||
"""
|
||||
callout = u"""
|
||||
Для входа в личный кабинет воспользуйтесь
|
||||
<a href="https://gocloud.ru/account/login">страницей авторизации</a>.
|
||||
"""
|
||||
|
||||
email = ControllerMessagesEmail()
|
||||
email.send(title=subject, to=request.form['email'], lead=lead, message=message, callout=callout)
|
||||
|
||||
# redirect to login page
|
||||
return redirect(url_for('account.login'))
|
||||
else:
|
||||
|
@ -130,13 +230,13 @@ def password_reset():
|
|||
ControllerUsersRecoveryCodes().create(user_id, recovery_code)
|
||||
|
||||
# send mail message with recovery code
|
||||
subject = u'Puluttar.com: Access recovery code'
|
||||
message = u'Recovery code: %s' % recovery_code
|
||||
subject = u'GoCloud.ru: Код восстановления доступа'
|
||||
message = u'Код восстановления: %s' % recovery_code
|
||||
lead = u"""
|
||||
This verification code is required to confirm the
|
||||
<a href="http://puluttar.com/account/password_reset_step2">password reset</a>.
|
||||
Данный код необходимо ввести на странице подтверждения
|
||||
<a href="https://gocloud.ru/account/password_reset_step2">сброса пароля</a>.
|
||||
"""
|
||||
callout = u'If you do not want to reset your password, just ignore (or remove) the letter.'
|
||||
callout = u'Если вы не хотите сбрасывать пароль, то просто проигнорируйте (или удалите) данное письмо.'
|
||||
# controllers.Mail().send(request.form['email'], subject, message)
|
||||
|
||||
email = ControllerMessagesEmail()
|
||||
|
@ -145,7 +245,7 @@ def password_reset():
|
|||
# redirect to step 2
|
||||
return redirect(url_for('account.password_reset_step2'))
|
||||
else:
|
||||
g.errors['items'].append(u'An error has occurred. Please enter a valid email address.')
|
||||
g.errors['items'].append(u'Произошла ошибка. Введите корректный адрес е.почты.')
|
||||
g.errors['total'] += 1
|
||||
return render_template('default/id/password_reset_step1.html')
|
||||
|
||||
|
@ -171,16 +271,12 @@ def password_reset_step2():
|
|||
ControllerUsers().update(user_id, password=new_password)
|
||||
|
||||
# send mail message with new password
|
||||
message = u"""New password: %s""" % new_password
|
||||
subject = u"""Puluttar.com: New password"""
|
||||
message = u"""Новый пароль: %s""" % new_password
|
||||
subject = u"""GoCloud.ru: Новый пароль"""
|
||||
lead = u"""
|
||||
<<<<<<< HEAD:app/cloud/views/account/__init__.py
|
||||
Old password for your < href="http://puluttar.com/account/login">account</a> was reset.
|
||||
=======
|
||||
Пароль для доступа в <a href="https://gocloud.ru/account/login">личный кабинет</a> был сброшен.
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/views/account/__init__.py
|
||||
"""
|
||||
callout = u"""Remember the new password and delete this message."""
|
||||
callout = u"""Запомните новый пароль и удалите данное сообщение."""
|
||||
# controllers.Mail().send(request.form['email'], subject, message)
|
||||
|
||||
email = ControllerMessagesEmail()
|
||||
|
@ -189,11 +285,11 @@ def password_reset_step2():
|
|||
# redirect to login page
|
||||
return redirect(url_for('account.login'))
|
||||
# redirect to step 2
|
||||
g.errors['items'].append(u'Wrong recovery code.')
|
||||
g.errors['items'].append(u'Ошибочный код')
|
||||
g.errors['total'] += 1
|
||||
return redirect(url_for('account.password_reset_step2'))
|
||||
else:
|
||||
g.errors['items'].append(u'An error has occurred. Please enter a valid email address.')
|
||||
g.errors['items'].append(u'Произошла ошибка. Введите корректный адрес е.почты.')
|
||||
g.errors['total'] += 1
|
||||
return render_template('default/id/password_reset_step2.html')
|
||||
|
||||
|
@ -221,11 +317,12 @@ def password_update():
|
|||
|
||||
# send mail message with recovery code
|
||||
lead = u"""
|
||||
Password to access your account has been successfully changed.
|
||||
Пароль для достуна в личный кабинет был успешно изменён.
|
||||
"""
|
||||
message = u"""Пароль: %s""" % request.form['new_password']
|
||||
callout = u''
|
||||
subject = u'Puluttar.com: Change Password'
|
||||
callout = u"""
|
||||
"""
|
||||
subject = u'GoCloud.ru: Смена пароля'
|
||||
|
||||
email = ControllerMessagesEmail()
|
||||
email.send(
|
||||
|
@ -255,7 +352,7 @@ def sshkey():
|
|||
try:
|
||||
ssh = SSHKey(request.form['sshkey'])
|
||||
except Exception as e:
|
||||
g.errors['items'].append(u"Incorrect ssh-key.")
|
||||
g.errors['items'].append(u"Не корректный ssh-ключ.")
|
||||
g.errors['total'] += 1
|
||||
else:
|
||||
print(ssh.bits)
|
||||
|
|
|
@ -1,34 +1,11 @@
|
|||
# coding: utf-8
|
||||
|
||||
<<<<<<< HEAD:app/cloud/views/api/__init__.py
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
|
||||
from flask import jsonify
|
||||
from flask import render_template
|
||||
from flask import session
|
||||
from flask import redirect
|
||||
from flask import url_for
|
||||
from flask import request
|
||||
from flask import Blueprint
|
||||
|
||||
from app import models
|
||||
from app.settings import settings
|
||||
from app.cloud.controllers.users import ControllerUsers
|
||||
from app.cloud.controllers.users import ControllerSSHKey
|
||||
from app.cloud.controllers.billing import ControllerBilling
|
||||
from app.cloud.controllers.users import ControllerAPI
|
||||
from app.cloud.controllers.datacenters import ControllerDataCenters
|
||||
from app.cloud.controllers.containers import ControllerContainers
|
||||
=======
|
||||
|
||||
from flask import Blueprint, jsonify, request
|
||||
from SWSCloudCore.controllers.containers import ControllerContainers
|
||||
from SWSCloudCore.controllers.datacenters import ControllerDataCenters
|
||||
from SWSCloudCore.controllers.users import ControllerAPI
|
||||
from SWSCloudCore.controllers.users import ControllerUsers
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/views/api/__init__.py
|
||||
|
||||
viewAPI = Blueprint('api', __name__, url_prefix='/api')
|
||||
|
||||
|
|
|
@ -54,16 +54,8 @@ def create():
|
|||
|
||||
if g.errors['total'] == 0:
|
||||
# select server from selected region with available ip-addresses
|
||||
<<<<<<< HEAD:app/cloud/views/containers/__init__.py
|
||||
# TODO: make function... this part use in API method
|
||||
# select IP
|
||||
select_ip = models.Ips.select().where(
|
||||
models.Ips.datacenter == request.form['datacenter'] and models.Ips.status == 0
|
||||
)[0]
|
||||
=======
|
||||
# select IP
|
||||
select_ip = ControllerIps().getfree(request.form['datacenter'])
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/views/containers/__init__.py
|
||||
# mark ip as busy (taken)
|
||||
ControllerIps().setbusy(select_ip.id)
|
||||
# generate password for container user
|
||||
|
@ -129,9 +121,12 @@ def create():
|
|||
message_parts.append(u"SSH ключ: добавлен")
|
||||
|
||||
message = '<br/>\n'.join(message_parts)
|
||||
subject = u'Puluttar.com: New continer'
|
||||
lead = u"""Congratulations on the new container."""
|
||||
callout = u"""<a href="http://puluttar.com/account/login">Account</a>."""
|
||||
subject = u'GoCloud.ru: Новый контейнер'
|
||||
lead = u"""Поздравляем с новым контейнером."""
|
||||
callout = u"""
|
||||
Для входа в личный кабинет воспользуйтесь
|
||||
<a href="https://gocloud.ru/account/login">страницей авторизации</a>.
|
||||
"""
|
||||
|
||||
user_data = ControllerUsers(session['user_id']).get()
|
||||
|
||||
|
|
|
@ -10,20 +10,9 @@ from flask import render_template
|
|||
from flask import request
|
||||
from flask import session
|
||||
from flask import url_for
|
||||
<<<<<<< HEAD:app/cloud/views/payments/__init__.py
|
||||
from flask import request
|
||||
from flask import Blueprint
|
||||
from app import models
|
||||
from app.cloud.controllers.users import ControllerUsers
|
||||
from app.cloud.controllers.users import ControllerUsersDetails
|
||||
from app.cloud.controllers.payments import ControllerPayments
|
||||
from app.cloud.controllers.payments import ControllerPaymentsRobokassa
|
||||
from app.cloud.controllers.payments import twocheckout
|
||||
=======
|
||||
|
||||
from SWSCloudCore import models
|
||||
from SWSCloudCore.controllers.users import ControllerUsers
|
||||
>>>>>>> bf9e0731bcd036956918559645d2a8cd4a3a2c94:SWSCloudCore/views/payments/__init__.py
|
||||
|
||||
viewPayments = Blueprint('payments', __name__, url_prefix='/payments')
|
||||
|
||||
|
@ -126,61 +115,3 @@ def robokassa(action):
|
|||
|
||||
return redirect(url_for('payments.robokassa', action='fail'))
|
||||
return render_template('default/payment/robokassa/fail.html')
|
||||
|
||||
|
||||
@viewPayments.route('/twocheckout/order', methods=['POST'])
|
||||
def twocheckout_order():
|
||||
# check session
|
||||
if not ControllerUsers().check_session():
|
||||
return redirect(url_for("account.logout"))
|
||||
# auth user
|
||||
if not ControllerUsers().auth(session['email'], session['password']):
|
||||
return redirect(url_for("account.logout"))
|
||||
|
||||
user_account = ControllerUsers(session['user_id']).get()
|
||||
user_details = ControllerUsersDetails(session['user_id']).details_get()
|
||||
|
||||
transaction_id = ControllerPayments().transaction_create(session['user_id'], request.form['amount'], 'process')
|
||||
|
||||
# Setup credentials and environment
|
||||
twocheckout.Api.auth_credentials({
|
||||
# sandbox-private-key
|
||||
'private_key': g.settings['PAY_TWOCHECKOUT_PRIVATEKEY'],
|
||||
# sandbox-seller_id
|
||||
'seller_id': g.settings['PAY_TWOCHECKOUT_SELLER_ID'],
|
||||
'mode': 'sandbox'
|
||||
})
|
||||
|
||||
# Setup arguments for authorization request
|
||||
args = {
|
||||
'merchantOrderId': transaction_id,
|
||||
'token': request.form["token"],
|
||||
'currency': 'USD',
|
||||
'total': request.form['amount'],
|
||||
'billingAddr': {
|
||||
'name': '%s %s' % (user_details.fname, user_details.lname),
|
||||
'addrLine1': user_details.address,
|
||||
'city': user_details.city,
|
||||
'state': user_details.state,
|
||||
'zipCode': str(user_details.zipcode),
|
||||
'country': user_details.country,
|
||||
'email': user_account.email,
|
||||
'phoneNumber': user_details.phone
|
||||
}
|
||||
}
|
||||
|
||||
print args
|
||||
|
||||
# Make authorization request
|
||||
try:
|
||||
result = twocheckout.Charge.authorize(args)
|
||||
ControllerPayments().transaction_set_status(transaction_id, 'success')
|
||||
ControllerPayments().balance_update(transaction_id, request.form['amount'])
|
||||
|
||||
# return result.responseMsg
|
||||
return redirect(url_for('settings.billing'))
|
||||
except twocheckout.TwocheckoutError as error:
|
||||
ControllerPayments().transaction_set_status(transaction_id, 'fail')
|
||||
|
||||
# return error.msg
|
||||
return redirect(url_for('settings.billing'))
|
||||
|
|
|
@ -26,7 +26,7 @@ def index():
|
|||
# send mail message with recovery code
|
||||
subject = ticket_title
|
||||
message = ticket_message
|
||||
lead = u'Sender: %s' % ticket_email
|
||||
lead = u'Отправитель: %s' % ticket_email
|
||||
callout = u''
|
||||
|
||||
email = ControllerMessagesEmail()
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'vanzhiganov'
|
|
@ -1,13 +0,0 @@
|
|||
from sale import Sale
|
||||
from api_request import Api
|
||||
from util import Util
|
||||
from passback import Passback
|
||||
from ins import Notification
|
||||
from product import Product
|
||||
from option import Option
|
||||
from coupon import Coupon
|
||||
from contact import Contact
|
||||
from company import Company
|
||||
from charge import Charge
|
||||
from payment import Payment
|
||||
from error import TwocheckoutError
|
|
@ -1,102 +0,0 @@
|
|||
import urllib
|
||||
import urllib2
|
||||
import json
|
||||
from error import TwocheckoutError
|
||||
|
||||
|
||||
class Api:
|
||||
|
||||
username = None
|
||||
password = None
|
||||
private_key = None
|
||||
seller_id = None
|
||||
mode = None
|
||||
version = '1'
|
||||
|
||||
@classmethod
|
||||
def credentials(cls, credentials):
|
||||
Api.username = credentials['username']
|
||||
Api.password = credentials['password']
|
||||
if 'mode' in credentials:
|
||||
Api.mode = credentials['mode']
|
||||
|
||||
@classmethod
|
||||
def auth_credentials(cls, credentials):
|
||||
Api.private_key = credentials['private_key']
|
||||
Api.seller_id = credentials['seller_id']
|
||||
if 'mode' in credentials:
|
||||
Api.mode = credentials['mode']
|
||||
|
||||
@classmethod
|
||||
def call(cls, method, params=None):
|
||||
data = cls.set_opts(method, params)
|
||||
url = cls.build_url(method)
|
||||
headers = cls.build_headers(method)
|
||||
try:
|
||||
req = urllib2.Request(url, data, headers)
|
||||
result = urllib2.urlopen(req).read()
|
||||
result_safe=None
|
||||
try:
|
||||
result_safe = unicode(result)
|
||||
except UnicodeDecodeError:
|
||||
result_safe = unicode( str(result).decode('utf-8', 'ignore') )
|
||||
return json.loads(result_safe)
|
||||
except urllib2.HTTPError, e:
|
||||
if not hasattr(e, 'read'):
|
||||
raise TwocheckoutError(e.code, e.msg)
|
||||
else:
|
||||
exception = json.loads(e.read())
|
||||
if method == 'authService':
|
||||
raise TwocheckoutError(exception['exception']['errorCode'], exception['exception']['errorMsg'])
|
||||
else:
|
||||
raise TwocheckoutError(exception['errors'][0]['code'], exception['errors'][0]['message'])
|
||||
|
||||
@classmethod
|
||||
def set_opts(cls, method, params=None):
|
||||
if method == 'authService':
|
||||
params['sellerId'] = cls.seller_id
|
||||
params['privateKey'] = cls.private_key
|
||||
data = json.dumps(params)
|
||||
else:
|
||||
username = cls.username
|
||||
password = cls.password
|
||||
if cls.mode == 'sandbox':
|
||||
passwd_url = 'https://sandbox.2checkout.com'
|
||||
else:
|
||||
passwd_url = 'https://www.2checkout.com'
|
||||
data = urllib.urlencode(params)
|
||||
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
|
||||
password_manager.add_password(
|
||||
None, passwd_url, username, password
|
||||
)
|
||||
auth_handler = urllib2.HTTPBasicAuthHandler(password_manager)
|
||||
opener = urllib2.build_opener(auth_handler)
|
||||
urllib2.install_opener(opener)
|
||||
return data
|
||||
|
||||
@classmethod
|
||||
def build_headers(cls, method):
|
||||
if method == 'authService':
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'User-Agent': '2Checkout Python/0.1.0/%s',
|
||||
'Content-Type': 'application/JSON'
|
||||
}
|
||||
else:
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'User-Agent': '2Checkout Python/0.1.0/%s'
|
||||
}
|
||||
return headers
|
||||
|
||||
@classmethod
|
||||
def build_url(cls, method):
|
||||
if cls.mode == 'sandbox':
|
||||
url = 'https://sandbox.2checkout.com'
|
||||
else:
|
||||
url = 'https://www.2checkout.com'
|
||||
if method == 'authService':
|
||||
url += '/checkout/api/' + cls.version + '/' + cls.seller_id + '/rs/' + method
|
||||
else:
|
||||
url += '/api/' + method
|
||||
return url
|
|
@ -1,61 +0,0 @@
|
|||
import urllib
|
||||
from api_request import Api
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
|
||||
class Charge(Twocheckout):
|
||||
|
||||
checkout_url = "https://www.2checkout.com/checkout/purchase"
|
||||
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def mode(cls, mode):
|
||||
if mode == 'sandbox':
|
||||
Charge.checkout_url = 'https://sandbox.2checkout.com/checkout/purchase'
|
||||
else:
|
||||
Charge.checkout_url = 'https://www.2checkout.com/checkout/purchase'
|
||||
|
||||
@classmethod
|
||||
def form(cls, params=None, text='Proceed to Checkout'):
|
||||
if params is None:
|
||||
params = dict()
|
||||
form = "<form id=\"2checkout\" action=\"" + Charge.checkout_url + "\" method=\"post\">"
|
||||
for param in params:
|
||||
form = form + "<input type=\"hidden\" name=\"" + param + "\" value=\"" + str(params[param]) + "\" />"
|
||||
return form + "<input type=\"submit\" value=\"" + text + "\" /></form>"
|
||||
|
||||
@classmethod
|
||||
def submit(cls, params=None, text='Proceed to Checkout'):
|
||||
if params is None:
|
||||
params = dict()
|
||||
form = "<form id=\"2checkout\" action=\"" + Charge.checkout_url + "\" method=\"post\">"
|
||||
for param in params:
|
||||
form = form + "<input type=\"hidden\" name=\"" + param + "\" value=\"" + str(params[param]) + "\" />"
|
||||
return form + "<input type=\"submit\" value=\"" + text + "\" /></form>" + \
|
||||
"<script type=\"text/javascript\">document.getElementById(\"2checkout\").submit();</script>"
|
||||
|
||||
@classmethod
|
||||
def direct(cls, params=None, text='Proceed to Checkout'):
|
||||
if params is None:
|
||||
params = dict()
|
||||
form = "<form id=\"2checkout\" action=\"" + Charge.checkout_url + "\" method=\"post\">"
|
||||
for param in params:
|
||||
form = form + "<input type=\"hidden\" name=\"" + param + "\" value=\"" + str(params[param]) + "\" />"
|
||||
return form + "<input type=\"submit\" value=\"" + text + "\" /></form>" + \
|
||||
"<script src=\"https://www.2checkout.com/static/checkout/javascript/direct.min.js\"></script>"
|
||||
|
||||
@classmethod
|
||||
def link(cls, params=None):
|
||||
url = Charge.checkout_url + '?'
|
||||
if params is None:
|
||||
params = dict()
|
||||
param = urllib.urlencode(params)
|
||||
url = url.endswith('?') and (url + param)
|
||||
return url
|
||||
|
||||
@classmethod
|
||||
def authorize(cls, params=None):
|
||||
response = Charge(Api.call('authService', params))
|
||||
return response.response
|
|
@ -1,16 +0,0 @@
|
|||
from api_request import Api
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
|
||||
class Company(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def retrieve(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
url = 'acct/detail_company_info'
|
||||
response = cls(Api.call(url, params))
|
||||
return response.vendor_company_info
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
from api_request import Api
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
|
||||
class Contact(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def retrieve(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
url = 'acct/detail_contact_info'
|
||||
response = cls(Api.call(url, params))
|
||||
return response.vendor_contact_info
|
|
@ -1,40 +0,0 @@
|
|||
from api_request import Api
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
|
||||
class Coupon(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def create(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
return cls(Api.call('products/create_coupon', params))
|
||||
|
||||
@classmethod
|
||||
def find(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
result = cls(Api.call('products/detail_coupon', params))
|
||||
return result.coupon
|
||||
|
||||
@classmethod
|
||||
def list(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
return cls(Api.call('products/list_coupons', params))
|
||||
|
||||
def update(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
params['coupon_code'] = self.coupon_code
|
||||
Api.call('products/update_coupon', params)
|
||||
coupon = Coupon(Api.call('products/detail_coupon', params))
|
||||
return coupon.coupon
|
||||
|
||||
def delete(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
params['coupon_code'] = self.coupon_code
|
||||
return Coupon(Api.call('products/delete_coupon', params))
|
|
@ -1,8 +0,0 @@
|
|||
class TwocheckoutError(Exception):
|
||||
def __init__(self, code=None, msg=None, product_id=None, option_id=None, coupon_code=None):
|
||||
super(TwocheckoutError, self).__init__(msg)
|
||||
self.code = code
|
||||
self.msg = msg
|
||||
self.product_id = product_id
|
||||
self.option_id = option_id
|
||||
self.coupon_code = coupon_code
|
|
@ -1,40 +0,0 @@
|
|||
import hashlib
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
class Notification(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def check_hash(cls, params=None):
|
||||
m = hashlib.md5()
|
||||
m.update(params['sale_id'])
|
||||
m.update(params['vendor_id'])
|
||||
m.update(params['invoice_id'])
|
||||
m.update(params['secret'])
|
||||
check_hash = m.hexdigest()
|
||||
check_hash = check_hash.upper()
|
||||
if check_hash == params['md5_hash']:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def check(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
if 'sale_id' in params and 'invoice_id' in params:
|
||||
check = Notification.check_hash(params)
|
||||
if check:
|
||||
response = { "response_code": "SUCCESS",
|
||||
"response_message": "Hash Matched"
|
||||
}
|
||||
else:
|
||||
response = { "response_code": "FAILED",
|
||||
"response_message": "Hash Mismatch"
|
||||
}
|
||||
else:
|
||||
response = { "response_code": "ERROR",
|
||||
"response_message": "You must pass sale_id, vendor_id, invoice_id, secret word."
|
||||
}
|
||||
return cls(response)
|
|
@ -1,41 +0,0 @@
|
|||
from api_request import Api
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
|
||||
class Option(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def create(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
return cls(Api.call('products/create_option', params))
|
||||
|
||||
@classmethod
|
||||
def find(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
option = cls(Api.call('products/detail_option', params))
|
||||
return option.option[0]
|
||||
|
||||
@classmethod
|
||||
def list(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
list = cls(Api.call('products/list_options', params))
|
||||
return list.options
|
||||
|
||||
def update(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
params['option_id'] = self.option_id
|
||||
Api.call('products/update_option', params)
|
||||
option = Option(Api.call('products/detail_option', params))
|
||||
return option.option[0]
|
||||
|
||||
def delete(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
params['option_id'] = self.option_id
|
||||
return Option(Api.call('products/delete_option', params))
|
|
@ -1,40 +0,0 @@
|
|||
import hashlib
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
class Passback(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def check_hash(cls, params=None):
|
||||
m = hashlib.md5()
|
||||
m.update(params['secret'])
|
||||
m.update(params['sid'])
|
||||
m.update(params['order_number'])
|
||||
m.update(params['total'])
|
||||
check_hash = m.hexdigest()
|
||||
check_hash = check_hash.upper()
|
||||
if check_hash == params['key']:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def check(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
if 'order_number' in params and 'total' in params:
|
||||
check = Passback.check_hash(params)
|
||||
if check:
|
||||
response = { "response_code": "SUCCESS",
|
||||
"response_message":"Hash Matched"
|
||||
}
|
||||
else:
|
||||
response = { "response_code": "FAILED",
|
||||
"response_message": "Hash Mismatch"
|
||||
}
|
||||
else:
|
||||
return { "response_code": "ERROR",
|
||||
"response_message": "You must pass secret word, sid, order_number, total"
|
||||
}
|
||||
return cls(response)
|
|
@ -1,23 +0,0 @@
|
|||
from .api_request import Api
|
||||
from .twocheckout import Twocheckout
|
||||
|
||||
|
||||
class Payment(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def pending(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
url = 'acct/detail_pending_payment'
|
||||
response = cls(Api.call(url, params))
|
||||
return response.payment
|
||||
|
||||
@classmethod
|
||||
def list(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
url = 'acct/list_payments'
|
||||
response = cls(Api.call(url, params))
|
||||
return response.payments
|
|
@ -1,41 +0,0 @@
|
|||
from api_request import Api
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
|
||||
class Product(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def create(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
return cls(Api.call('products/create_product', params))
|
||||
|
||||
@classmethod
|
||||
def find(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
result = cls(Api.call('products/detail_product', params))
|
||||
return result.product
|
||||
|
||||
@classmethod
|
||||
def list(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
result = cls(Api.call('products/list_products', params))
|
||||
return result.products
|
||||
|
||||
def update(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
params['product_id'] = self.product_id
|
||||
Api.call('products/update_product', params)
|
||||
product = Product(Api.call('products/detail_product', params))
|
||||
return product.product
|
||||
|
||||
def delete(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
params['product_id'] = self.product_id
|
||||
return Product(Api.call('products/delete_product', params))
|
|
@ -1,102 +0,0 @@
|
|||
from api_request import Api
|
||||
from util import Util
|
||||
from twocheckout import Twocheckout
|
||||
|
||||
|
||||
class Sale(Twocheckout):
|
||||
def __init__(self, dict_):
|
||||
super(self.__class__, self).__init__(dict_)
|
||||
|
||||
@classmethod
|
||||
def find(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
response = cls(Api.call('sales/detail_sale', params))
|
||||
return response.sale
|
||||
|
||||
@classmethod
|
||||
def list(cls, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
response = cls(Api.call('sales/list_sales', params))
|
||||
return response.sale_summary
|
||||
|
||||
def refund(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
if hasattr(self, 'lineitem_id'):
|
||||
params['lineitem_id'] = self.lineitem_id
|
||||
url = 'sales/refund_lineitem'
|
||||
elif hasattr(self, 'invoice_id'):
|
||||
params['invoice_id'] = self.invoice_id
|
||||
url = 'sales/refund_invoice'
|
||||
else:
|
||||
params['sale_id'] = self.sale_id
|
||||
url = 'sales/refund_invoice'
|
||||
return Sale(Api.call(url, params))
|
||||
|
||||
def stop(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
if hasattr(self, 'lineitem_id'):
|
||||
params['lineitem_id'] = self.lineitem_id
|
||||
return Api.call('sales/stop_lineitem_recurring', params)
|
||||
elif hasattr(self, 'sale_id'):
|
||||
active_lineitems = Util.active(self)
|
||||
if dict(active_lineitems):
|
||||
result = dict()
|
||||
i = 0
|
||||
for k, v in active_lineitems.items():
|
||||
lineitem_id = v
|
||||
params = {'lineitem_id': lineitem_id}
|
||||
result[i] = Api.call('sales/stop_lineitem_recurring', params)
|
||||
i += 1
|
||||
response = { "response_code": "OK",
|
||||
"response_message": str(len(result)) + " lineitems stopped successfully"
|
||||
}
|
||||
else:
|
||||
response = {
|
||||
"response_code": "NOTICE",
|
||||
"response_message": "No active recurring lineitems"
|
||||
}
|
||||
else:
|
||||
response = { "response_code": "NOTICE",
|
||||
"response_message": "This method can only be called on a sale or lineitem"
|
||||
}
|
||||
return Sale(response)
|
||||
|
||||
def active(self):
|
||||
active_lineitems = Util.active(self)
|
||||
if dict(active_lineitems):
|
||||
result = dict()
|
||||
i = 0
|
||||
for k, v in active_lineitems.items():
|
||||
lineitem_id = v
|
||||
result[i] = lineitem_id
|
||||
i += 1
|
||||
response = { "response_code": "ACTIVE",
|
||||
"response_message": str(len(result)) + " active recurring lineitems"
|
||||
}
|
||||
else:
|
||||
response = {
|
||||
"response_code": "NOTICE","response_message":
|
||||
"No active recurring lineitems"
|
||||
}
|
||||
return Sale(response)
|
||||
|
||||
def comment(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
params['sale_id'] = self.sale_id
|
||||
return Sale(Api.call('sales/create_comment', params))
|
||||
|
||||
def ship(self, params=None):
|
||||
if params is None:
|
||||
params = dict()
|
||||
params['sale_id'] = self.sale_id
|
||||
return Sale(Api.call('sales/mark_shipped', params))
|
||||
|
||||
def reauth(self):
|
||||
params = dict()
|
||||
params['sale_id'] = self.sale_id
|
||||
return Sale(Api.call('sales/reauth', params))
|
|
@ -1,14 +0,0 @@
|
|||
class Twocheckout(dict):
|
||||
def __init__(self, dict_):
|
||||
super(Twocheckout, self).__init__(dict_)
|
||||
for key in self:
|
||||
item = self[key]
|
||||
if isinstance(item, list):
|
||||
for id, it in enumerate(item):
|
||||
if isinstance(it, dict):
|
||||
item[id] = self.__class__(it)
|
||||
elif isinstance(item, dict):
|
||||
self[key] = self.__class__(item)
|
||||
|
||||
def __getattr__(self, key):
|
||||
return self[key]
|
|
@ -1,21 +0,0 @@
|
|||
class Util:
|
||||
|
||||
@classmethod
|
||||
def active(cls, sale):
|
||||
i = 0
|
||||
if hasattr(sale, 'recurring'):
|
||||
invoice = sale
|
||||
else:
|
||||
invoices = dict()
|
||||
sale = sale.invoices
|
||||
for invoice in sale:
|
||||
invoices[i] = invoice
|
||||
i += 1
|
||||
invoice = max(invoices.values())
|
||||
i = 0
|
||||
lineitems = dict()
|
||||
for lineitem_id in invoice.lineitems:
|
||||
if lineitem_id.billing.recurring_status == 'active':
|
||||
lineitems[i] = lineitem_id['lineitem_id']
|
||||
i += 1
|
||||
return lineitems
|
|
@ -1,137 +0,0 @@
|
|||
# coding: utf-8
|
||||
|
||||
from sshpubkeys import SSHKey
|
||||
from flask import render_template, session, redirect, url_for, request
|
||||
from flask import g
|
||||
from flask import Blueprint
|
||||
from app import models
|
||||
from app.cloud.controllers.common import special_match
|
||||
from app.cloud.controllers.common import ControllerMessagesEmail
|
||||
from app.cloud.controllers.users import ControllerUsers
|
||||
from app.cloud.controllers.users import ControllerAPI
|
||||
from app.cloud.controllers.users import ControllerSSHKey
|
||||
from app.cloud.controllers.users import ControllerUsersDetails
|
||||
from app.cloud.controllers.users import ControllerUsersRecoveryCodes
|
||||
from app.cloud.controllers.billing import ControllerBilling
|
||||
|
||||
viewSettings = Blueprint('settings', __name__, url_prefix='/settings')
|
||||
|
||||
|
||||
@viewSettings.route('/', methods=['GET', 'POST'])
|
||||
def index():
|
||||
return redirect(url_for('settings.billing'))
|
||||
|
||||
|
||||
@viewSettings.route('/billing')
|
||||
def billing():
|
||||
# check session
|
||||
if not ControllerUsers().check_session():
|
||||
return redirect(url_for("account.logout"))
|
||||
# auth user
|
||||
if not ControllerUsers().auth(session['email'], session['password']):
|
||||
return redirect(url_for("account.logout"))
|
||||
|
||||
user_id = session['user_id']
|
||||
|
||||
if models.UsersBalance.select().where(models.UsersBalance.user == user_id).count() == 0:
|
||||
models.UsersBalance.create(user=user_id, balance=10)
|
||||
user_balance = models.UsersBalance.select().where(models.UsersBalance.user == user_id).limit(1)[0].balance
|
||||
|
||||
user_details = models.Users.select().where(models.Users.id == session['user_id']).limit(1)[0]
|
||||
|
||||
# выгрузка истории платежей
|
||||
history = dict()
|
||||
history['total'] = models.UsersBalanceTransactions.select().\
|
||||
where(models.UsersBalanceTransactions.user == user_id).count()
|
||||
history['items'] = models.UsersBalanceTransactions.select().\
|
||||
where(models.UsersBalanceTransactions.user == user_id).order_by(models.UsersBalanceTransactions.id.desc())
|
||||
|
||||
return render_template(
|
||||
'default/settings/billing/index.html',
|
||||
user_details=user_details,
|
||||
user_balance=user_balance,
|
||||
history=history
|
||||
)
|
||||
|
||||
|
||||
@viewSettings.route('/profile')
|
||||
def profile():
|
||||
# check session
|
||||
if not ControllerUsers().check_session():
|
||||
return redirect(url_for("account.logout"))
|
||||
# auth user
|
||||
if not ControllerUsers().auth(session['email'], session['password']):
|
||||
return redirect(url_for("account.logout"))
|
||||
|
||||
cud = ControllerUsersDetails(session['user_id'])
|
||||
user = cud.details_get()
|
||||
|
||||
# проверяем, есть ли запись в таблице usersdetails, чтобы небыло ошибок
|
||||
if not cud.details_exists():
|
||||
# если нет, то делаем запись в таблицу, чтобы небыло ошибок
|
||||
cud.details_create()
|
||||
|
||||
# извлекаем из базы детали пользователя
|
||||
user_details = cud.details_get()
|
||||
|
||||
return render_template(
|
||||
'default/settings/profile/index.html',
|
||||
user=user,
|
||||
user_details=user_details
|
||||
)
|
||||
|
||||
|
||||
@viewSettings.route('/profile_edit', methods=['GET', 'POST'])
|
||||
def profile_edit():
|
||||
# check session
|
||||
if not ControllerUsers().check_session():
|
||||
return redirect(url_for("account.logout"))
|
||||
# auth user
|
||||
if not ControllerUsers().auth(session['email'], session['password']):
|
||||
return redirect(url_for("account.logout"))
|
||||
|
||||
cud = ControllerUsersDetails(session['user_id'])
|
||||
user = cud.details_get()
|
||||
|
||||
if not cud.details_exists():
|
||||
cud.details_create()
|
||||
|
||||
if request.method == "POST":
|
||||
if not request.form['zipcode'].isdigit():
|
||||
g.errors['items'].append(u'ZIP code must contain only digits.')
|
||||
g.errors['total'] += 1
|
||||
|
||||
if g.errors['total'] == 0:
|
||||
cud.details_update(
|
||||
fname=request.form['fname'],
|
||||
lname=request.form['lname'],
|
||||
address=request.form['address'],
|
||||
city=request.form['city'],
|
||||
country=request.form['country'],
|
||||
state=request.form['state'],
|
||||
phone=request.form['phone'],
|
||||
zipcode=request.form['zipcode']
|
||||
)
|
||||
return redirect(url_for('settings.profile_edit'))
|
||||
# get user details
|
||||
user_details = cud.details_get()
|
||||
return render_template(
|
||||
'default/settings/profile/edit.html',
|
||||
user=user,
|
||||
user_details=user_details
|
||||
)
|
||||
|
||||
|
||||
@viewSettings.route('/security')
|
||||
def security():
|
||||
return render_template('default/settings/security/index.html')
|
||||
|
||||
|
||||
@viewSettings.route('/notifications')
|
||||
def notifications():
|
||||
return render_template('default/settings/security/index.html')
|
||||
|
||||
|
||||
@viewSettings.route('/team')
|
||||
def team():
|
||||
return render_template('default/settings/team/index.html')
|
|
@ -1 +0,0 @@
|
|||
__author__ = 'vanzhiganov'
|
|
@ -1,86 +0,0 @@
|
|||
@import "/static/css/fonts/clearsans.css";
|
||||
|
||||
body {
|
||||
font-family: 'Clear sans';
|
||||
}
|
||||
|
||||
header {
|
||||
background: #333 none repeat scroll 0% 0%;
|
||||
}
|
||||
#banner {
|
||||
overflov: hidden;
|
||||
padding: 4em 0em 5em;
|
||||
background: #202020 none repeat scroll 0% 0% / cover;
|
||||
background-position:
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
background: transparent url(/static/images/promo/bg2.png) repeat-x scroll 0% 0%;
|
||||
}
|
||||
|
||||
#banner p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#banner #slogan {
|
||||
opacity: 0.8;
|
||||
font-family: 'Clear sans';
|
||||
font-size: 36px;
|
||||
color: #FFF;
|
||||
font-weight: 200;
|
||||
}
|
||||
#banner #sub {
|
||||
opacity: 0.5;
|
||||
font-family: 'Clear sans';
|
||||
font-size: 24px;
|
||||
color: #FFF;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
#banner {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
|
||||
footer {
|
||||
border-top: 1px solid #999;
|
||||
}
|
||||
footer .row {
|
||||
margin-top: 25px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.price {
|
||||
text-align: right;
|
||||
}
|
||||
.price span {
|
||||
color: red; font-weight: bolder;
|
||||
}
|
||||
|
||||
|
||||
ul#paymentlist {
|
||||
list-style: none;
|
||||
background: #000;
|
||||
}
|
||||
ul#paymentlist li {
|
||||
float: left;
|
||||
margin-left: 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
ul#paymentlist li img {
|
||||
height: 38px;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
ul#features-list {
|
||||
/* list-style: none; */
|
||||
font-size: 1.5em;
|
||||
}
|
||||
ul#features-list li {
|
||||
font-family: 'Clear sans';
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
# tabs
|
||||
|
||||
div .tabs-content {
|
||||
border: 2px solid #cccccc;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 60 KiB |
Binary file not shown.
Before Width: | Height: | Size: 103 KiB |
Binary file not shown.
Before Width: | Height: | Size: 278 KiB |
|
@ -1,38 +0,0 @@
|
|||
{% extends 'administrator/_layout.auth.html' %}
|
||||
|
||||
{% block title %}Settings{% endblock %}
|
||||
|
||||
{% block subtitle %}Payments{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if settings.total == 0 %}
|
||||
<tr>
|
||||
<td colspan="4">Нет ни одного параметра.</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
{% for setting in settings['items'] %}
|
||||
<tr>
|
||||
<td>{{ setting.id }}</td>
|
||||
<td>{{ setting.key }}</td>
|
||||
<td>{{ setting.val }}</td>
|
||||
<td>
|
||||
[<a href="{{ url_for('administrator.settings_update', id=setting.id) }}">Edit</a>]
|
||||
[<a href="{{ url_for('administrator.settings_delete', id=setting.id) }}">Delete</a>]
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{{ url_for('administrator.settings_create') }}" class="btn btn-success">Create new</a>
|
||||
{% endblock %}
|
|
@ -1,20 +0,0 @@
|
|||
<footer>
|
||||
<div class="row">
|
||||
<div class="large-4 columns">
|
||||
<p>
|
||||
{{ _("Puluttar © All rights reserved.") }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="large-8 columns">
|
||||
<ul class="inline-list">
|
||||
<li><a href="{{ url_for('documents.view', document_name='politica_konfidencialnosti') }}">{{ _("Privacy policy") }}</a></li>
|
||||
<li><a href="{{ url_for('documents.view', document_name='pravila_ispolzovaniya') }}">{{ _("Terms of Use") }}</a></li>
|
||||
<li><a href="{{ url_for('support.index') }}">{{ _("Support") }}</a></li>
|
||||
<!-- li><a href="{{ url_for('kb.index') }}">{{ _("Knowledge base") }}</a></li -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
{% if g.settings['footer_code'] %}
|
||||
{{ g.settings['footer_code']|safe }}
|
||||
{% endif %}
|
|
@ -1,49 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}New container{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>New container</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div class="alert-box alert">
|
||||
<ul>
|
||||
{% for error in g.errors['items'] %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if datacenters['total'] == 0 %}
|
||||
<div class="row">
|
||||
<div class="small-12 columns">
|
||||
Нет возможности создать контейнер. Обратитесь в <a href="mailto:support@gocloud.ru">поддержку</a>.
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row">
|
||||
<form action="{{ url_for('containers.create') }}" method="post" id="containercreateform">
|
||||
<div class="small-12 columns">
|
||||
<label for="backend">
|
||||
Datacenter
|
||||
<select name="datacenter" class="form">
|
||||
{% for datacenter in datacenters['items'] %}
|
||||
<option value="{{ datacenter.id }}">{{ datacenter.name }}: {{ datacenter.country }}, {{ datacenter.city }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div class="small-12 columns">
|
||||
<input type="submit" value="Create" class="button success" id="submitform" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,31 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Removing container{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>Removing container</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div class="alert-box alert">
|
||||
<ul>
|
||||
{% for error in g.errors['items'] %}<li>{{ error }}</li>{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
<form action="{{ url_for('containers.delete', container_id=container.id) }}" method="post">
|
||||
<input type="hidden" name="id" value="{{ container.id }}" />
|
||||
<p>
|
||||
Do you really want to remove container?<br/>
|
||||
</p>
|
||||
<input type="submit" value="Yes, I want!" class="button alert" />
|
||||
<a href="{{ url_for('containers.index') }}" class="">Cancel</a>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,71 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Containers{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>Containers <a href="{{ url_for('containers.create') }}">+</a></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<table id="zones" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="45%">ID</th>
|
||||
<th>IP</th>
|
||||
<th>Storage</th>
|
||||
<th>Status</th>
|
||||
<th width="10%"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if containers.total == 0 %}
|
||||
<tr>
|
||||
<td>No containers. <a href="{{ url_for('containers.create') }}">Create one</a>.</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
{% for container in containers['items'] %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ container['id'] }}
|
||||
</td>
|
||||
<td>
|
||||
{% if container['ipv4'] %}
|
||||
IPv4: {{ container['ipv4'] }}
|
||||
{% endif %}
|
||||
{% if container['ipv6'] %}
|
||||
IPv6: {{ container['ipv6'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% set size_gb = (container.size / 1024 / 1024) %}
|
||||
{{ '%0.2f' | format(size_gb|float) }}GB
|
||||
</td>
|
||||
<td>
|
||||
{% if container['status'] == 0 %}
|
||||
Inactive
|
||||
{% elif container['status'] == 1 %}
|
||||
Active
|
||||
{% elif container['status'] == 2 %}
|
||||
Activating
|
||||
{% elif container['status'] == 3 %}
|
||||
Deactivating
|
||||
{% elif container['status'] == 4 %}
|
||||
Creating...
|
||||
{% elif container['status'] == 5 %}
|
||||
Removing...
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('containers.settings', container_id=container.id) }}">Settings</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,45 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Settings{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>Settings</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div class="large-12 columns">
|
||||
{% for error in g.errors['items'] %}
|
||||
<div class="alert-box alert">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="large-12 columns">
|
||||
<h4>Status</h4>
|
||||
{% if container.status == 0 %}
|
||||
<p style="color: red">Inactive</p>
|
||||
{% else %}
|
||||
<p style="color: green">Active</p>
|
||||
{% endif %}
|
||||
<form action="{{ url_for('containers.settings', container_id=container.id) }}" method="post">
|
||||
<input type="hidden" name="action" value="set_status">
|
||||
<div class="input-group">
|
||||
<select name="status">
|
||||
<option value="active">Active</option>
|
||||
<option value="inactive">Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="submit" value="Change status" class="button success small">
|
||||
</form>
|
||||
<h4>Remove</h4>
|
||||
<a href="{{ url_for('containers.delete', container_id=container.id) }}">
|
||||
<button class="button alert">Remove</button>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Documents{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
{% filter markdown %}{{ doc_markdown }}{% endfilter %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
{% block title %}Access denied{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h1>Access denied</h1>
|
||||
<p>View page is forbidden.</p>
|
||||
<p><a href="{{ url_for('homepage.index') }}">Go to Home page</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
{% block title %}{{ _('Forbidden') }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h1>{{ _('Forbidden') }}</h1>
|
||||
<p>Указанная страница закрыта для общего доступа.</p>
|
||||
<p><a href="{{ url_for('homepage.index') }}">Перейти на главную</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
{% block title %}Страница не найдена{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h1>Страница не найдена</h1>
|
||||
<p>Указанная страница не найдена. Возможно она была удалена или перенесена.</p>
|
||||
<p><a href="{{ url_for('homepage.index') }}">Перейти на главную</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404</h1>
|
||||
</body>
|
||||
</html>
|
|
@ -1,19 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title>Ошибка 500</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>500</h1>
|
||||
<p>Что-то пошло не так. Страница будет перезагружена через <span>5</span> секунд.</p>
|
||||
|
||||
<script>
|
||||
// Your application has indicated there's an error
|
||||
window.setTimeout(function(){
|
||||
// Move to a new location or you can do something else
|
||||
window.location.href = "{{ request.url }}";
|
||||
}, 5000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,67 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Puluttar{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="banner">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div>
|
||||
<p id="slogan">{{ _("Cloud hosting for developers") }}</p>
|
||||
<p id="sub">{{ _("Linux containers from $3.50 per month") }}</p>
|
||||
<p>
|
||||
<a href="{{ url_for('account.registration') }}" class="button alert">{{ _("Create container") }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-8 columns">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>Features</h2>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
<ul id="features-list">
|
||||
<li>Auto scaling LXC containers with Ubuntu Linux</li>
|
||||
<li>Pay only for the resources used</li>
|
||||
<li>Ready to deploy with one minute</li>
|
||||
<li>Public IP address</li>
|
||||
<li>Unlimited network traffic with firewall</li>
|
||||
<li>Several data centers around the world</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-4 columns">
|
||||
<ul class="pricing-table">
|
||||
<li class="title">Standard</li>
|
||||
<li class="price">from $3.50/mo</li>
|
||||
<li class="description">Auto scaling LXC container</li>
|
||||
<li class="bullet-item">5GB Storage</li>
|
||||
<li class="bullet-item">512MB Memory</li>
|
||||
<li class="bullet-item">Unlimited bandwidth</li>
|
||||
<li class="cta-button"><a class="button" href="#">Get started</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- div class="large-4 columns">
|
||||
<a class="twitter-timeline" href="https://twitter.com/gocloud_ru" data-widget-id="678726736645922816">Tweets by @gocloud_ru</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
||||
</div- -->
|
||||
</div>
|
||||
<!-- div class="row" data-equalizer>
|
||||
<div class="large-3 columns panel" data-equalizer-watch style="background-color: #cc0000; color: #ffffff">
|
||||
Advertious.com
|
||||
</div>
|
||||
<div class="large-3 columns panel" data-equalizer-watch style="background-color: #563D7D; color: #ffffff">
|
||||
NotePlex.net
|
||||
</div>
|
||||
<div class="large-3 columns panel" data-equalizer-watch>
|
||||
wefewf
|
||||
</div>
|
||||
<div class="large-3 columns panel" data-equalizer-watch>
|
||||
gergr
|
||||
</div>
|
||||
</div -->
|
||||
{% endblock %}
|
|
@ -1,41 +0,0 @@
|
|||
{% extends "default/_layout.en.html" %}
|
||||
|
||||
{% block title %}Registration{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<h2>Registration</h2>
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div id='errors'>
|
||||
<ul>
|
||||
{% for error in g.errors['items'] %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<form action="{{ url_for('account.registration') }}" method="post">
|
||||
<input type="hidden" name="method" value="member_add" />
|
||||
<label for="email">
|
||||
E-mail address
|
||||
<input type="text" name="email" value="" class="email" id="email" />
|
||||
</label>
|
||||
<label for="password">
|
||||
Password
|
||||
<input type="password" name="password" value="" id="password" />
|
||||
</label>
|
||||
<label for="password2">
|
||||
Password (retry)
|
||||
<input type="password" name="password2" value="" id="password2" />
|
||||
</label>
|
||||
{# <input type="checkbox" name="agree1" value="1" /> I agree <a href="">″Terms of Service″</a><br/>#}
|
||||
{# <input type="checkbox" name="agree2" value="1" /> I agree <a href="">″Privacy Policy″</a><br/>#}
|
||||
<input type="submit" value="Register" class="button success" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="large-6">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Knowledge base{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
{% filter markdown %}{{ kb_markdown }}{% endfilter %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}База знаний{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
{% filter markdown %}{{ kb_markdown }}{% endfilter %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,8 +0,0 @@
|
|||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<h1>Success</h1>
|
||||
<p>Balance successfully refilled.</p>
|
||||
<p><a href='{{ url_for("account.billing") }}'>Account</a></p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +0,0 @@
|
|||
<table class="table table-bordered" width="100%">
|
||||
<tr><td><a href="{{ url_for('settings.billing') }}">Billing</a></td></tr>
|
||||
<tr><td><a href="{{ url_for('settings.profile') }}">Profile</a></td></tr>
|
||||
{# <tr><td><a href="{{ url_for('settings.team') }}">Team</a></td></tr> #}
|
||||
{# <tr><td><a href="{{ url_for('settings.security') }}">Security</a></td></tr> #}
|
||||
{# <tr><td><a href="{{ url_for('settings.notifications') }}">Notifications</a></td></tr> #}
|
||||
</table>
|
|
@ -1,63 +0,0 @@
|
|||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<form id="myCCForm" action="{{ url_for('payments.twocheckout_order') }}" method="post">
|
||||
<input id="token" name="token" type="hidden" value="">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h4>{{ _("Credit Cards") }}</h4>
|
||||
<p>{# Card will be charged monthly for resources used. #}All major credit cards accepted.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<label for="ccNo">{{ _("Card Number") }}</label>
|
||||
<input id="ccNo" name="ccNo" type="text" size="20" value="" autocomplete="off" required />
|
||||
</div>
|
||||
<div class="large-3 columns">
|
||||
<label for="expMonth">Expiration month</label>
|
||||
<select id="expMonth" name="expMonth" required>
|
||||
<option value="01">01</option>
|
||||
<option value="02">02</option>
|
||||
<option value="03">03</option>
|
||||
<option value="04">04</option>
|
||||
<option value="05">05</option>
|
||||
<option value="06">06</option>
|
||||
<option value="07">07</option>
|
||||
<option value="08">08</option>
|
||||
<option value="09">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="large-3 columns">
|
||||
<label for="expYear">Expiration year</label>
|
||||
<select name="expYear" id="expYear" required >
|
||||
<option value="2016">2016</option>
|
||||
<option value="2017">2017</option>
|
||||
<option value="2018">2018</option>
|
||||
<option value="2019">2019</option>
|
||||
<option value="2020">2020</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="large-3 columns">
|
||||
<label for="cvv">CVV</label>
|
||||
<input id="cvv" name="cvv" size="4" type="text" value="" autocomplete="off" required />
|
||||
</div>
|
||||
<div class="large-3 columns">
|
||||
<label for="amount">Amount</label>
|
||||
<select id="amount" name="amount">
|
||||
<option value="5">$5</option>
|
||||
<option value="10">$10</option>
|
||||
<option value="25">$25</option>
|
||||
<option value="50">$50</option>
|
||||
<option value="100">$100</option>
|
||||
<option value="500">$500</option>
|
||||
<option value="1000">$1000</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" value="Submit Payment" class="button success" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
|
@ -1,19 +0,0 @@
|
|||
<div class="row">
|
||||
<form action="{{ url_for('payments.robokassa', action='process') }}" method="post">
|
||||
<div class="large-6 columns">
|
||||
<h4>PayPal Payment</h4>
|
||||
<p>This is a one-time payment that will not recur. Payment may take up to 5 minutes to process.</p>
|
||||
</div>
|
||||
<div class="large-3 columns">
|
||||
<select name="amount">
|
||||
<option value="500">500 рублей</option>
|
||||
<option value="1000">1000 рублей</option>
|
||||
<option value="2000">2000 рублей</option>
|
||||
<option value="5000">5000 рублей</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="large-3 columns">
|
||||
<input type="submit" value="Оплатить" class="button postfix" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
|
@ -1,17 +0,0 @@
|
|||
<form action="{{ url_for('payments.robokassa', action='process') }}" method="post">
|
||||
<div class="large-6 columns">
|
||||
<h4>Robokassa Payment</h4>
|
||||
<p>This is a one-time payment that will not recur. Payment may take up to 5 minutes to process.</p>
|
||||
</div>
|
||||
<div class="large-3 columns">
|
||||
<select name="amount">
|
||||
<option value="500">500 рублей</option>
|
||||
<option value="1000">1000 рублей</option>
|
||||
<option value="2000">2000 рублей</option>
|
||||
<option value="5000">5000 рублей</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="large-3 columns">
|
||||
<input type="submit" value="Оплатить" class="button postfix" />
|
||||
</div>
|
||||
</form>
|
|
@ -1,154 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Settings") }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Settings") }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-3 columns">
|
||||
{% include "default/settings/_menu.html" %}
|
||||
</div>
|
||||
<div class="large-9 columns">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _("Billing") }}</h3>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
<p>{{ _("Balance") }}: ${{ user_balance }}</p>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _("Payment Methods") }}</h3>
|
||||
<ul class="tabs" data-tab role="tablist">
|
||||
{% if g.settings['PAY_TWOCHECKOUT_ENABLED'] == "1" %}
|
||||
<li class="tab-title active" role="presentation"><a href="#panel2-1" role="tab" tabindex="0" aria-selected="true" aria-controls="panel2-1">Credit card</a></li>
|
||||
{% endif %}
|
||||
<!-- li class="tab-title" role="presentation"><a href="#panel2-2" role="tab" tabindex="0" aria-selected="false" aria-controls="panel2-2">Paypal</a></--li -->
|
||||
{% if g.settings['PAY_ROBOKASSA_ENABLED'] == "1" %}
|
||||
<li class="tab-title" role="presentation"><a href="#panel2-3" role="tab" tabindex="0" aria-selected="false" aria-controls="panel2-3">Robokassa</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="tabs-content">
|
||||
{% if g.settings['PAY_TWOCHECKOUT_ENABLED'] == "1" %}
|
||||
<section role="tabpanel" aria-hidden="false" class="content active" id="panel2-1">
|
||||
{% include "default/settings/billing/_tab.creditcard.html" %}
|
||||
</section>
|
||||
{% endif %}
|
||||
<!--section role="tabpanel" aria-hidden="true" class="content" id="panel2-2">
|
||||
{% include "default/settings/billing/_tab.paypal.html" %}
|
||||
</section -->
|
||||
{% if g.settings['PAY_ROBOKASSA_ENABLED'] == "1" %}
|
||||
<section role="tabpanel" aria-hidden="true" class="content" id="panel2-3">
|
||||
{% include "default/settings/billing/_tab.robokassa.html" %}
|
||||
</section>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h4>{{ _("Billing History") }}</h4>
|
||||
<table width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ _("ID") }}</th>
|
||||
<th>{{ _("Amount") }}</th>
|
||||
<th>{{ _("Date") }}</th>
|
||||
<th>{{ _("Status") }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if history['total'] == 0 %}
|
||||
<tr><td colspan="3">Нет записей.</td></tr>
|
||||
{% else %}
|
||||
{% for record in history['items'] %}
|
||||
<tr>
|
||||
<td>{{ record['id'] }}</td>
|
||||
<td>{{ record['amount'] }}</td>
|
||||
<td>{{ record['created'] }}</td>
|
||||
<td>
|
||||
{% if record['status'] == "process" %}
|
||||
<span class="label attention">{{ record['status'] }}</span>
|
||||
{% elif record['status'] == "fail" %}
|
||||
<span class="label error">{{ record['status'] }}</span>
|
||||
{% elif record['status'] == "success" %}
|
||||
<span class="label success">{{ record['status'] }}</span>
|
||||
{% else %}
|
||||
{{ record['status'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).foundation({
|
||||
tab: {
|
||||
callback : function (tab) {
|
||||
console.log(tab);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% if g.settings['PAY_TWOCHECKOUT_ENABLED'] == "1" %}
|
||||
<script src="https://www.2checkout.com/checkout/api/2co.min.js"></script>
|
||||
<script>
|
||||
// Called when token created successfully.
|
||||
var successCallback = function(data) {
|
||||
var myForm = document.getElementById('myCCForm');
|
||||
|
||||
// Set the token as the value for the token input
|
||||
myForm.token.value = data.response.token.token;
|
||||
|
||||
// IMPORTANT: Here we call `submit()` on the form element directly instead of using jQuery to prevent and infinite token request loop.
|
||||
myForm.submit();
|
||||
};
|
||||
|
||||
// Called when token creation fails.
|
||||
var errorCallback = function(data) {
|
||||
if (data.errorCode === 200) {
|
||||
tokenRequest();
|
||||
} else {
|
||||
alert(data.errorMsg);
|
||||
}
|
||||
};
|
||||
|
||||
var tokenRequest = function() {
|
||||
// Setup token request arguments
|
||||
var args = {
|
||||
sellerId: "{{ g.settings['PAY_TWOCHECKOUT_SELLER_ID'] }}",
|
||||
publishableKey: "{{ g.settings['PAY_TWOCHECKOUT_PUBLICKEY'] }}",
|
||||
ccNo: $("#ccNo").val(),
|
||||
cvv: $("#cvv").val(),
|
||||
expMonth: $("#expMonth").val(),
|
||||
expYear: $("#expYear").val()
|
||||
};
|
||||
|
||||
// Make the token request
|
||||
TCO.requestToken(successCallback, errorCallback, args);
|
||||
};
|
||||
$(function() {
|
||||
// Pull in the public encryption key for our environment
|
||||
TCO.loadPubKey('sandbox');
|
||||
//
|
||||
$("#myCCForm").submit(function(e) {
|
||||
// Call our token request function
|
||||
tokenRequest();
|
||||
// Prevent form from submitting
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,23 +0,0 @@
|
|||
<form action="{{ url_for('settings.profile_edit') }}" method="post">
|
||||
<input type="hidden" name="update_information" value="1">
|
||||
<!-- BILLING BLOCK -->
|
||||
<label for="fname">{{ _("First name") }}</label>
|
||||
<input name="fname" id="fname" type="text" class="long-field" value="{{ user_details['fname'] }}" />
|
||||
<label for="lname">{{ _("Last name") }}</label>
|
||||
<input name="lname" id="lname" type="text" class="long-field" value="{{ user_details['lname'] }}" />
|
||||
<label for="address">{{ _("Address") }}</label>
|
||||
<input name="address" id="address" type="text" class="long-field" value="{{ user_details['address'] }}" />
|
||||
<label for="city">{{ _("City") }}</label>
|
||||
<input name="city" id="city" type="text" class="long-field" value="{{ user_details['city'] }}" />
|
||||
<label for="country">{{ _("Country") }}</label>
|
||||
<input name="country" id="country" type="text" class="long-field" value="{{ user_details['country'] }}" />
|
||||
<label for="state">{{ _("Region") }}</label>
|
||||
<input name="state" id="state" type="text" class="long-field" value="{{ user_details['state'] }}" />
|
||||
<label for="zipcode">{{ _("ZIP") }}</label>
|
||||
<input name="zipcode" id="zipcode" type="text" class="small-field" value="{{ user_details['zipcode'] }}" />
|
||||
<label for="phone">{{ _("Phone") }}</label>
|
||||
<input name="phone" id="phone" type="text" class="small-field" value="{{ user_details['phone'] }}" />
|
||||
<input type="submit" value="{{ _('Save changes') }}" class="button success" />
|
||||
|
||||
<a href="{{ url_for('settings.profile') }}">{{ _("Cancel") }}</a>
|
||||
</form>
|
|
@ -1,17 +0,0 @@
|
|||
<label>{{ _("First name") }}</label>
|
||||
<input type="text" class="long-field" value="{{ user_details['fname'] }}" disabled />
|
||||
<label>{{ _("Last name") }}</label>
|
||||
<input type="text" class="long-field" value="{{ user_details['lname'] }}" disabled />
|
||||
<label>{{ _("Address") }}</label>
|
||||
<input type="text" class="long-field" value="{{ user_details['address'] }}" disabled />
|
||||
<label>{{ _("City") }}</label>
|
||||
<input type="text" class="long-field" value="{{ user_details['city'] }}" disabled />
|
||||
<label>{{ _("Country") }}</label>
|
||||
<input type="text" class="long-field" value="{{ user_details['country'] }}" disabled />
|
||||
<label>{{ _("Region") }}</label>
|
||||
<input type="text" class="long-field" value="{{ user_details['state'] }}" disabled />
|
||||
<label>{{ _("ZIP") }}</label>
|
||||
<input type="text" class="long-field" value="{{ user_details['zipcode'] }}" disabled />
|
||||
<label>{{ _("Phone") }}</label>
|
||||
<input type="text" class="long-field" value="{{ user_details['phone'] }}" disabled />
|
||||
<a href="{{ url_for('settings.profile_edit') }}" class="button success">{{ _("Change") }}</a>
|
|
@ -1,33 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Settings") }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Settings") }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-3 columns">
|
||||
{% include "default/settings/_menu.html" %}
|
||||
</div>
|
||||
<div class="large-9 columns">
|
||||
<div class="row">
|
||||
{% if g.errors['total'] > 0 %}
|
||||
<div class="alert-box alert">
|
||||
<ul>
|
||||
{% for error in g.errors['items'] %}<li>{{ error }}</li>{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _("Profile") }}</h3>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
{% include "default/settings/profile/_account_information_edit.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,26 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}{{ _("Settings") }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h2>{{ _("Settings") }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-3 columns">
|
||||
{% include "default/settings/_menu.html" %}
|
||||
</div>
|
||||
<div class="large-9 columns">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>{{ _("Profile") }}</h3>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
{% include "default/settings/profile/_account_information_view.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,43 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Tasks{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>Tasks</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<table width='100%'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Date</th>
|
||||
<th>Task</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if tasks.total == 0 %}
|
||||
<tr>
|
||||
<td colspan="5">No any tasks.</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
{% for task in tasks['items'] %}
|
||||
<tr>
|
||||
<td>{{ task.id }}</td>
|
||||
<td>{{ task.created }}</td>
|
||||
<td>
|
||||
{% if task.details.action == 'create' %}
|
||||
{{ task.details.action }} container:{{ task.details.container_id }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,43 +0,0 @@
|
|||
{% extends "default/_layout.html" %}
|
||||
|
||||
{% block title %}Главная{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<h3>Задачи</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<table width='100%'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Дата</th>
|
||||
<th>Задача</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if tasks.total == 0 %}
|
||||
<tr>
|
||||
<td colspan="5">Нет ни одной задачи.</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
{% for task in tasks['items'] %}
|
||||
<tr>
|
||||
<td>{{ task.id }}</td>
|
||||
<td>{{ task.created }}</td>
|
||||
<td>
|
||||
{% if task.details.action == 'create' %}
|
||||
{{ task.details.action }} container:{{ task.details.container_id }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -16,14 +16,6 @@ create_key('PAY_ROBOKASSA_LOGIN', '')
|
|||
create_key('PAY_ROBOKASSA_PASSWORD1', '')
|
||||
create_key('PAY_ROBOKASSA_PASSWORD2', '')
|
||||
create_key('PAY_ROBOKASSA_ENABLED', '')
|
||||
|
||||
create_key('PAY_TWOCHECKOUT_ENABLED', '0')
|
||||
create_key('PAY_TWOCHECKOUT_MODE', '')
|
||||
create_key('PAY_TWOCHECKOUT_SELLER_ID', '')
|
||||
create_key('PAY_TWOCHECKOUT_PRIVATEKEY', '')
|
||||
create_key('PAY_TWOCHECKOUT_PUBLICKEY', '')
|
||||
|
||||
|
||||
create_key('SMTP_PORT', '')
|
||||
create_key('SMTP_USERNAME', '')
|
||||
create_key('SMTP_PASSWORD', '')
|
||||
|
|
Loading…
Add table
Reference in a new issue