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
0ab20f3e
Commit
0ab20f3e
authored
Nov 22, 2015
by
Dominik Rosiek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gówno kod
parent
dc23238f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
24 deletions
+93
-24
beacons.html
BeHub/Hub/templates/user_panel/content/beacons.html
+88
-0
dashboard.html
BeHub/Hub/templates/user_panel/content/dashboard.html
+4
-4
maps.html
BeHub/Hub/templates/user_panel/content/maps.html
+1
-20
No files found.
BeHub/Hub/templates/user_panel/content/beacons.html
View file @
0ab20f3e
<div
class=
"container"
>
<a
href=
"#"
onclick=
"showModal2()"
>
asd
</a>
{% for beacon_data in beacon_display %}
{% include 'user_panel/content/beacon_detail.html' %}
{% endfor %}
{% include 'user_panel/content/beacon_detail.html' %}
<!-- Modal -->
<div
class=
"modal fade"
id=
"myModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
Modal title
</h4>
</div>
<div
class=
"modal-body"
id=
"modal-content"
>
</div>
<div
class=
"modal-footer"
id=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-primary"
>
Add to category
</button>
</div>
</div>
</div>
</div>
<script>
function
showModal2
(){
$
(
"#myModal"
).
modal
(
"show"
);
$
(
"#modal-content"
).
html
(
'<form action="/login/" method="post" class="form-signin">
\
<input id="name" type="text" class="form-control" placeholder="Nazwa projektu" required autofocus name="name">
\
<input id="desc" type="text" class="form-control" placeholder="Description" required autofocus name="desc">
\
<input id="uuid" type="text" class="form-control" placeholder="UUID" required autofocus name="uuid">
\
<input id="long" type="text" class="form-control" placeholder="Longitude" required autofocus name="long">
\
<input id="lat" type="text" class="form-control" placeholder="latitude" required autofocus name="lat">
\
</form>'
);
$
(
"#modal-footer"
).
html
(
'<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
\
<button type="button" class="btn btn-primary" id="addProjectBtn">Add project</button>'
);
$
(
"#addProjectBtn"
).
off
(
"click"
);
$
(
"#addProjectBtn"
).
on
(
"click"
,
function
(){
var
name
=
$
(
"#name"
).
val
();
var
desc
=
$
(
"#desc"
).
val
();
var
uuid
=
$
(
"#uuid"
).
val
();
var
long
=
$
(
"#long"
).
val
();
var
lat
=
$
(
"#lat"
).
val
();
var
data
=
{
"beacon_manager"
:
null
,
"name"
:
name
,
"uuid"
:
uuid
,
"description"
:
desc
,
"longitude"
:
long
,
"latitude"
:
lat
,
};
$
.
ajax
({
url
:
"/api/beacons/"
,
type
:
'POST'
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
success
:
function
(
result
)
{
var
data
=
{
"beacon"
:
result
.
url
,
"sites"
:
[]
}
$
.
ajax
({
url
:
"/api/beacon_managers/"
,
type
:
'POST'
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
success
:
function
(
result_beacon
){
return
function
(
result
)
{
result_beacon
[
'beacon_manager'
]
=
result
.
url
;
$
.
ajax
({
url
:
result_beacon
.
url
,
type
:
'PUT'
,
data
:
JSON
.
stringify
(
result_beacon
),
contentType
:
"application/json"
,
success
:
function
(
result
)
{
document
.
location
.
reload
()
}
});
}}(
result
)
});
}
});
});
}
</script>
</div>
\ No newline at end of file
BeHub/Hub/templates/user_panel/content/dashboard.html
View file @
0ab20f3e
...
...
@@ -53,8 +53,8 @@
<div
class=
"modal-body"
id=
"modal-content"
>
<form
action=
"/login/"
method=
"post"
class=
"form-signin"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"Nazwa projektu"
required
autofocus
name=
"name"
>
<textarea
class=
"form-control"
type=
"description"
id=
"article_content"
name=
"content"
placeholder=
"Zawartosc"
maxlength=
"140"
rows=
"7"
></textarea>
<input
id=
"name"
type=
"text"
class=
"form-control"
placeholder=
"Nazwa projektu"
required
autofocus
name=
"name"
>
<textarea
id=
"desc"
class=
"form-control"
type=
"description"
id=
"article_content"
name=
"content"
placeholder=
"Zawartosc"
maxlength=
"140"
rows=
"7"
></textarea>
</form>
</div>
...
...
@@ -67,7 +67,7 @@
var
name
=
$
(
"#name"
).
val
();
var
desc
=
$
(
"#desc"
).
val
();
var
data
=
{
"author"
:
"
http://127.0.0.1:8000/api/users/1
/"
,
"author"
:
"
/api/users/{{ user_id }}
/"
,
"beacon_managers"
:
[],
"name"
:
name
,
"description"
:
desc
...
...
@@ -79,7 +79,7 @@
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
success
:
function
(
result
)
{
alert
(
JSON
.
stringify
(
result
))
window
.
location
.
reload
();
}
});
});
...
...
BeHub/Hub/templates/user_panel/content/maps.html
View file @
0ab20f3e
...
...
@@ -19,23 +19,4 @@
});
</script>
<script
async
defer
src=
"https://maps.googleapis.com/maps/api/js?key=AIzaSyAaYyVEcLFqwKP_VnzfRSIMkWWWrLtMiGQ&signed_in=true"
></script>
<!-- Modal -->
<div
class=
"modal fade"
id=
"myModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
Modal title
</h4>
</div>
<div
class=
"modal-body"
id=
"modal-content"
>
</div>
<div
class=
"modal-footer"
id=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-primary"
>
Add to category
</button>
</div>
</div>
</div>
</div>
src=
"https://maps.googleapis.com/maps/api/js?key=AIzaSyAaYyVEcLFqwKP_VnzfRSIMkWWWrLtMiGQ&signed_in=true"
></script>
\ 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