mirror of
https://github.com/Xevion/v1.xevion.dev.git
synced 2025-12-09 10:09:10 -06:00
added 404, removing profile, updated index with google analytics
This commit is contained in:
@@ -107,8 +107,19 @@ def create_panzer(string):
|
||||
|
||||
@app.route('/profile/')
|
||||
@login_required
|
||||
def profile():
|
||||
return render_template('profile.html')
|
||||
def default_profile():
|
||||
return profile(current_user.username)
|
||||
|
||||
@app.route('/profile/<username>')
|
||||
@login_required
|
||||
def profile(username):
|
||||
user = User.query.filter_by(username=username).first_or_404()
|
||||
return render_template('profile.html', user=user)
|
||||
|
||||
@app.errorhandler(404)
|
||||
def page_not_found(e):
|
||||
# note that we set the 404 status explicitly
|
||||
return render_template('404.html'), 404
|
||||
|
||||
@app.route('/userinfo/')
|
||||
@login_required
|
||||
@@ -127,8 +138,18 @@ def user_info():
|
||||
}
|
||||
return jsonify(prepare)
|
||||
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
jobs = [
|
||||
'Student Photographer',
|
||||
'Highschool Student',
|
||||
'Web Developer',
|
||||
'Python Developer',
|
||||
'Software Engineer',
|
||||
]
|
||||
|
||||
# content = [{'text': fake.paragraph(nb_sentences=15),
|
||||
# 'seed': random.randint(0, 1000),
|
||||
# 'title': fake.word().title()}
|
||||
@@ -137,7 +158,7 @@ def index():
|
||||
'seed': random.randint(0, 1000),
|
||||
'text': 'This portion of my website is still a work in progress. I don\'t know if and when it\'ll be done, or how it will turn out in the end. - Xevion @ (Jul-11-2019)'}
|
||||
for _ in range(1)]
|
||||
return render_template('index.html', content=content)
|
||||
return render_template('index.html', content=content, job=random.choice(jobs))
|
||||
|
||||
@app.route('/register/', methods=['GET', 'POST'])
|
||||
def register():
|
||||
|
||||
17
app/templates/404.html
Normal file
17
app/templates/404.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block body %}
|
||||
<!-- Hero Section -->
|
||||
<section class="hero is-fullheight-with-navbar is-danger">
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
<p class="title">
|
||||
404
|
||||
</p>
|
||||
<p class="subtitle">
|
||||
Content Not Found... <a href="{{ url_for('index') }}">Go home?</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- End Hero Section -->
|
||||
{% endblock body %}
|
||||
@@ -28,6 +28,15 @@ Color = Bulma Color Type of the Message Box
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block head %}
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-68895812-4"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'UA-68895812-4');
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css">
|
||||
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
@@ -102,10 +111,6 @@ Color = Bulma Color Type of the Message Box
|
||||
|
||||
<div class="navbar-dropdown">
|
||||
{% if current_user.is_authenticated %}
|
||||
<a class="navbar-item" href="{{ url_for('profile') }}">
|
||||
<span class="navbar-fa-icon fas fa-user"></span>
|
||||
<div class="navbar-text">Profile</div>
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ url_for('dashboard') }}">
|
||||
<span class="navbar-fa-icon fas fa-chart-line"></span>
|
||||
<div class="navbar-text">Dashboard</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
Xevion
|
||||
</p>
|
||||
<p class="subtitle">
|
||||
Python Developer
|
||||
{{ job }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-header-title">
|
||||
GitHub Actviity
|
||||
GitHub Activity
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
@@ -49,30 +49,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- End GitHub Activity Feed -->
|
||||
|
||||
{% for card in content %}
|
||||
<div class="column is-5">
|
||||
<!-- Card -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-header-title">
|
||||
{{ card.title }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-image">
|
||||
<figure class="image">
|
||||
<img src="https://picsum.photos/600/400/?random={{ card.seed }}" alt="Picsum Picture">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="content word-break">
|
||||
{{ card.text }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Card End -->
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div> </section>
|
||||
|
||||
@@ -9,10 +9,57 @@
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-header-title">
|
||||
{{ username }}'s Profile
|
||||
{{ user.username }}'s Profile
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
|
||||
<div class="row align-items-center" style="margin-left: 0px; ">
|
||||
<div class="form-group">
|
||||
<!-- Username -->
|
||||
<div class="row mt-4">
|
||||
<div class="col-auto">
|
||||
<label class="mb-1" style="width: 80px;">
|
||||
Username
|
||||
</label>
|
||||
<label style="font-weight: bold;">
|
||||
{{ user.username }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if user.show_email or current_user.has_role('hidden') %}
|
||||
<div class="row mt-3">
|
||||
<div class="col-auto">
|
||||
<label class="mb-1" style="width: 80px;">
|
||||
Email
|
||||
</label>
|
||||
<label style="font-weight: bold;">
|
||||
{{ user.email or '-' }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-auto">
|
||||
<label class="mb-1" style="width: 80px;">
|
||||
Phone
|
||||
</label>
|
||||
<label style="font-weight: bold;">
|
||||
{{ user.phone_number or '-' }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row align-items-center" style="margin-left: -10px; ">
|
||||
<div class="col-auto">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user