-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sign in, sign out, dashboard, admin initial
- Loading branch information
1 parent
0f57eb2
commit a478f26
Showing
29 changed files
with
716 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
from flask import Blueprint, jsonify | ||
from flask_admin.contrib.sqla import ModelView | ||
|
||
from application.models import User | ||
from application import db | ||
from application.models import ( | ||
Fund, | ||
FundLedger, | ||
FundUser, | ||
FundUserLedger, | ||
Investment, | ||
Line, | ||
LineVote, | ||
Result, | ||
Strategy, | ||
User, | ||
UserLedger | ||
) | ||
from flask_login import login_required | ||
|
||
admin_bp = Blueprint('admin_bp', __name__, template_folder='templates') | ||
|
||
|
||
@admin_bp.route('/admin', methods=['GET', 'POST']) | ||
@login_required | ||
def admin(): | ||
""" | ||
Admin end point. | ||
TODO :: This DEFINITELY needs to be updated. We'll | ||
want to build out an actual admin end point with | ||
`flask_admin`, most likely. For now, this just | ||
returns all of the user data from the database. | ||
""" | ||
users = User.query.all() | ||
users_json = [{ | ||
'id': u.id, | ||
'first': u.first_name, | ||
'last': u.last_name, | ||
'email': u.email_address, | ||
'pass': u.password | ||
} for u in users] | ||
|
||
return jsonify(users_json) | ||
def add_admin_views(administrator): | ||
"""Register views to admin""" | ||
administrator.add_view(ModelView(Fund, session=db.session, name='Fund')) | ||
administrator.add_view(ModelView(FundLedger, session=db.session, name='FundLedger')) | ||
administrator.add_view(ModelView(FundUser, session=db.session, name='FundUser')) | ||
administrator.add_view(ModelView(FundUserLedger, session=db.session, name='FundUserLedger')) | ||
administrator.add_view(ModelView(Investment, session=db.session, name='Investment')) | ||
administrator.add_view(ModelView(Line, session=db.session, name='Line')) | ||
administrator.add_view(ModelView(LineVote, session=db.session, name='LineVote')) | ||
administrator.add_view(ModelView(Result, session=db.session, name='Result')) | ||
administrator.add_view(ModelView(Strategy, session=db.session, name='Strategy')) | ||
administrator.add_view(ModelView(User, session=db.session, name='User')) | ||
administrator.add_view(ModelView(UserLedger, session=db.session, name='UserLedger')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,106 @@ | ||
{% extends "layout.html" %} | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
|
||
{% include "navigation-default.html" %} | ||
<div class="container"> | ||
<h1>{{body}}</h1> | ||
</div> | ||
|
||
<main role="main"> | ||
<section class="jumbotron text-center"> | ||
<div class="container"> | ||
<h1 class="jumbotron-heading">Bet smarter with groups.</h1> | ||
<p class="lead text-muted">Something short and leading about the collection below—its contents, the creator, etc. Make it short and sweet, but not too short so folks don't simply skip over it entirely.</p> | ||
<p> | ||
<a href="#" class="btn btn-primary my-2">Our funds</a> | ||
<a href="#" class="btn btn-secondary my-2">Our strategies</a> | ||
</p> | ||
</div> | ||
</section> | ||
<div class="album py-5 bg-light"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-4"> | ||
<div class="card mb-4 box-shadow"> | ||
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=35585c&fg=eceeef&text=NFL Money Lines" alt="Card image cap"> | ||
<div class="card-body"> | ||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<div class="btn-group"> | ||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="card mb-4 box-shadow"> | ||
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=51599c&fg=eceeef&text=Prop Bets Only" alt="Card image cap"> | ||
<div class="card-body"> | ||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<div class="btn-group"> | ||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="card mb-4 box-shadow"> | ||
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=61495c&fg=eceeef&text=Underdog Cash Flow" alt="Card image cap"> | ||
<div class="card-body"> | ||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<div class="btn-group"> | ||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="card mb-4 box-shadow"> | ||
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=84695c&fg=eceeef&text=NBA Over Unders" alt="Card image cap"> | ||
<div class="card-body"> | ||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<div class="btn-group"> | ||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="card mb-4 box-shadow"> | ||
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=25495c&fg=eceeef&text=Political Action" alt="Card image cap"> | ||
<div class="card-body"> | ||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<div class="btn-group"> | ||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="card mb-4 box-shadow"> | ||
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=73768c&fg=eceeef&text=Bet The House" alt="Card image cap"> | ||
<div class="card-body"> | ||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<div class="btn-group"> | ||
<button type="button" class="btn btn-sm btn-outline-secondary">View</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
|
||
{% include "footer-default.html" %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
</div> | ||
</div |
2 changes: 2 additions & 0 deletions
2
application/loggedin/templates/dashboard-container-start.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<div class="container-fluid"> | ||
<div class="row"> |
Oops, something went wrong.