mirror of
https://github.com/aronwk-aaron/MSState-Library-ETD.git
synced 2026-01-20 20:39:52 -06:00
Updated profile
Removed general dashboard since it was redundant and not being used. Replace the dashboard button in the header with profile button for easier access. Made profile editing form use the base for the other profile, instead of the grey background modal Added a bit more form masking to
This commit is contained in:
14
app/main.py
14
app/main.py
@@ -12,13 +12,6 @@ def index():
|
||||
return render_template('main/index.jinja2')
|
||||
|
||||
|
||||
@main_blueprint.route('/dashboard')
|
||||
@login_required
|
||||
def dashboard():
|
||||
"""Dashboard Page"""
|
||||
return render_template('main/dashboard.jinja2')
|
||||
|
||||
|
||||
@main_blueprint.route('/profile')
|
||||
@login_required
|
||||
def profile():
|
||||
@@ -64,3 +57,10 @@ def serve_documents(filename):
|
||||
def signed_out():
|
||||
"""Sign out landing page"""
|
||||
return render_template('flask_user/signed_out.html')
|
||||
|
||||
|
||||
@main_blueprint.route('/about')
|
||||
@login_required
|
||||
def about():
|
||||
"""About Page"""
|
||||
return render_template('main/about.jinja2')
|
||||
|
||||
@@ -39,17 +39,7 @@ def create(submission_id):
|
||||
else:
|
||||
# if a post process it
|
||||
if form.validate_on_submit():
|
||||
f = form.file.data
|
||||
fname = secure_filename(f.filename)
|
||||
fileext = fname.rsplit('.', 1)[1].lower()
|
||||
filename = current_user.last_name + '_' + current_user.first_name + '_revision_' + \
|
||||
datetime.datetime.now().strftime("%Y-%m-%d_%H:%M:%S") + '.' + fileext
|
||||
f.save(os.path.join(current_app.config['SUBMISSION_FOLDER'], filename))
|
||||
|
||||
params = {'filename': filename, 'submission_id': submission_id}
|
||||
revision_id = Revision.create_revision(params=params)
|
||||
|
||||
return redirect(url_for('revisions.view', revision_id=revision_id))
|
||||
create_post(form, submission_id)
|
||||
# else present the create page
|
||||
else:
|
||||
return render_template('revisions/create.jinja2',
|
||||
@@ -59,17 +49,7 @@ def create(submission_id):
|
||||
else:
|
||||
# if a post process it
|
||||
if form.validate_on_submit():
|
||||
f = form.file.data
|
||||
fname = secure_filename(f.filename)
|
||||
fileext = fname.rsplit('.', 1)[1].lower()
|
||||
filename = current_user.last_name + '_' + current_user.first_name + '_revision_' + \
|
||||
datetime.datetime.now().strftime("%Y-%m-%d_%H:%M:%S") + '.' + fileext
|
||||
f.save(os.path.join(current_app.config['SUBMISSION_FOLDER'], filename))
|
||||
|
||||
params = {'filename': filename, 'submission_id': submission_id}
|
||||
revision_id = Revision.create_revision(params=params)
|
||||
|
||||
return redirect(url_for('revisions.view', revision_id=revision_id))
|
||||
create_post(form, submission_id)
|
||||
# else present the create page
|
||||
else:
|
||||
return render_template('revisions/create.jinja2',
|
||||
@@ -77,6 +57,20 @@ def create(submission_id):
|
||||
submission_id=submission_id)
|
||||
|
||||
|
||||
def create_post(form, submission_id):
|
||||
f = form.file.data
|
||||
fname = secure_filename(f.filename)
|
||||
fileext = fname.rsplit('.', 1)[1].lower()
|
||||
filename = current_user.last_name + '_' + current_user.first_name + '_revision_' + \
|
||||
datetime.datetime.now().strftime("%Y-%m-%d_%H:%M:%S") + '.' + fileext
|
||||
f.save(os.path.join(current_app.config['SUBMISSION_FOLDER'], filename))
|
||||
|
||||
params = {'filename': filename, 'submission_id': submission_id}
|
||||
revision_id = Revision.create_revision(params=params)
|
||||
|
||||
return redirect(url_for('revisions.view', revision_id=revision_id))
|
||||
|
||||
|
||||
@revisions_blueprint.route('/view/<revision_id>')
|
||||
@login_required
|
||||
def view(revision_id):
|
||||
|
||||
@@ -1,29 +1,86 @@
|
||||
{% extends 'flask_user/_authorized_base.html' %}
|
||||
{% extends 'base.jinja2' %}
|
||||
{% from "flask_user/_macros.html" import render_field, render_checkbox_field, render_submit_field %}
|
||||
|
||||
{% block title %}User Profile{% endblock %}
|
||||
{% block form_title %}User Profile{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
<form action="" method="POST" class="form" role="form">
|
||||
{{ form.hidden_tag() }}
|
||||
{% for field in form %}
|
||||
{% if not field.flags.hidden %}
|
||||
{% if field.type=='SubmitField' %}
|
||||
{{ render_submit_field(field, tabindex=loop.index*10) }}
|
||||
{% else %}
|
||||
{{ render_field(field, tabindex=loop.index*10) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</form>
|
||||
<br/>
|
||||
{% block content %}
|
||||
<div class='card mx-auto mt-5 col-lg-7 col-12 shadow-sm'>
|
||||
<div class='card-body'>
|
||||
<form action="" method="POST" novalidate class="form" role="form">
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-12 col-sm-6">
|
||||
{{ render_submit_field(form.submit, tabindex=220) }}
|
||||
</div>
|
||||
<div class="col-12 col-sm-6">
|
||||
{% if not user_manager.USER_ENABLE_AUTH0 %}
|
||||
{% if user_manager.USER_ENABLE_CHANGE_PASSWORD %}
|
||||
<p><a class="btn btn-default btn-primary" href="{{ url_for('user.change_password') }}">{% trans %}Change password{% endtrans %}</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h5>Personal Info</h5>
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-6">
|
||||
{{ render_field(form.first_name, tabindex=10) }}
|
||||
{{ render_field(form.middle_name, tabindex=20) }}
|
||||
{{ render_field(form.last_name, tabindex=30) }}
|
||||
{{ render_field(form.pref_name, tabindex=40) }}
|
||||
{{ render_field(form.maiden_name, tabindex=50) }}
|
||||
{{ render_field(form.birth_date, tabindex=60) }}
|
||||
</div>
|
||||
<div class="col-12 col-sm-6">
|
||||
{{ render_field(form.thoroughfare, tabindex=70) }}
|
||||
{{ render_field(form.premise, tabindex=80) }}
|
||||
{{ render_field(form.locality, tabindex=90) }}
|
||||
{{ render_field(form.administrative_area, tabindex=100) }}
|
||||
{{ render_field(form.postal_code, tabindex=110) }}
|
||||
{{ render_field(form.country, tabindex=120) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-6">
|
||||
<h5>MSU Info</h5>
|
||||
{{ render_field(form.net_id, tabindex=130) }}
|
||||
{{ render_field(form.msu_id, tabindex=140) }}
|
||||
{{ render_field(form.department, tabindex=150) }}
|
||||
</div>
|
||||
<div class="col-12 col-sm-6">
|
||||
<hr class="d-sm-block d-md-none"/>
|
||||
<h5>Contact Info</h5>
|
||||
{{ render_field(form.sec_email, tabindex=190) }}
|
||||
{{ render_field(form.prim_phone, tabindex=200) }}
|
||||
{{ render_field(form.sec_phone, tabindex=210) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div class="row justify-content-between">
|
||||
<div class="col">
|
||||
{{ render_submit_field(form.submit, tabindex=220) }}
|
||||
</div>
|
||||
<div class="col">
|
||||
{% if not user_manager.USER_ENABLE_AUTH0 %}
|
||||
{% if user_manager.USER_ENABLE_CHANGE_PASSWORD %}
|
||||
<p><a class="btn btn-default btn-primary" href="{{ url_for('user.change_password') }}">{% trans %}Change password{% endtrans %}</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if not user_manager.USER_ENABLE_AUTH0 %}
|
||||
{% if user_manager.USER_ENABLE_CHANGE_PASSWORD %}
|
||||
<p><a href="{{ url_for('user.change_password') }}">{% trans %}Change password{% endtrans %}</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
@@ -31,8 +88,8 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.js"></script>
|
||||
<script>
|
||||
$('#msu_id').mask("999-999-999", {placeholder: "000-000-000"});
|
||||
{#$('#prim_phone').mask('(000) 000-0000');#}
|
||||
{#$('#sec_phone').mask('(000) 000-0000');#}
|
||||
$('#prim_phone').mask('000-000-0000');
|
||||
$('#sec_phone').mask('000-000-0000');
|
||||
$('#postal_code').mask('00000');
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.js"></script>
|
||||
<script>
|
||||
$('#msu_id').mask("999-999-999", {placeholder: "000-000-000"});
|
||||
{#$('#prim_phone').mask('(000) 000-0000');#}
|
||||
{#$('#sec_phone').mask('(000) 000-0000');#}
|
||||
$('#prim_phone').mask('000-000-0000');
|
||||
$('#sec_phone').mask('000-000-0000');
|
||||
$('#postal_code').mask('00000');
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
{# Visible only on large devices #}
|
||||
<nav class='navbar-nav'>
|
||||
<div class='collapse navbar-collapse'>
|
||||
<a class='btn-nav-dashboard mr-2' href='{{ url_for('main.dashboard') }}'><i
|
||||
class='fas fa-book mr-1'></i>Dashboard</a>
|
||||
<a class='btn-nav-dashboard mr-2' href='{{ url_for('main.profile') }}'><i
|
||||
class='fas fa-user mr-1'></i>Profile</a>
|
||||
<a class='btn-nav-dashboard' href='{{ url_for('user.logout') }}'><i
|
||||
class='fas fa-sign-out-alt mr-1'></i>Sign Out</a>
|
||||
</div>
|
||||
@@ -36,8 +36,8 @@
|
||||
<nav class='navbar-nav mr-auto'>
|
||||
<a id='main-index' class='nav-link' href='{{ url_for('main.index') }}'>Home</a>
|
||||
<a id='main-submissions' class='nav-link' href='{{ url_for('submissions.index') }}'>Submissions</a>
|
||||
<a id='main-about' class='nav-link' href='#'>About</a>
|
||||
<a class='nav-link d-sm-none' href='{{ url_for('main.dashboard') }}'>Dashboard</a>
|
||||
<a id='main-about' class='nav-link' href='{{ url_for('main.about') }}'>About</a>
|
||||
<a class='nav-link d-sm-none' href='{{ url_for('main.profile') }}'>Profile</a>
|
||||
<a class='nav-link d-sm-none' href='{{ url_for('user.logout') }}'>Logout</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
85
app/templates/main/about.jinja2
Normal file
85
app/templates/main/about.jinja2
Normal file
@@ -0,0 +1,85 @@
|
||||
{% extends 'base.jinja2' %}
|
||||
|
||||
{% block title %}Home{% endblock %}
|
||||
|
||||
{% block content_before %}
|
||||
|
||||
<div class="jumbotron shadow-sm">
|
||||
<div class="container">
|
||||
|
||||
{# Text #}
|
||||
<div class="text-center">
|
||||
<span class="h4">Mississippi State University Libraries</span>
|
||||
<span class="h3"><br/>Electronic Thesis and Dissertation System</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class='card mx-auto mt-5 shadow-sm'>
|
||||
<div class='card-header text-center'>
|
||||
This application was made in collaboration with the Computer Science and Engineering Senior Design Class
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h4 class="text-center">Contributors</h4>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Aaron Kimbrell
|
||||
</div>
|
||||
<div class="col">
|
||||
Project Manager
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Jordan Stremming
|
||||
</div>
|
||||
<div class="col">
|
||||
Programming and Design
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Brandon Sellers
|
||||
</div>
|
||||
<div class="col">
|
||||
Programming
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Katelyn Kendrick
|
||||
</div>
|
||||
<div class="col">
|
||||
Programming and planning
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Louis Hamilton
|
||||
</div>
|
||||
<div class="col">
|
||||
Programming and planning
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Damon Stamps
|
||||
</div>
|
||||
<div class="col">
|
||||
Planning
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
Gabe Phelan
|
||||
</div>
|
||||
<div class="col">
|
||||
Planning
|
||||
</div>
|
||||
</div>
|
||||
</</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,66 +0,0 @@
|
||||
{% extends 'base.jinja2' %}
|
||||
|
||||
{% block title %}Dashboard{% endblock %}
|
||||
|
||||
{% block content_before %}
|
||||
|
||||
<div class='jumbotron shadow-sm py-3'>
|
||||
<div class='container'>
|
||||
<h1>Dashboard</h1>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{# Profile Card #}
|
||||
<div class='card shadow'>
|
||||
<div class='card-body'>
|
||||
<h3 class='card-title'>Profile</h3>
|
||||
<hr/>
|
||||
<p class="mb-1">
|
||||
<b>First name:</b><br/>
|
||||
Bully
|
||||
</p>
|
||||
<p class="mb-1">
|
||||
<b>Last name:</b><br/>
|
||||
Bulldog
|
||||
</p>
|
||||
<p class="mb-1">
|
||||
<b>netID:</b><br/>
|
||||
bb123
|
||||
</p>
|
||||
<p class="mb-1">
|
||||
<b>type:</b><br/>
|
||||
{{ user }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class='card-footer'>
|
||||
<a href='{{ url_for('main.profile') }}' class='btn btn-outline-primary'>
|
||||
View my profile
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# TODO: user type check #}
|
||||
{# Submissions Card #}
|
||||
{% if true %}
|
||||
<div class='card shadow mt-4'>
|
||||
<div class='card-body'>
|
||||
<h3 class='card-title'>Submissions</h3>
|
||||
<hr/>
|
||||
<p class="mb-1">
|
||||
You don't have any submissions!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class='card-footer'>
|
||||
<a href='{{ url_for('submissions.create') }}' class='btn btn-outline-primary'>
|
||||
Create a submission
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -20,10 +20,10 @@
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="What would you like to search for?">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-secondary ml-1" type="submit">
|
||||
<i class="fas fa-search mr-2"></i>Search
|
||||
</button>
|
||||
</span>
|
||||
<button class="btn btn-secondary ml-1" type="submit">
|
||||
<i class="fas fa-search mr-2"></i>Search
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -23,51 +23,52 @@
|
||||
<span class='h5'> Major: {{ current_user.department }}</span>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5>MSU Info</h5>
|
||||
<b>E-Mail:</b><br/>
|
||||
{{ current_user.email }}
|
||||
<br/><br/>
|
||||
|
||||
{# user current_user #}
|
||||
<p class='text-lg-left'>
|
||||
<h5>MSU Info</h5>
|
||||
<b>E-Mail:</b><br/>
|
||||
{{ current_user.email }}
|
||||
<br/><br/>
|
||||
<b>Net ID:</b><br/>
|
||||
{{ current_user.net_id }}
|
||||
<br/><br/>
|
||||
|
||||
<b>Net ID:</b><br/>
|
||||
{{ current_user.net_id }}
|
||||
<br/><br/>
|
||||
<b>MSU ID:</b><br/>
|
||||
{{ current_user.msu_id }}
|
||||
<br/><br/>
|
||||
</div>
|
||||
|
||||
<b>MSU ID:</b><br/>
|
||||
{{ current_user.msu_id }}
|
||||
<br/><br/>
|
||||
<div class="col">
|
||||
<h5>Personal Info</h5>
|
||||
|
||||
<hr>
|
||||
{% if current_user.maiden_name %}
|
||||
<b>Maiden Name:</b><br/>
|
||||
{{ current_user.maiden_name }}
|
||||
<br/><br/>
|
||||
{% endif %}
|
||||
|
||||
<h5>Personal Info</h5>
|
||||
<b>Birth Date:</b><br/>
|
||||
{{ current_user.birth_date }}
|
||||
<br/><br/>
|
||||
|
||||
{% if current_user.maiden_name %}
|
||||
<b>Maiden Name:</b><br/>
|
||||
{{ current_user.maiden_name }}
|
||||
<br/><br/>
|
||||
{% endif %}
|
||||
{% if current_user.sec_email %}
|
||||
<b>Personal E-Mail:</b><br/>
|
||||
{{ current_user.sec_email }}
|
||||
<br/><br/>
|
||||
{% endif %}
|
||||
|
||||
<b>Birth Date:</b><br/>
|
||||
{{ current_user.birth_date }}
|
||||
<br/><br/>
|
||||
<b>Primary Phone:</b><br/>
|
||||
{{ current_user.prim_phone }}
|
||||
<br/><br/>
|
||||
|
||||
{% if current_user.sec_email %}
|
||||
<b>Personal E-Mail:</b><br/>
|
||||
{{ current_user.sec_email }}
|
||||
<br/><br/>
|
||||
{% endif %}
|
||||
|
||||
<b>Primary Phone:</b><br/>
|
||||
{{ current_user.prim_phone }}
|
||||
<br/><br/>
|
||||
|
||||
{% if current_user.sec_phone %}
|
||||
<b>Secondary Phone:</b><br/>
|
||||
{{ current_user.sec_phone }}
|
||||
<br/><br/>
|
||||
{% endif %}
|
||||
{% if current_user.sec_phone %}
|
||||
<b>Secondary Phone:</b><br/>
|
||||
{{ current_user.sec_phone }}
|
||||
<br/><br/>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user