Initial commit

This commit is contained in:
rubenwardy
2018-03-18 17:43:30 +00:00
commit 366a2302d0
14 changed files with 796 additions and 0 deletions

74
app/templates/base.html Normal file
View File

@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}title{% endblock %} - {{ config.USER_APP_NAME }}</title>
<link rel="stylesheet" type="text/css" href="/static/style.css">
</head>
<body>
<nav>
<ul class="nav navbar-nav">
<li><a href="/">{{ config.USER_APP_NAME }}</a></li>
{% for item in current_menu.children recursive %}
<li{% if item.children %} class="dropdown"{% endif %}>
<a href="{{ item.url }}"
{% if item.children %}
class="dropdown-toggle"
data-toggle="dropdown"
role="button"
aria-expanded="false"
{% endif %}>
{{ item.text }}
{% if item.children %}
<span class="caret"></span>
{% endif %}
</a>
{% if item.children %}
<ul class="dropdown-menu" role="menu">
{{ loop(item.children) }}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if current_user.is_authenticated %}
<li><a href="{{ url_for('user_profile_page') }}">{{ current_user.first_name or current_user.username }}</a></li>
<li><a href="{{ url_for('user.logout') }}">Sign out</a></li>
{% else %}
<li><a href="{{ url_for('user.login') }}">Sign in</a></li>
{% endif %}
</ul>
<div style="clear:both;"></div>
</nav>
{% block flash_messages %}
{%- with messages = get_flashed_messages(with_categories=true) -%}
{% if messages %}
<ul id="alerts">
{% for category, message in messages %}
<li class="box box_grey alert alert-{{category}}">
<span class="icon_message"></span>
{{ message|safe }}
<div style="clear: both;"></div>
</li>
{% endfor %}
</ul>
{% endif %}
{%- endwith %}
{% endblock %}
{% block container %}
<main>
{% block content %}
{% endblock %}
</main>
{% endblock %}
</html>

View File

@@ -0,0 +1,76 @@
{% extends "base.html" %}
{% block title %}
Sign in
{% endblock %}
{% block content %}
<div class="sidebar_container">
<div class="left box box_grey">
{% from "flask_user/_macros.html" import render_field, render_checkbox_field, render_submit_field %}
<h2>{%trans%}Sign in{%endtrans%}</h2>
<form action="" method="POST" class="form" role="form">
{{ form.hidden_tag() }}
{# Username or Email field #}
{% set field = form.username if user_manager.enable_username else form.email %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
{# Label on left, "New here? Register." on right #}
<div class="row">
<div class="col-xs-6">
<label for="{{ field.id }}" class="control-label">{{ field.label.text }}</label>
</div>
</div>
{{ field(class_='form-control', tabindex=110) }}
{% if field.errors %}
{% for e in field.errors %}
<p class="help-block">{{ e }}</p>
{% endfor %}
{% endif %}
</div>
{# Password field #}
{% set field = form.password %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
{# Label on left, "Forgot your Password?" on right #}
<div class="row">
<div class="col-xs-6">
<label for="{{ field.id }}" class="control-label">{{ field.label.text }}</label>
</div>
<div class="col-xs-6 text-right">
{% if user_manager.enable_forgot_password %}
<a href="{{ url_for('user.forgot_password') }}" tabindex='195'>
{%trans%}Forgot your Password?{%endtrans%}</a>
{% endif %}
</div>
</div>
{{ field(class_='form-control', tabindex=120) }}
{% if field.errors %}
{% for e in field.errors %}
<p class="help-block">{{ e }}</p>
{% endfor %}
{% endif %}
</div>
{# Remember me #}
{% if user_manager.enable_remember_me %}
{{ render_checkbox_field(login_form.remember_me, tabindex=130) }}
{% endif %}
{# Submit button #}
{{ render_submit_field(form.submit, tabindex=180) }}
</form>
</div>
<div class="right">
<aside class="box box_grey">
<h2>New here?</h2>
{% if user_manager.enable_register and not user_manager.require_invitation %}
<a href="">{%trans%}Create an account{%endtrans%}</a>
{% endif %}
</aside>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,10 @@
{% extends "base.html" %}
{% block container %}
<main>
<div class="box box_grey">
{% block content %}
{% endblock %}
</div>
</main>
{% endblock %}

35
app/templates/index.html Normal file
View File

@@ -0,0 +1,35 @@
{% extends "base.html" %}
{% block title %}
Dashboard
{% endblock %}
{% block content %}
<div class="box box_grey">
<h2>{{ self.title() }}</h2>
{% if current_user.is_authenticated %}
<p>
Hello user!
</p>
{% else %}
<p>
Please login!
</p>
{% endif %}
</div>
<div class="2box">
<div class="box box_grey">
<h2>Top Mods</h2>
</div>
<div class="box box_grey">
<h2>Statistics</h2>
<ul>
<li>Total mods: 543</li>
<li>Missing mods: 1020</li>
<li>Downloads/day: 200</li>
</ul>
</div>
</div>
{% endblock %}