Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
c562defd
Commit
c562defd
authored
Jan 07, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'samuel'
Integration login page (thx Samuel)
parents
88ad0861
d22c90d5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
1 deletion
+128
-1
urls.py
gargantext_web/urls.py
+2
-0
views.py
gargantext_web/views.py
+25
-0
authentication.html
templates/authentication.html
+100
-0
menu.html
templates/menu.html
+1
-1
No files found.
gargantext_web/urls.py
View file @
c562defd
...
@@ -16,6 +16,8 @@ urlpatterns = patterns('',
...
@@ -16,6 +16,8 @@ urlpatterns = patterns('',
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^login/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^login/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^grappelli/'
,
include
(
'grappelli.urls'
)),
url
(
r'^grappelli/'
,
include
(
'grappelli.urls'
)),
url
(
r'^auth/$'
,
views
.
login_user
),
# User Home view
# User Home view
url
(
r'^$'
,
views
.
home
),
url
(
r'^$'
,
views
.
home
),
...
...
gargantext_web/views.py
View file @
c562defd
...
@@ -27,6 +27,31 @@ from parsing.FileParsers import *
...
@@ -27,6 +27,31 @@ from parsing.FileParsers import *
# SOME FUNCTIONS
# SOME FUNCTIONS
from
django.http
import
*
from
django.shortcuts
import
render_to_response
,
redirect
from
django.template
import
RequestContext
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth
import
authenticate
,
login
,
logout
def
login_user
(
request
):
logout
(
request
)
username
=
password
=
''
print
(
request
)
if
request
.
POST
:
username
=
request
.
POST
[
'username'
]
password
=
request
.
POST
[
'password'
]
user
=
authenticate
(
username
=
username
,
password
=
password
)
if
user
is
not
None
:
if
user
.
is_active
:
login
(
request
,
user
)
return
HttpResponseRedirect
(
'/projects/'
)
return
render_to_response
(
'authentication.html'
,
context_instance
=
RequestContext
(
request
))
def
query_to_dicts
(
query_string
,
*
query_args
):
def
query_to_dicts
(
query_string
,
*
query_args
):
"""Run a simple query and produce a generator
"""Run a simple query and produce a generator
that returns the results as a bunch of dictionaries
that returns the results as a bunch of dictionaries
...
...
templates/authentication.html
0 → 100644
View file @
c562defd
<html>
<body
class=
"grp-login"
>
<head>
<link
href=
"/static/grappelli/jquery/ui/css/custom-theme/jquery-ui-1.10.3.custom.min.css"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<link
href=
"/static/grappelli/stylesheets/screen.css"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<link
href=
"/static/grappelli/stylesheets/mueller/grid/output.css"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
<script
src=
"/static/grappelli/jquery/jquery-1.9.1.min.js"
type=
"text/javascript"
></script>
<script
src=
"/static/grappelli/jquery/ui/js/jquery-ui-1.10.3.custom.min.js"
type=
"text/javascript"
></script>
<!-- Grappelli Minified -->
<script
src=
"/static/grappelli/js/grappelli.min.js"
type=
"text/javascript"
></script>
</head>
<div
id=
"grp-container"
>
<!-- HEADER -->
<header
id=
"grp-header"
class=
""
>
<!-- NAVIGATION -->
<div
id=
"grp-navigation"
>
<h1
id=
"grp-admin-title"
>
Gargantext
</h1>
<!-- Nav-Global -->
</div>
</header>
<!-- CONTENT -->
<article
id=
"grp-content"
class=
""
>
<!-- CONTENT TITLE -->
<header
id=
"grp-content-title"
>
<h1>
Log in
</h1>
</header>
<!-- CONTENT-CONTAINER -->
<div
id=
"grp-content-container"
>
<div
class=
"g-d-c g-d-10 g-centered"
>
<form
action=
"/auth/"
method=
"post"
><input
type=
'hidden'
name=
'csrfmiddlewaretoken'
value=
'Yopwc8YatA3C68kSevZX9upoXdIcZzPn'
/>
<fieldset
class=
"grp-module grp-module-login"
>
<h1>
<span
class=
"grp-admin-title"
>
Gargantext
</span>
<span
class=
"grp-current-page"
>
Login
</span>
</h1>
<div
class=
"grp-module"
>
{% block main %}
<div
id=
"login"
>
<form
class=
"form-horizontal"
name=
"LoginForm"
action=
"/auth/"
method=
"post"
>
{% csrf_token %}
{% if next %}
<input
type=
"hidden"
name=
"next"
value=
"{{ next }}"
/>
{% endif %}
<div
class=
"grp-row"
>
<label
class=
"control-label"
for=
"username"
>
Username
</label>
<input
type=
"text"
id=
"username"
name=
"username"
placeholder=
"Username"
>
</div>
<div
class=
"grp-row grp-connected"
>
<label
class=
"control-label"
for=
"password"
>
Password
</label>
<input
type=
"password"
name=
"password"
id=
"password"
placeholder=
"Password"
>
</div>
</div>
</fieldset>
<div
class=
"grp-module grp-submit-row"
>
<ul>
<li><input
type=
"submit"
class=
"grp-button grp-default"
value=
"Log in"
/></li>
</ul>
</div>
</form>
</div>
{% endblock %}
</div>
</div>
</article>
</div>
<script
type=
"text/javascript"
>
(
function
(
$
)
{
$
(
window
).
load
(
function
(){
$
(
'#id_username'
).
focus
();
});
})(
grp
.
jQuery
);
</script>
</body>
</html>
\ No newline at end of file
templates/menu.html
View file @
c562defd
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</a>
</a>
<ul
class=
"dropdown-menu"
>
<ul
class=
"dropdown-menu"
>
<li><a
tabindex=
"-1"
href=
"/a
dmin/logout
/"
>
Login
</a></li>
<li><a
tabindex=
"-1"
href=
"/a
uth
/"
>
Login
</a></li>
<li><a
tabindex=
"-1"
href=
"#"
>
Profile
</a></li>
<li><a
tabindex=
"-1"
href=
"#"
>
Profile
</a></li>
<li
class=
"divider"
></li>
<li
class=
"divider"
></li>
<li><a
tabindex=
"-1"
href=
"#"
>
Help
</a></li>
<li><a
tabindex=
"-1"
href=
"#"
>
Help
</a></li>
...
...
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