Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
BeHub-web
Project
Project
Details
Activity
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
Dominik Rosiek
BeHub-web
Commits
2e7a4ab7
Commit
2e7a4ab7
authored
Nov 21, 2015
by
Rafal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add login
parent
be4bcf2a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
3 deletions
+95
-3
settings.py
BeHub/BeHub/settings.py
+4
-0
urls.py
BeHub/BeHub/urls.py
+7
-1
bootstrap.min.css
BeHub/Hub/static/css/bootstrap.min.css
+5
-0
login.css
BeHub/Hub/static/css/login.css
+18
-0
login.html
BeHub/Hub/templates/page/login.html
+55
-0
views.py
BeHub/Hub/views.py
+6
-2
No files found.
BeHub/BeHub/settings.py
View file @
2e7a4ab7
...
...
@@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/1.7/ref/settings/
import
os
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'media'
)
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'static'
)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
...
...
@@ -97,3 +99,5 @@ USE_TZ = True
# https://docs.djangoproject.com/en/1.7/howto/static-files/
STATIC_URL
=
'/static/'
MEDIA_URL
=
'/media/'
\ No newline at end of file
BeHub/BeHub/urls.py
View file @
2e7a4ab7
from
django.conf.urls
import
patterns
,
include
,
url
from
django.contrib
import
admin
from
rest_framework
import
routers
from
django.conf.urls.static
import
static
from
BeHub
import
settings
from
Hub
import
views
as
hub_views
from
Hub.views
import
login_page
router
=
routers
.
DefaultRouter
()
router
.
register
(
r'beacons'
,
hub_views
.
BeaconViewSet
)
...
...
@@ -13,8 +16,11 @@ router.register(r'uuid', hub_views.UuidBeaconViewSet)
urlpatterns
=
patterns
(
''
,
url
(
r'^login/$'
,
login_page
),
url
(
r'^api/'
,
include
(
router
.
urls
)),
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^api/uuid/(?P<pk>[0-9]+)/$'
,
hub_views
.
UuidBeaconViewSet
.
as_view
()),
url
(
r'^api/uuid/(?P<pk>[0-9]+)/(?P<category_name>\w+)/$'
,
hub_views
.
UuidBeaconViewSet
.
as_view
()),
)
)
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
urlpatterns
+=
static
(
settings
.
STATIC_URL
,
document_root
=
settings
.
STATIC_ROOT
)
BeHub/Hub/static/css/bootstrap.min.css
0 → 100644
View file @
2e7a4ab7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
BeHub/Hub/static/css/login.css
0 → 100644
View file @
2e7a4ab7
.panel-heading
{
padding
:
5px
15px
;
}
.panel-footer
{
padding
:
1px
15px
;
color
:
#A0A0A0
;
}
.profile-img
{
width
:
96px
;
height
:
96px
;
margin
:
0
auto
10px
;
display
:
block
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
border-radius
:
50%
;
}
\ No newline at end of file
BeHub/Hub/templates/page/login.html
0 → 100644
View file @
2e7a4ab7
{% load staticfiles%}
<link
href=
"{% static 'css/bootstrap.min.css' %}"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/dashboard.css' %}"
/>
<div
class=
"container"
style=
"margin-top:40px"
>
<div
class=
"row"
>
<div
class=
"col-sm-6 col-md-4 col-md-offset-4"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<strong>
Login
</strong>
</div>
<div
class=
"panel-body"
>
<form
role=
"form"
action=
"#"
method=
"POST"
>
<fieldset>
<div
class=
"row"
>
<div
class=
"center-block"
>
<img
class=
"profile-img"
src=
"https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt=
""
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 col-md-10 col-md-offset-1 "
>
<div
class=
"form-group"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
>
<i
class=
"glyphicon glyphicon-user"
></i>
</span>
<input
class=
"form-control"
placeholder=
"username"
name=
"loginname"
type=
"text"
required=
""
autofocus
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
>
<i
class=
"glyphicon glyphicon-lock"
></i>
</span>
<input
class=
"form-control"
placeholder=
"password"
name=
"password"
type=
"password"
value=
""
required=
""
>
</div>
</div>
<div
class=
"form-group"
>
<input
type=
"submit"
class=
"btn btn-lg btn-primary btn-block"
value=
"Entrar"
>
</div>
</div>
</div>
</fieldset>
</form>
</div>
<div
class=
"panel-footer "
>
Não é registrado?
<a
href=
"#"
onClick=
""
>
Clique aqui
</a>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
BeHub/Hub/views.py
View file @
2e7a4ab7
from
django.core.exceptions
import
ObjectDoesNotExist
from
django.shortcuts
import
render
from
django.shortcuts
import
render
,
render_to_response
# Create your views here.
from
rest_framework
import
viewsets
...
...
@@ -66,4 +66,8 @@ class CategoryViewSet(viewsets.ModelViewSet):
API for places
"""
queryset
=
Category
.
objects
.
all
()
serializer_class
=
CategorySerializer
\ No newline at end of file
serializer_class
=
CategorySerializer
def
login_page
(
self
):
return
render_to_response
(
'page/login.html'
,
{})
\ No newline at end of file
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