Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
e327f0c8
Commit
e327f0c8
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Make the about page the index page.
parent
d6f60e42
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/auth/views.py
+6
-6
6 additions, 6 deletions
app/auth/views.py
app/main/views.py
+6
-9
6 additions, 9 deletions
app/main/views.py
app/templates/base.html.j2
+2
-2
2 additions, 2 deletions
app/templates/base.html.j2
app/templates/main/index.html.j2
+0
-0
0 additions, 0 deletions
app/templates/main/index.html.j2
with
14 additions
and
17 deletions
app/auth/views.py
+
6
−
6
View file @
e327f0c8
...
@@ -18,7 +18,7 @@ def login():
...
@@ -18,7 +18,7 @@ def login():
login_user
(
user
,
form
.
remember_me
.
data
)
login_user
(
user
,
form
.
remember_me
.
data
)
next
=
request
.
args
.
get
(
'
next
'
)
next
=
request
.
args
.
get
(
'
next
'
)
if
next
is
None
or
not
next
.
startswith
(
'
/
'
):
if
next
is
None
or
not
next
.
startswith
(
'
/
'
):
next
=
url_for
(
'
main.
index
'
)
next
=
url_for
(
'
main.
dashboard
'
)
return
redirect
(
next
)
return
redirect
(
next
)
flash
(
'
Invalid username or password.
'
)
flash
(
'
Invalid username or password.
'
)
return
render_template
(
'
auth/login.html.j2
'
,
form
=
form
,
title
=
'
Log in
'
)
return
render_template
(
'
auth/login.html.j2
'
,
form
=
form
,
title
=
'
Log in
'
)
...
@@ -35,7 +35,7 @@ def logout():
...
@@ -35,7 +35,7 @@ def logout():
@auth.route
(
'
/register
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@auth.route
(
'
/register
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
register
():
def
register
():
if
not
current_user
.
is_anonymous
:
if
not
current_user
.
is_anonymous
:
return
redirect
(
url_for
(
'
main.
index
'
))
return
redirect
(
url_for
(
'
main.
dashboard
'
))
form
=
RegistrationForm
()
form
=
RegistrationForm
()
if
form
.
validate_on_submit
():
if
form
.
validate_on_submit
():
user
=
User
(
email
=
form
.
email
.
data
.
lower
(),
user
=
User
(
email
=
form
.
email
.
data
.
lower
(),
...
@@ -61,7 +61,7 @@ def confirm(token):
...
@@ -61,7 +61,7 @@ def confirm(token):
flash
(
'
You have confirmed your account. Thanks!
'
)
flash
(
'
You have confirmed your account. Thanks!
'
)
else
:
else
:
flash
(
'
The confirmation link is invalid or has expired.
'
)
flash
(
'
The confirmation link is invalid or has expired.
'
)
return
redirect
(
url_for
(
'
main.
index
'
))
return
redirect
(
url_for
(
'
main.
dashboard
'
))
@auth.before_app_request
@auth.before_app_request
...
@@ -91,13 +91,13 @@ def resend_confirmation():
...
@@ -91,13 +91,13 @@ def resend_confirmation():
send_email
(
current_user
.
email
,
'
Confirm Your Account
'
,
'
auth/email/confirm
'
,
send_email
(
current_user
.
email
,
'
Confirm Your Account
'
,
'
auth/email/confirm
'
,
user
=
current_user
,
token
=
token
)
user
=
current_user
,
token
=
token
)
flash
(
'
A new confirmation email has benn sent to you by email.
'
)
flash
(
'
A new confirmation email has benn sent to you by email.
'
)
return
redirect
(
url_for
(
'
main.
index
'
))
return
redirect
(
url_for
(
'
main.
dashboard
'
))
@auth.route
(
'
/reset
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@auth.route
(
'
/reset
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
password_reset_request
():
def
password_reset_request
():
if
not
current_user
.
is_anonymous
:
if
not
current_user
.
is_anonymous
:
return
redirect
(
url_for
(
'
main.
index
'
))
return
redirect
(
url_for
(
'
main.
dashboard
'
))
form
=
PasswordResetRequestForm
()
form
=
PasswordResetRequestForm
()
if
form
.
validate_on_submit
():
if
form
.
validate_on_submit
():
user
=
User
.
query
.
filter_by
(
email
=
form
.
email
.
data
.
lower
()).
first
()
user
=
User
.
query
.
filter_by
(
email
=
form
.
email
.
data
.
lower
()).
first
()
...
@@ -116,7 +116,7 @@ def password_reset_request():
...
@@ -116,7 +116,7 @@ def password_reset_request():
@auth.route
(
'
/reset/<token>
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@auth.route
(
'
/reset/<token>
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
password_reset
(
token
):
def
password_reset
(
token
):
if
not
current_user
.
is_anonymous
:
if
not
current_user
.
is_anonymous
:
return
redirect
(
url_for
(
'
main.
index
'
))
return
redirect
(
url_for
(
'
main.
dashboard
'
))
form
=
PasswordResetForm
()
form
=
PasswordResetForm
()
if
form
.
validate_on_submit
():
if
form
.
validate_on_submit
():
if
User
.
reset_password
(
token
,
form
.
password
.
data
):
if
User
.
reset_password
(
token
,
form
.
password
.
data
):
...
...
This diff is collapsed.
Click to expand it.
app/main/views.py
+
6
−
9
View file @
e327f0c8
...
@@ -10,7 +10,12 @@ import hashlib
...
@@ -10,7 +10,12 @@ import hashlib
import
os
import
os
@main.route
(
'
/
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@main.route
(
'
/
'
)
def
index
():
return
render_template
(
'
main/index.html.j2
'
,
title
=
'
Opaque
'
)
@main.route
(
'
/dashboard
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@login_required
@login_required
def
dashboard
():
def
dashboard
():
create_corpus_form
=
CreateCorpusForm
()
create_corpus_form
=
CreateCorpusForm
()
...
@@ -44,18 +49,10 @@ def dashboard():
...
@@ -44,18 +49,10 @@ def dashboard():
)
)
@main.route
(
'
/about
'
)
def
about
():
return
render_template
(
'
main/about.html.j2
'
,
title
=
'
About
'
)
@main.route
(
'
/admin
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@main.route
(
'
/admin
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@login_required
@login_required
@admin_required
@admin_required
def
for_admins_only
():
def
for_admins_only
():
"""
View for admin page only accesible by admins.
"""
users
=
User
.
query
.
order_by
(
User
.
username
).
all
()
users
=
User
.
query
.
order_by
(
User
.
username
).
all
()
items
=
[
AdminUserItem
(
u
.
username
,
u
.
email
,
u
.
role_id
,
u
.
confirmed
)
for
u
in
users
]
items
=
[
AdminUserItem
(
u
.
username
,
u
.
email
,
u
.
role_id
,
u
.
confirmed
)
for
u
in
users
]
table
=
AdminUserTable
(
items
)
table
=
AdminUserTable
(
items
)
...
...
This diff is collapsed.
Click to expand it.
app/templates/base.html.j2
+
2
−
2
View file @
e327f0c8
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<div
class=
"navbar-fixed"
>
<div
class=
"navbar-fixed"
>
<nav>
<nav>
<div
class=
"nav-wrapper"
>
<div
class=
"nav-wrapper"
>
<a
href=
"{{ url_for('main.
dashboard
') }}"
class=
"brand-logo"
><i
class=
"material-icons"
>
opacity
</i>
Opaque
</a>
<a
href=
"{{ url_for('main.
index
') }}"
class=
"brand-logo"
><i
class=
"material-icons"
>
opacity
</i>
Opaque
</a>
<a
href=
"#"
data-target=
"slide-out"
class=
"sidenav-trigger"
><i
class=
"material-icons"
>
menu
</i></a>
<a
href=
"#"
data-target=
"slide-out"
class=
"sidenav-trigger"
><i
class=
"material-icons"
>
menu
</i></a>
<ul
class=
"right hide-on-med-and-down"
>
<ul
class=
"right hide-on-med-and-down"
>
<li><a
id=
"nav-notifications"
class=
"dropdown-trigger"
href=
"#!"
data-target=
"nav-notifications-dropdown"
><i
class=
"material-icons"
>
notifications
</i></a></li>
<li><a
id=
"nav-notifications"
class=
"dropdown-trigger"
href=
"#!"
data-target=
"nav-notifications-dropdown"
><i
class=
"material-icons"
>
notifications
</i></a></li>
...
@@ -60,8 +60,8 @@
...
@@ -60,8 +60,8 @@
</span>
</span>
</div>
</div>
</li>
</li>
<li><a
href=
"{{ url_for('main.index') }}"
><i
class=
"material-icons"
>
opacity
</i>
Opaque
</a></li>
<li><a
href=
"{{ url_for('main.dashboard') }}"
><i
class=
"material-icons"
>
dashboard
</i>
Dashboard
</a></li>
<li><a
href=
"{{ url_for('main.dashboard') }}"
><i
class=
"material-icons"
>
dashboard
</i>
Dashboard
</a></li>
<li><a
href=
"{{ url_for('main.about') }}"
><i
class=
"material-icons"
>
info
</i>
About
</a></li>
<li
class=
"no-padding"
>
<li
class=
"no-padding"
>
<ul
class=
"collapsible collapsible-accordion"
>
<ul
class=
"collapsible collapsible-accordion"
>
<li>
<li>
...
...
This diff is collapsed.
Click to expand it.
app/templates/main/
about
.html.j2
→
app/templates/main/
index
.html.j2
+
0
−
0
View file @
e327f0c8
File moved
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment