Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/53 upgrade to bootstrap 5 #54

Merged
merged 3 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nlp4all/controllers/UserController.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def account(cls):
current_user.email = form.email.data
db_session.commit()
flash("Your account has been updated!", "success")
return redirect(url_for("account"))
return redirect(url_for("user_controller.account"))
if request.method == "GET":
form.username.data = current_user.username
form.email.data = current_user.email
Expand Down
8 changes: 4 additions & 4 deletions nlp4all/views/admin/add_org.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<div class="content-section">
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<fieldset class="mb-3">
<legend class="border-bottom mb-4">{{ legend }}</legend>
<div class="form-group">
{{ form.name.label(class="form-control-label") }}
<div class="mb-3">
{{ form.name.label(class="form-label") }}
{% if form.name.errors %}
{{ form.name(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -20,7 +20,7 @@
{% endif %}
</div>
</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
8 changes: 4 additions & 4 deletions nlp4all/views/admin/manage_categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<div class="content-section">
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<fieldset class="mb-3">
<legend class="border-bottom mb-4">{{ legend }}</legend>
<div class="form-group">
{{ form.twitter_handle.label(class="form-control-label") }}
<div class="mb-3">
{{ form.twitter_handle.label(class="form-label") }}
{% if form.twitter_handle.errors %}
{{ form.twitter_handle(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -19,7 +19,7 @@
{% endif %}
</div>
</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
8 changes: 4 additions & 4 deletions nlp4all/views/analyses/analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@
<!-- <div class="content-section">
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<div class="form-group">
{{ form.choices.label(class="form-control-label")}}<br>
<fieldset class="mb-3">
<div class="mb-3">
{{ form.choices.label(class="form-label")}}<br>
{{ form.choices(class="form-control form-control-lg")}}
{% for error in form.choices.errors %}
<span style="color :red;">[{{ error }}]</span>
{% endfor %}
</div>
</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
12 changes: 6 additions & 6 deletions nlp4all/views/analyses/create_matrix.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
<div class="content-section">
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<fieldset class="mb-3">
<legend class="border-bottom mb-4">Create a new Matrix</legend>


<div class="form-group">
{{ form.categories.label(class="form-control-label")}}<br>
<div class="mb-3">
{{ form.categories.label(class="form-label")}}<br>
{{ form.categories(class="form-control form-control-lg")}}
{% for error in form.categories.errors %}
<span style="color :red;">[{{ error }}]</span>
{% endfor %}
</div>
<div class="form-group">
{{ form.ratio.label(class="form-control-label")}}<br>
<div class="mb-3">
{{ form.ratio.label(class="form-label")}}<br>
{{ form.ratio(class="form-control form-control-lg")}}
{% for error in form.ratio.errors %}
<span style="color :red;">[{{ error }}]</span>
{% endfor %}
</div>
</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
5 changes: 3 additions & 2 deletions nlp4all/views/analyses/matrix_summary.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

<button id="show">Show details</button>
<button id="hide">Hide detals</button>

<button id="show" type="button" class="btn btn-secondary">Show Details</button>
<button id="hide" type="button" class="btn btn-secondary">Hide Details</button>

<div class="content-section" id="matrix-info">

Expand Down
12 changes: 6 additions & 6 deletions nlp4all/views/analyses/matrix_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ <h3>Matrix info</h3>
<h3> Modify parameters </h3>
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<div class="form-group">
{{ form.threshold.label(class="form-control-label")}}<br>
<fieldset class="mb-3">
<div class="mb-3">
{{ form.threshold.label(class="form-label")}}<br>
{{ form.threshold(class="form-control form-control-lg")}}
{% for error in form.threshold.errors %}
<span style="color :red;">[{{ error }}]</span>
{% endfor %}
</div>
<div class="form-group">
{{ form.ratio.label(class="form-control-label")}}<br>
<div class="mb-3">
{{ form.ratio.label(class="form-label")}}<br>
{% if form.ratio.errors %}
{{ form.ratio(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -108,7 +108,7 @@ <h3> Modify parameters </h3>
{{ form.shuffle.label(class="form-check-label") }}
</div>
</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
14 changes: 7 additions & 7 deletions nlp4all/views/analyses/robot.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
{% if not r.retired %}
<form method="POST" action="">
{{ form.add_feature_form.hidden_tag() }}
<fieldset class="form-group col-md-8">
<fieldset class="mb-3 col-md-8">
<legend class="border-bottom mb-4">Add Terms to your Model</legend>
<div class="form-group">
{{ form.add_feature_form.feature.label(class="form-control-label") }}
<div class="mb-3">
{{ form.add_feature_form.feature.label(class="form-label") }}
{% if form.add_feature_form.feature.errors %}
{{ form.add_feature_form.feature(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -77,8 +77,8 @@
{{ form.add_feature_form.feature(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
{{ form.add_feature_form.reasoning.label(class="form-control-label") }}
<div class="mb-3">
{{ form.add_feature_form.reasoning.label(class="form-label") }}
{% if form.add_feature_form.reasoning.errors %}
{{ form.add_feature_form.reasoning(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -92,10 +92,10 @@
</div>

</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.add_feature_form.submit(class="btn btn-outline-info") }}
</div>
<div class="form-group">
<div class="mb-3">
{{ form.run_analysis_form.run_analysis(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
6 changes: 3 additions & 3 deletions nlp4all/views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

<!-- NLP4ALL CSS -->
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css') }}">
<title>{% if title %}{{ title }} - {% endif %}NLP4ALL</title>
<title>{% block title %}{% endblock %} - NLP4ALL</title>
</head>
<body>
<header class="site-header">
<nav class="navbar navbar-expand-md navbar-dark bg-steel fixed-top">
<div class="container">
<a class="navbar-brand mr-4" href="/">Natural Language Processing 4 All</a>
<a class="navbar-brand me-4" href="/">Natural Language Processing 4 All</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggle" aria-controls="navbarToggle" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<div class="navbar-nav me-auto">
</div>
<!-- Navbar Right Side -->
<div class="navbar-nav">
Expand Down
20 changes: 10 additions & 10 deletions nlp4all/views/project/add_project.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<div class="content-section">
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<fieldset class="mb-3">
<legend class="border-bottom mb-4">Create new Project</legend>
<div class="form-group">
{{ form.title.label(class="form-control-label") }}
<div class="mb-3">
{{ form.title.label(class="form-label") }}
{% if form.title.errors %}
{{ form.title(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -18,8 +18,8 @@
{{ form.title(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
{{ form.description.label(class="form-control-label") }}
<div class="mb-3">
{{ form.description.label(class="form-label") }}
{% if form.description.errors %}
{{ form.description(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -31,23 +31,23 @@
{{ form.description(class="form-control ") }}
{% endif %}
</div>
<div class="form-group">
{{ form.organization.label(class="form-control-label")}}<br>
<div class="mb-3">
{{ form.organization.label(class="form-label")}}<br>
{{ form.organization(class="form-control form-control-lg")}}
{% for error in form.organization.errors %}
<span style="color :red;">[{{ error }}]</span>
{% endfor %}
</div>

<div class="form-group">
{{ form.categories.label(class="form-control-label")}}<br>
<div class="mb-3">
{{ form.categories.label(class="form-label")}}<br>
{{ form.categories(class="form-control form-control-lg")}}
{% for error in form.categories.errors %}
<span style="color :red;">[{{ error }}]</span>
{% endfor %}
</div>
</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
16 changes: 8 additions & 8 deletions nlp4all/views/project/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ <h2>My analyses on project {{ project.name }} </h2>
<h2>Create New Analysis</h1>
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<div class="form-group">
{{ form.name.label(class="form-control-label") }}
<fieldset class="mb-3">
<div class="mb-3">
{{ form.name.label(class="form-label") }}
{% if form.name.errors %}
{{ form.name(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -48,15 +48,15 @@ <h2>Create New Analysis</h1>
{{ form.shared(class="form-check-input") }}
{{ form.shared.label(class="form-check-label") }}
</div>
<div class="form-group">
{{ form.annotate.label(class="form-control-label")}}<br>
<div class="mb-3">
{{ form.annotate.label(class="form-label")}}<br>
{{ form.annotate(class="form-control form-control-lg")}}
{% for error in form.annotate.errors %}
<span style="color :red;">[{{ error }}]</span>
{% endfor %}
</div>
<div class="form-group">
{{ form.number.label(class="form-control-label") }}
<div class="mb-3">
{{ form.number.label(class="form-label") }}
{% if form.number.errors %}
{{ form.number(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -70,7 +70,7 @@ <h2>Create New Analysis</h1>
</div>

</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
18 changes: 10 additions & 8 deletions nlp4all/views/user/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ <h2 class="account-heading">{{ current_user.username }}</h2>
</div>
<form method="POST" action="" enctype="multipart/form-data">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<fieldset class="mb-3">
<legend class="border-bottom mb-4">Account Info</legend>
<div class="form-group">
{{ form.username.label(class="form-control-label") }}
<div class="mb-3">
{{ form.username.label(class="form-label") }}

{% if form.username.errors %}
{{ form.username(class="form-control form-control-lg is-invalid") }}
Expand All @@ -26,8 +26,8 @@ <h2 class="account-heading">{{ current_user.username }}</h2>
{{ form.username(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
{{ form.email.label(class="form-control-label") }}
<div class="mb-3">
{{ form.email.label(class="form-label") }}
{% if form.email.errors %}
{{ form.email(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -39,17 +39,19 @@ <h2 class="account-heading">{{ current_user.username }}</h2>
{{ form.email(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
<div class="mb-3">

{{ form.picture.label() }}
{{ form.picture(class="form-control-file") }}
{{ form.picture(class="form-control-file") }} <!-- dropped native form-control-file @TODO -->

{% if form.picture.errors %}
{% for error in form.picture.errors %}
<span class="text-danger">{{ error }}</span></br>
{% endfor %}
{% endif %}
</div>
</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
</div>
</form>
Expand Down
16 changes: 8 additions & 8 deletions nlp4all/views/user/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<div class="content-section">
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<fieldset class="mb-3">
<legend class="border-bottom mb-4">Log In</legend>
<div class="form-group">
{{ form.email.label(class="form-control-label") }}
<div class="mb-3">
{{ form.email.label(class="form-label") }}
{% if form.email.errors %}
{{ form.email(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -18,8 +18,8 @@
{{ form.email(class="form-control form-control-lg") }}
{% endif %}
</div>
<div class="form-group">
{{ form.password.label(class="form-control-label") }}
<div class="mb-3">
{{ form.password.label(class="form-label") }}
{% if form.password.errors %}
{{ form.password(class="form-control form-control-lg is-invalid") }}
<div class="invalid-feedback">
Expand All @@ -36,17 +36,17 @@
{{ form.remember.label(class="form-check-label") }}
</div>
</fieldset>
<div class="form-group">
<div class="mb-3">
{{ form.submit(class="btn btn-outline-info") }}
<small class="text-muted ml-2">
<small class="text-muted ms-2">
<a href="{{ url_for('user_controller.reset_request') }}">Forgot Password?</a>
</small>
</div>
</form>
</div>
<div class="border-top pt-3">
<small class="text-muted">
Need An Account? <a class="ml-2" href="{{ url_for('user_controller.register') }}">Sign Up Now</a>
Need An Account? <a class="ms-1" href="{{ url_for('user_controller.register') }}">Sign Up Now</a>
</small>
</div>
{% endblock content %}
Loading