Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
KawowyDzienniczek
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
Rafal
KawowyDzienniczek
Commits
59e8eea1
Commit
59e8eea1
authored
Sep 15, 2016
by
lizonr1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new views with .html
parent
b3d10a77
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
183 additions
and
0 deletions
+183
-0
forms.py
KawowyDzienniczek/App/page/forms.py
+41
-0
beacon_detail.html
...wyDzienniczek/App/page/templates/panel/beacon_detail.html
+20
-0
beacon_form.html
KawowyDzienniczek/App/page/templates/panel/beacon_form.html
+20
-0
beacon_list.html
KawowyDzienniczek/App/page/templates/panel/beacon_list.html
+17
-0
promotion_confirm_delete.html
...ek/App/page/templates/panel/promotion_confirm_delete.html
+4
-0
promotion_detail.html
...zienniczek/App/page/templates/panel/promotion_detail.html
+22
-0
promotion_form.html
...yDzienniczek/App/page/templates/panel/promotion_form.html
+20
-0
promotion_set_detail.html
...niczek/App/page/templates/panel/promotion_set_detail.html
+21
-0
user_detail.html
KawowyDzienniczek/App/page/templates/panel/user_detail.html
+18
-0
No files found.
KawowyDzienniczek/App/page/forms.py
0 → 100644
View file @
59e8eea1
from
django
import
forms
from
django.contrib.auth
import
authenticate
from
django.contrib.auth.forms
import
AuthenticationForm
from
django.contrib.auth.models
import
User
from
django.core.exceptions
import
ObjectDoesNotExist
from
django.core.exceptions
import
ValidationError
from
App.loyaltyMe.models
import
Place
,
Beacon
from
App.promotion.models
import
Promotion
class
EmailAuthenticationForm
(
AuthenticationForm
):
def
clean_username
(
self
):
username
=
self
.
data
[
'username'
]
if
'@'
in
username
:
try
:
username
=
User
.
objects
.
get
(
email
=
username
)
.
username
except
ObjectDoesNotExist
:
raise
ValidationError
(
self
.
error_messages
[
'invalid_login'
],
code
=
'invalid_login'
,
params
=
{
'username'
:
self
.
username_field
.
verbose_name
},
)
return
username
class
PlaceForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Place
fields
=
'__all__'
exclude
=
[
'owners'
,
'promotion'
,
'offer'
,
'screen_img'
,
'logo_img'
,
'localization'
]
def
__init__
(
self
,
user
,
*
args
,
**
kwargs
):
super
(
PlaceForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
[
'beacon'
]
.
queryset
=
Beacon
.
objects
.
filter
(
user
=
user
)
class
PromotionForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Promotion
exclude
=
[
'status'
,
'code'
]
\ No newline at end of file
KawowyDzienniczek/App/page/templates/panel/beacon_detail.html
0 → 100644
View file @
59e8eea1
{% extends 'panel/base.html' %}
{% block content %}
Witaj {{ user }} w panelu Kawowego Dzienniczka.
<hr>
{{ beacon.name }}
<BR>
{{ beacon.description }}
<BR>
{{ beacon.uuid }}
<BR>
{{ beacon.major }}
<BR>
{{ beacon.minor }}
<BR>
<BR><hr>
<a
href=
"/beacon"
>
Wróć
</a><BR>
<a
href=
"/panel"
>
Panel
</a>
<BR>
{% endblock content %}
\ No newline at end of file
KawowyDzienniczek/App/page/templates/panel/beacon_form.html
0 → 100644
View file @
59e8eea1
{% extends 'panel/base.html' %}
{% block content %}
Witaj {{ user }} w panelu dodawania beacona
<hr>
<form
action=
""
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Save"
/>
</form>
<BR><hr>
<a
href=
"/place"
>
Wróć
</a><BR>
<a
href=
"/panel"
>
Panel
</a>
<BR>
{% endblock content %}
\ No newline at end of file
KawowyDzienniczek/App/page/templates/panel/beacon_list.html
0 → 100644
View file @
59e8eea1
{% extends 'panel/base.html' %}
{% block content %}
Witaj {{ user }} w panelu Kawowego Dzienniczka.
<hr>
{% for beacon in object_list %}
<a
href=
"/beacon/{{ beacon.id }}"
>
{{ beacon }}
</a><BR>
{% endfor %}
<BR><hr>
<a
href=
"/beacon/add"
>
Dodaj beacon
</a><BR>
<a
href=
"/panel"
>
Panel
</a>
<BR>
{% endblock content %}
\ No newline at end of file
KawowyDzienniczek/App/page/templates/panel/promotion_confirm_delete.html
0 → 100644
View file @
59e8eea1
<form
action=
""
method=
"post"
>
{% csrf_token %}
<p>
Are you sure you want to delete "{{ object }}"?
</p>
<input
type=
"submit"
value=
"Confirm"
/>
</form>
\ No newline at end of file
KawowyDzienniczek/App/page/templates/panel/promotion_detail.html
0 → 100644
View file @
59e8eea1
{% extends 'panel/base.html' %}
{% block content %}
Witaj {{ user }} w panelu Kawowego Dzienniczka.
<hr>
Promotion name: {{ promotion.name }}
<BR>
{{ promotion.description }}
<BR>
{{ promotion.code }}
<BR>
{{ promotion.img }}
<BR>
{{ promotion.status }}
<BR>
{{ promotion.task }}
<BR>
{{ promotion.left_number }}
<BR>
{{ promotion.start_date }}
<BR>
{{ promotion.end_date }}
<BR>
<BR><hr>
<a
href=
"/panel"
>
Panel
</a>
<BR>
{% endblock content %}
\ No newline at end of file
KawowyDzienniczek/App/page/templates/panel/promotion_form.html
0 → 100644
View file @
59e8eea1
{% extends 'panel/base.html' %}
{% block content %}
Witaj {{ user }} w panelu dodawania promocji
<hr>
<form
action=
""
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Save"
/>
</form>
<BR><hr>
<a
href=
"/place"
>
Wróć
</a><BR>
<a
href=
"/panel"
>
Panel
</a>
<BR>
{% endblock content %}
\ No newline at end of file
KawowyDzienniczek/App/page/templates/panel/promotion_set_detail.html
0 → 100644
View file @
59e8eea1
{% extends 'panel/base.html' %}
{% block content %}
Witaj {{ user }} w panelu Kawowego Dzienniczka.
<hr>
Promotion Set Name: {{ promotionset.name }}
<BR>
{% for promotion in promotionset.promotions.all %}
Promocja:
<a
href=
"/promotion/{{ promotion.id }}"
>
{{ promotion }}
</a><BR>
<a
href=
"/promotion/{{ promotion.id }}/delete"
>
Usun
</a><BR>
{% endfor %}
<BR><hr>
<a
href=
"./promotion/add"
>
Dodaj promocje
</a><BR>
<a
href=
"/panel"
>
Panel
</a>
<BR>
{% endblock content %}
\ No newline at end of file
KawowyDzienniczek/App/page/templates/panel/user_detail.html
0 → 100644
View file @
59e8eea1
{% extends 'panel/base.html' %}
{% block content %}
Witaj {{ user }} w panelu Kawowego Dzienniczka.
<hr>
{{ userprofile.user.username }}
<BR>
{{ userprofile.user.email }}
<BR>
<img
src=
"{{ userprofile.photo }}"
>
<BR>
<BR><hr>
<a
href=
"/panel"
>
Panel
</a>
<BR>
{% endblock content %}
\ 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