Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
49310fcf
Commit
49310fcf
authored
Jan 11, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nicer topbar navigation + debug redirects with next
parent
e045ac6a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
11 deletions
+60
-11
main.py
services/main.py
+19
-5
comex_user.css
static/css/comex_user.css
+8
-1
logo_m_bleu-header.png
static/img/logo_m_bleu-header.png
+0
-0
base_layout.html
templates/base_layout.html
+33
-5
No files found.
services/main.py
View file @
49310fcf
...
...
@@ -61,6 +61,9 @@ app = Flask("services",
static_folder
=
path
.
join
(
config
[
'HOME'
],
"static"
),
template_folder
=
path
.
join
(
config
[
'HOME'
],
"templates"
))
if
not
app
.
config
[
'SERVER_NAME'
]:
app
.
config
[
'SERVER_NAME'
]
=
"localhost"
app
.
config
[
'DEBUG'
]
=
(
config
[
'LOG_LEVEL'
]
==
"DEBUG"
)
app
.
config
[
'SECRET_KEY'
]
=
'TODO fill secret key for sessions for login'
...
...
@@ -153,7 +156,7 @@ def rootstub():
"""
pass
# /services/
index
/
# /services/
demo
/
@
app
.
route
(
config
[
'PREFIX'
]
+
'/demo/'
)
def
demo
():
"""
...
...
@@ -165,7 +168,6 @@ def demo():
# current_user=current_user
)
# /services/
@
app
.
route
(
config
[
'PREFIX'
]
+
'/'
)
def
services
():
...
...
@@ -174,7 +176,17 @@ def services():
# /services/test
@
app
.
route
(
config
[
'PREFIX'
]
+
'/test'
,
methods
=
[
'GET'
])
def
test_stuff
():
return
render_template
(
"message.html"
,
message
=
url_for
(
'rootstub'
,
_external
=
True
))
return
render_template
(
"message.html"
,
message
=
"<br/>"
.
join
([
"dir(req)"
+
str
(
dir
(
request
)),
"requrl:"
+
request
.
url
,
"req.host:"
+
request
.
host
,
"req.url_root:"
+
request
.
url_root
,
"req.base_url:"
+
request
.
base_url
,
"req.full_path:"
+
request
.
full_path
,
"req.access_route:"
+
str
(
request
.
access_route
)
])
)
# /services/api/aggs
@
app
.
route
(
config
[
'PREFIX'
]
+
config
[
'API_ROUTE'
]
+
'/aggs'
)
...
...
@@ -268,6 +280,8 @@ def login():
next_url
=
request
.
args
.
get
(
'next'
,
None
)
if
next_url
:
print
(
"next_url"
,
next_url
)
print
(
"app.config.servername"
,
app
.
config
[
'SERVER_NAME'
])
safe_flag
=
is_safe_url
(
next_url
,
request
.
host_url
)
if
safe_flag
:
# normal next_url
...
...
@@ -275,7 +289,7 @@ def login():
else
:
# server name is different than ours
# in next_url so we won't go there
return
(
redirect
(
url_for
(
'rootstub'
,
_external
=
True
)
))
return
(
redirect
(
'/'
))
else
:
# no specified next_url => profile
return
redirect
(
url_for
(
'profile'
,
_external
=
True
))
...
...
@@ -306,7 +320,7 @@ def login():
@
app
.
route
(
config
[
'PREFIX'
]
+
config
[
'USR_ROUTE'
]
+
'/logout/'
)
def
logout
():
logout_user
()
return
redirect
(
url_for
(
'
rootstub
'
,
_external
=
True
))
return
redirect
(
url_for
(
'
demo
'
,
_external
=
True
))
# /services/user/profile/
...
...
static/css/comex_user.css
View file @
49310fcf
...
...
@@ -73,7 +73,14 @@ input.readonly {
color
:
#554
;
}
#mainpagelink
:hover
{
.navlink
{
font-size
:
1.2em
;
font-weight
:
bold
;
margin
:
.2em
0
0
.4em
;
}
.navlink
:hover
{
background-color
:
transparent
!important
;
}
...
...
static/img/logo_m_bleu-header.png
0 → 100644
View file @
49310fcf
21.7 KB
templates/base_layout.html
View file @
49310fcf
...
...
@@ -45,15 +45,43 @@
<body>
<div
class=
"topbar"
style=
"opacity: 0.9
3
;"
>
<div
class=
"topbar"
style=
"opacity: 0.9;"
>
<div
class=
"topbar-inner"
>
<div
class=
"container-fluid"
>
<a
class=
"brand"
href=
"http://www.iscpif.fr"
>
<span
class=
"glyphicon glyphicon-home white"
></i></a>
<ul
class=
"white nav navbar-nav"
>
<ul
class=
"white nav navbar-nav navbar-left"
>
<li>
<a
id=
"mainpagelink"
href=
"/"
>
<strong>
Complex systems community explorer
</strong></a>
<a
class=
"brand"
href=
"https://iscpif.fr/"
>
<img
height=
"25px"
src=
"{{ url_for('static', filename='img/logo_m_bleu-header.png') }}"
</
a
>
</li>
<li>
<a
class=
"brand"
href=
"/"
>
<span
class=
"glyphicon glyphicon-home white"
></span>
Community Explorer
</a>
</li>
</ul>
<ul
class=
"white nav navbar-nav navbar-right"
>
{% if current_user and current_user.info %}
<li>
<a
class=
"navlink"
href=
"/services/user/profile"
>
Your Profile
</a>
</li>
<li>
<a
class=
"navlink"
href=
'/explorerjs.html?type="uid"&nodeidparam="{{ current_user.uid }}"'
>
Your Map
</a>
</li>
<li>
<a
class=
"navlink"
href=
'/print_scholar_directory.php?query={{ current_user.uid }}'
>
Your Neighboor Stats
</a>
</li>
<li>
<a
class=
"navlink"
href=
'/services/user/logout/'
>
Logout
</a>
</li>
{% else %}
<li>
<a
class=
"navlink"
href=
"/services/user/register"
>
Register
</a>
</li>
<li>
<a
class=
"navlink"
href=
"/services/user/login"
>
Login
</a>
</li>
{% endif %}
</ul>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment