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
970e5bf7
Commit
970e5bf7
authored
Nov 22, 2015
by
Dominik Rosiek
Browse files
Options
Browse Files
Download
Plain Diff
jest ok
parents
f13a61d7
2fc17d83
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
2436 additions
and
9 deletions
+2436
-9
urls.py
BeHub/BeHub/urls.py
+1
-0
serializers.py
BeHub/Hub/serializers.py
+7
-1
bootstrap.js
BeHub/Hub/static/js/bootstrap.js
+2363
-0
bootstrap.min.js
BeHub/Hub/static/js/bootstrap.min.js
+7
-0
project_detail.js
BeHub/Hub/static/js/project_detail.js
+4
-0
maps.html
BeHub/Hub/templates/user_panel/content/maps.html
+1
-1
project.html
BeHub/Hub/templates/user_panel/content/project.html
+22
-2
base.html
BeHub/Hub/templates/user_panel/default/base.html
+2
-3
views.py
BeHub/Hub/views.py
+10
-2
delete_migrations.py
BeHub/delete_migrations.py
+19
-0
No files found.
BeHub/BeHub/urls.py
View file @
970e5bf7
...
...
@@ -14,6 +14,7 @@ router.register(r'category', hub_views.CategoryViewSet)
router
.
register
(
r'sites'
,
hub_views
.
SiteViewSet
)
router
.
register
(
r'uuid'
,
hub_views
.
UuidBeaconViewSet
)
router
.
register
(
r'users'
,
hub_views
.
UserViewSet
)
router
.
register
(
r'user_project'
,
hub_views
.
UserProjectViewSet
)
urlpatterns
=
patterns
(
''
,
...
...
BeHub/Hub/serializers.py
View file @
970e5bf7
from
rest_framework
import
serializers
from
django.contrib.auth.models
import
User
from
Hub.models
import
Beacon
,
BeaconManager
,
Category
,
Site
from
Hub.models
import
Beacon
,
BeaconManager
,
Category
,
Site
,
UserProject
class
SiteSerializer
(
serializers
.
HyperlinkedModelSerializer
):
...
...
@@ -17,6 +17,12 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
fields
=
(
'id'
,
'url'
)
class
UserProjectSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
Meta
:
model
=
UserProject
fields
=
(
'id'
,
'url'
,
'author'
,
'beacons'
,
'name'
,
'description'
)
class
BeaconSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
Meta
:
...
...
BeHub/Hub/static/js/bootstrap.js
0 → 100644
View file @
970e5bf7
This diff is collapsed.
Click to expand it.
BeHub/Hub/static/js/bootstrap.min.js
0 → 100644
View file @
970e5bf7
This diff is collapsed.
Click to expand it.
BeHub/Hub/static/js/project_detail.js
0 → 100644
View file @
970e5bf7
$
(
'#myTabs a'
).
click
(
function
(
e
)
{
e
.
preventDefault
()
$
(
this
).
tab
(
'show'
)
})
\ No newline at end of file
BeHub/Hub/templates/user_panel/content/maps.html
View file @
970e5bf7
BeHub/Hub/templates/user_panel/content/project.html
View file @
970e5bf7
...
...
@@ -4,9 +4,29 @@
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-md-10 col-md-offset-1"
>
<ul
class=
"nav nav-tabs nav-justified"
>
<li
class=
"active"
><a
data-toggle=
"tab"
href=
"#beacons"
>
Twoje beacony
</a></li>
<li><a
data-toggle=
"tab"
href=
"#map"
>
Mapa
</a></li>
</ul>
<div
class=
"tab-content"
>
<div
id=
"beacons"
class=
"tab-pane fade in active"
>
<h3>
HOME
</h3>
<p>
Some content.
</p>
</div>
<div
id=
"map"
class=
"tab-pane fade"
>
{% include 'user_panel/content/maps.html' %}
</div>
</div>
</div>
</div>
{% endblock content %}
\ No newline at end of file
BeHub/Hub/templates/user_panel/default/base.html
View file @
970e5bf7
...
...
@@ -10,7 +10,6 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/dashboard.css' %}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/login.css' %}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/footer.css' %}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/left_bar.css' %}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/font-awesome.min.css' %}"
/>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
...
...
@@ -23,7 +22,6 @@
<body>
{% include 'user_panel/default/user_bar.html' %}
{% include 'user_panel/default/left_bar.html' %}
<div
id=
"wrap"
style=
"margin-top:20px;"
>
...
...
@@ -34,6 +32,7 @@
<script
src=
"{% static 'js/hobby_detail.js' %}"
></script>
<script
src=
"{% static 'js/map.js' %}"
></script>
<
<script
src=
"{% static 'js/project_detail.js' %}"
></script>
<script
src=
"{% static 'js/bootstrap.js' %}"
></script>
</body>
</html>
\ No newline at end of file
BeHub/Hub/views.py
View file @
970e5bf7
...
...
@@ -11,9 +11,9 @@ from rest_framework import viewsets
import
rest_framework
from
rest_framework.response
import
Response
from
rest_framework.views
import
APIView
from
Hub.models
import
Beacon
,
BeaconManager
,
Site
,
Category
from
Hub.models
import
Beacon
,
BeaconManager
,
Site
,
Category
,
UserProject
from
Hub.serializers
import
BeaconSerializer
,
BeaconManagerSerializer
,
SiteSerializer
,
CategorySerializer
,
\
UserSerializer
UserSerializer
,
UserProjectSerializer
class
BeaconViewSet
(
viewsets
.
ModelViewSet
):
...
...
@@ -38,6 +38,14 @@ class BeaconManagerViewSet(viewsets.ModelViewSet):
queryset
=
BeaconManager
.
objects
.
all
()
serializer_class
=
BeaconManagerSerializer
class
UserProjectViewSet
(
viewsets
.
ModelViewSet
):
"""
API for places
"""
queryset
=
UserProject
.
objects
.
all
()
serializer_class
=
UserProjectSerializer
class
SiteViewSet
(
viewsets
.
ModelViewSet
):
"""
API for places
...
...
BeHub/delete_migrations.py
0 → 100644
View file @
970e5bf7
#remove_migrations.py
"""
Run this file from a Django =1.7 project root.
Removes all migration files from all apps in a project.
"""
from
unipath
import
Path
this_file
=
Path
(
__file__
)
.
absolute
()
current_dir
=
this_file
.
parent
dir_list
=
current_dir
.
listdir
()
for
paths
in
dir_list
:
migration_folder
=
paths
.
child
(
'migrations'
)
if
migration_folder
.
exists
():
list_files
=
migration_folder
.
listdir
()
for
files
in
list_files
:
split
=
files
.
components
()
if
split
[
-
1
]
!=
Path
(
'__init__.py'
):
files
.
remove
()
\ 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