diff --git a/app/__init__.py b/app/__init__.py index e033a6b..bf69a8a 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -52,8 +52,8 @@ app.register_blueprint(panel_blueprint, url_prefix='/panel') from .auth import auth as auth_blueprint app.register_blueprint(auth_blueprint, url_prefix='/auth') -from .news import news as news_blueprint -app.register_blueprint(news_blueprint, url_prefix='/news') +#from .news import news as news_blueprint +#app.register_blueprint(news_blueprint, url_prefix='/news') from .admin import admin as admin_blueprint app.register_blueprint(admin_blueprint, url_prefix='/' + app.config['ADMIN_PREFIX']) diff --git a/app/main/forms.py b/app/main/forms.py new file mode 100644 index 0000000..f16a65e --- /dev/null +++ b/app/main/forms.py @@ -0,0 +1,26 @@ +from flask_wtf import FlaskForm, RecaptchaField + +from wtforms import StringField, PasswordField, BooleanField, SubmitField, SelectField, DecimalField +from wtforms import validators, ValidationError +from wtforms.fields.html5 import EmailField +from ..models import User + + +class LoginForm(FlaskForm): + email = EmailField('', [validators.DataRequired(), validators.Length(1,64), validators.Email()], render_kw={"placeholder": "username"}) + password = PasswordField('', [validators.DataRequired(), validators.Length(1,128)], render_kw={"placeholder": "password"}) + remember_me = BooleanField('Remember?', render_kw={"placeholder": "remember"}) + #recaptcha = RecaptchaField() + submit = SubmitField('Login', render_kw={"placeholder": "submit"}) + +class RegistrationForm(FlaskForm): + email = StringField('E-Mail', [validators.DataRequired(), validators.Length(6,35), validators.Email()]) + def validate_email(self, field): + if User.query.filter_by(email=field.data).first(): + raise ValidationError('Error. Please try again.') + password = PasswordField('Password', [validators.DataRequired(), validators.EqualTo('confirm', message='Both passwords must be equal')]) + confirm = PasswordField('Your password again', [validators.DataRequired()]) + accept_tos = BooleanField('I accept the Terms of Service', [validators.DataRequired()]) + recaptcha = RecaptchaField() + submit = SubmitField('REGISTER') + diff --git a/app/main/routes.py b/app/main/routes.py index 0b88a04..c3923e5 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -3,6 +3,7 @@ from flask_login import login_required, login_user, logout_user, current_user from flask_sqlalchemy import get_debug_queries from . import main +from .forms import LoginForm, RegistrationForm from .. import db from ..email import send_email from ..models import User, Permission, Server, Deployment, Service, Region, Address, Domain, contact_proxmaster @@ -19,8 +20,9 @@ def after_request(response): #STATIC PAGES @main.route("/", methods=['GET']) def index(): + form = LoginForm() allservers = Server.query.filter_by(enabled=True) - return render_template('main/index.html', servers=allservers) + return render_template('main/index.html', servers=allservers, form=form) @main.route("/chat", methods=['GET']) def chat(): diff --git a/app/static/css/panel-transparent.css b/app/static/css/panel-transparent.css index a2f07a4..1b66021 100644 --- a/app/static/css/panel-transparent.css +++ b/app/static/css/panel-transparent.css @@ -4,10 +4,10 @@ .panel-transparent .panel-heading { background: rgb(255, 255, 255); /* fallback */ - background: rgba(255, 255, 255, 0.7)!important; + background: rgba(255, 255, 255, 0.6)!important; } .panel-transparent .panel-body{ background: rgb(255, 255, 255); /* fallback */ - background: rgba(255, 255, 255, 0.7)!important; + background: rgba(255, 255, 255, 0.5)!important; } diff --git a/app/templates/main/index.html b/app/templates/main/index.html index d1e20f4..bd76931 100644 --- a/app/templates/main/index.html +++ b/app/templates/main/index.html @@ -74,19 +74,21 @@
-
+

Already registered? Sign In

- +
@@ -97,7 +99,7 @@
-
+
@@ -112,12 +114,11 @@
-
+
- -

Мисия

-

Предоставяме платформа за управление на Вашите изчислителни процеси,

+

Мисия

+

Предоставяме платформа за управление на Вашите изчислителни процеси