Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Boodle
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martina Therese R. Reyes
Boodle
Commits
f255a12a
Commit
f255a12a
authored
May 24, 2022
by
Christine Dela Rosa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cancel buttons for store forms
parent
2c4cb527
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
additem.html
boodlesite/templates/additem.html
+1
-1
startauction.html
boodlesite/templates/startauction.html
+1
-1
storeForm.html
boodlesite/templates/storeForm.html
+1
-1
views.py
main/views.py
+7
-4
No files found.
boodlesite/templates/additem.html
View file @
f255a12a
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
{{ form.as_p }}
{{ form.as_p }}
</div>
</div>
<div
class=
"button-space"
>
<div
class=
"button-space"
>
<button
type=
"button"
class=
"btn btn-danger"
><a
class=
"link-text"
href=
"{% url 'storeid'
request.user.
id %}"
>
Cancel
</a></button>
<button
type=
"button"
class=
"btn btn-danger"
><a
class=
"link-text"
href=
"{% url 'storeid'
current_store.store
id %}"
>
Cancel
</a></button>
<button
type=
"submit"
class=
"btn btn-dark"
name=
"Add Item"
>
Add Item
</button>
<button
type=
"submit"
class=
"btn btn-dark"
name=
"Add Item"
>
Add Item
</button>
</div>
</div>
</form>
</form>
...
...
boodlesite/templates/startauction.html
View file @
f255a12a
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
{{ form.as_p }}
{{ form.as_p }}
</div>
</div>
<div
class=
"button-space"
>
<div
class=
"button-space"
>
<button
type=
"button"
class=
"btn btn-danger"
><a
class=
"link-text"
href=
"{% url 'storeid' request.user.
id %}"
>
Cancel
</a></button>
<button
type=
"button"
class=
"btn btn-danger"
><a
class=
"link-text"
href=
"{% url 'storeid' current_store.store
id %}"
>
Cancel
</a></button>
<button
type=
"submit"
class=
"btn btn-dark"
name=
"savesauction"
>
Save Auction
</button>
<button
type=
"submit"
class=
"btn btn-dark"
name=
"savesauction"
>
Save Auction
</button>
</div>
</div>
</form>
</form>
...
...
boodlesite/templates/storeForm.html
View file @
f255a12a
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
{{ form.as_p }}
{{ form.as_p }}
</div>
</div>
<div
class=
"button-space"
>
<div
class=
"button-space"
>
<button
type=
"button"
class=
"btn btn-danger"
><a
class=
"link-text"
href=
"{% url 'storeid'
request.user.id
%}"
>
Cancel
</a></button>
<button
type=
"button"
class=
"btn btn-danger"
><a
class=
"link-text"
href=
"{% url 'storeid'
current_store
%}"
>
Cancel
</a></button>
<button
type=
"submit"
class=
"btn btn-dark"
name=
"Add Item"
>
Save Changes
</button>
<button
type=
"submit"
class=
"btn btn-dark"
name=
"Add Item"
>
Save Changes
</button>
</div>
</div>
</form>
</form>
...
...
main/views.py
View file @
f255a12a
...
@@ -222,6 +222,7 @@ def mystore(request, pk):
...
@@ -222,6 +222,7 @@ def mystore(request, pk):
'current_store'
:
current_store
,
'current_store'
:
current_store
,
'store_owner'
:
store_owner
,
'store_owner'
:
store_owner
,
'store_items'
:
store_items
,
'store_items'
:
store_items
,
'all_auctions'
:
all_auctions
,
'form'
:
form
'form'
:
form
}
}
...
@@ -268,10 +269,11 @@ def editItem(request, pk):
...
@@ -268,10 +269,11 @@ def editItem(request, pk):
form
=
AddItemForm
(
request
.
POST
,
instance
=
item
)
form
=
AddItemForm
(
request
.
POST
,
instance
=
item
)
if
form
.
is_valid
():
if
form
.
is_valid
():
form
.
save
()
form
.
save
()
return
redirect
(
'storeid'
,
pk
=
current_store
)
return
redirect
(
'storeid'
,
pk
=
current_store
.
storeid
)
context
=
{
context
=
{
'form'
:
form
,
'form'
:
form
,
'current_store'
:
current_store
,
'title'
:
'Edit item information'
'title'
:
'Edit item information'
}
}
...
@@ -285,7 +287,7 @@ def startAuction(request, pk):
...
@@ -285,7 +287,7 @@ def startAuction(request, pk):
They will have to fill in the details of their auction such as when they want it to start and end, and the particular item that is up for grabs.
They will have to fill in the details of their auction such as when they want it to start and end, and the particular item that is up for grabs.
A user also has access to the other parts of the site from here through the navigation bar.
A user also has access to the other parts of the site from here through the navigation bar.
'''
'''
all_auctions
=
Auction
.
objects
.
all
()
current_store
=
Store
.
objects
.
get
(
pk
=
pk
)
current_store
=
Store
.
objects
.
get
(
pk
=
pk
)
store_id
=
current_store
.
storeid
store_id
=
current_store
.
storeid
store_items
=
Item
.
objects
.
filter
(
storeid
=
store_id
)
store_items
=
Item
.
objects
.
filter
(
storeid
=
store_id
)
...
@@ -399,7 +401,7 @@ def editStore(request, pk):
...
@@ -399,7 +401,7 @@ def editStore(request, pk):
'''
'''
store
=
Store
.
objects
.
get
(
storeid
=
pk
)
store
=
Store
.
objects
.
get
(
storeid
=
pk
)
current_store
=
store
.
storeid
current_store
=
store
.
st
git
oreid
form
=
CreateStoreForm
(
instance
=
store
)
form
=
CreateStoreForm
(
instance
=
store
)
if
request
.
method
==
'POST'
:
if
request
.
method
==
'POST'
:
...
@@ -410,6 +412,7 @@ def editStore(request, pk):
...
@@ -410,6 +412,7 @@ def editStore(request, pk):
context
=
{
context
=
{
'form'
:
form
,
'form'
:
form
,
'current_store'
:
current_store
,
'title'
:
'Edit Store Information'
'title'
:
'Edit Store Information'
}
}
...
...
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