Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d08e801
Update .env
geraldw12 Mar 14, 2022
c965fb3
Update .env
geraldw12 Mar 16, 2022
91b3eaf
Update tests.py
geraldw12 Mar 16, 2022
1132a60
Update apps.py
geraldw12 Mar 16, 2022
742174f
Update apps.py
geraldw12 Mar 17, 2022
c5a87bd
Update apps.py
geraldw12 Mar 17, 2022
d64d46e
Update apps.py
geraldw12 Mar 17, 2022
260bec9
Update .env
geraldw12 Mar 18, 2022
ac72ad3
Update views.py
geraldw12 Mar 30, 2022
93026f9
Update views.py
geraldw12 Mar 30, 2022
4a75e84
Update views.py
geraldw12 Mar 30, 2022
e41ad2c
Update views.py
geraldw12 Mar 30, 2022
0b8d95c
Update views.py
geraldw12 Mar 30, 2022
e719bcb
Update index.html
geraldw12 Mar 30, 2022
3a5bdee
add login page
geraldw12 Apr 1, 2022
387eae0
Enter
jonaslwq Apr 2, 2022
0642379
Enter
jonaslwq Apr 2, 2022
ee1f19f
Enter
jonaslwq Apr 2, 2022
9a3a5f1
nter
jonaslwq Apr 2, 2022
27b1da3
Enter
jonaslwq Apr 2, 2022
5a81d59
Enter
jonaslwq Apr 2, 2022
386dac7
Enter
jonaslwq Apr 2, 2022
eca922d
Enter
jonaslwq Apr 2, 2022
7c7e0a6
Enter
jonaslwq Apr 2, 2022
24bec5f
Enter
jonaslwq Apr 2, 2022
1ab7dd2
Enter
jonaslwq Apr 3, 2022
21fb0f9
Enter
jonaslwq Apr 3, 2022
fd67396
Enter
jonaslwq Apr 4, 2022
8f8efb6
Enter
jonaslwq Apr 4, 2022
957de20
Enter
jonaslwq Apr 6, 2022
d4a84cf
Enter
jonaslwq Apr 6, 2022
12afe74
Enter
jonaslwq Apr 6, 2022
2622927
eNTER
jonaslwq Apr 6, 2022
1d983b4
Enter
jonaslwq Apr 7, 2022
4261c71
add styling
siewkit Apr 7, 2022
ae44e5e
FINAL
jonaslwq Apr 7, 2022
5610240
Final
jonaslwq Apr 7, 2022
8dfd6ae
Final
jonaslwq Apr 7, 2022
652c1c4
Final
jonaslwq Apr 7, 2022
ee37275
final2
jonaslwq Apr 7, 2022
edd6eb7
sql changes
jonaslwq Apr 7, 2022
4027963
Merge branch 'Jonas' of https://github.com/geraldw12/Petsitting into …
jonaslwq Apr 7, 2022
8a97e9a
post aar
jonaslwq Apr 7, 2022
b13b218
edit to pending table
jonaslwq Apr 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ DEBUG = True
RUN_LOCAL_DB = True

##### Local database ######
LOCAL_DB_NAME='appstore'
LOCAL_DB_NAME='petsitting'
LOCAL_DB_USER='postgres'
# Leave the below empty if you haven't set up a local password
LOCAL_DB_PASSWORD='postgres'
LOCAL_DB_PASSWORD='baboon13'

##### Heroku database ######
DB_HOST=
DB_NAME=
DB_USER=
DB_PORT=
DB_PASSWORD=
DB_HOST='ec2-3-212-45-192.compute-1.amazonaws.com'
DB_NAME='dcgs0k2jb4ro3j'
DB_USER='zbuggbupzzuxul'
DB_PORT='5432'
DB_PASSWORD='4d8fc3397c4bdeadd1cff710320d96fcb0cd61c4f827a48346f05b93b96e45eb'
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "pwa-chrome",
"request": "launch",
"name": "Open index.html",
"file": "c:\\Users\\jonas\\Petsitting\\app\\templates\\app\\index.html"
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"\"python.pythonPath\"": "\"Your_venv_path/bin/python\""
}
}
25 changes: 20 additions & 5 deletions AppStore/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,30 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include

import app.views


urlpatterns = [
path('admin/', admin.site.urls),
path('', app.views.index, name='index'),
path('add', app.views.add, name='add'),
path('view/<str:id>', app.views.view, name='view'),
path('edit/<str:id>', app.views.edit, name='edit'),
path('', app.views.login, name = 'login'),
path('main_page/', app.views.main_page, name='main_page'),
path('main_page/register_job/', app.views.register_job, name = 'register_job'),
path('main_page/sit_pet/', app.views.sit_pet, name='sit_pet'),
path('main_page/sit_pet/view_pet/<str:petid>', app.views.view_pet, name='view_pet'),
path('main_page/sit_pet/interested/<str:offerid>/', app.views.interested, name='interested'),
path('register_user/', app.views.register_user, name = 'register_user'),
path('main_page/register_pet/', app.views.register_pet, name = 'register_pet'),
path('main_page/mypets/', app.views.mypets, name='mypets'),
path('main_page/pending/', app.views.pending, name='pending'),
path('main_page/pending/view_offer/<str:offerid>', app.views.view_offer, name='view_offer'),
path('main_page/pending/view_user/<str:username>', app.views.view_user, name='view_user'),
path('main_page/pending/offer_accepted/<str:offerid>/<str:petsitter>', app.views.offer_accepted, name='offer_accepted'),
path('main_page/history/', app.views.history, name = 'history'),
path('main_page/history/give_rating/<str:offerid>', app.views.give_rating, name = 'give_rating'),
#path('', app.views.index, name='index'),
#path('add', app.views.add, name='add'),
#path('view/<str:id>', app.views.view, name='view'),
#path('edit/<str:id>', app.views.edit, name='edit')
]
16 changes: 11 additions & 5 deletions add_sql.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Construct the URI from the .env
DB_HOST=''
DB_NAME=''
DB_USER=''
DB_PORT=''
DB_PASSWORD=''
DB_HOST='localhost'
DB_NAME='prosgres'
DB_USER='postgrs'
DB_PORT='5432'
DB_PASSWORD='baboon13'

while IFS= read -r line
do
Expand Down Expand Up @@ -33,3 +33,9 @@ psql ${URI} -f sql/AppStoreSchema.sql
psql ${URI} -f sql/AppStoreCustomers.sql
psql ${URI} -f sql/AppStoreGames.sql
psql ${URI} -f sql/AppStoreDownloads.sql
psql ${URI} -f sql/PetsittingSchema.sql
psql ${URI} -f sql/Petsittingjoboffer.sql
psql ${URI} -f sql/Petsittingpending.sql
psql ${URI} -f sql/Petsittingpet.sql
psql ${URI} -f sql/Petsittingportfolio.sql
psql ${URI} -f sql/Petsittingtransaction.sql
Binary file added app/static/app/images/pets.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 0 additions & 26 deletions app/templates/app/add.html

This file was deleted.

26 changes: 0 additions & 26 deletions app/templates/app/edit.html

This file was deleted.

62 changes: 62 additions & 0 deletions app/templates/app/give_rating.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<html>
<body>
<h1>Leave a rating!</h1>

<style>

Body {
font-family: Calibri, Helvetica, sans-serif;
background-color: AntiqueWhite;
}
button {
background-color: black;
width: 100%;
color: white;
padding: 15px;
font-size: 15;
margin: 10px 0px;
border: none;
cursor: pointer;
}

input[type=text], input[type=password] {
width: 100%;
margin: 8px 0;
padding: 12px 20px;
display: inline-block;
border: 2px solid green;
box-sizing: border-box;
}
button:hover {
opacity: 0.7;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
margin: 10px 5px;
}


.container {
padding: 25px;


}
</style>


<a href="/main_page/">Back to home</a>
<br><br>
<!-- Create a Form -->
<form method="POST">
<!-- Security token by Django -->
{% csrf_token %}
<!-- form -->
<div id="div_id_first_name" class="control-group"> <label for="id_first_name" class="control-label requiredField">
Rating(1/2/3/4/5)<span class="asteriskField">*</span> </label> <div class="controls"> <input type="text" name="rating" maxlength="16" class="textinput textInput" required="" id="id_rating"> </div> </div>

<br>
<button type="submit" value="Add">Add</button>
</form>
</body>
</html>
102 changes: 102 additions & 0 deletions app/templates/app/history.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<html>
<body>
<h1>Transaction History</h1>
<style>

Body {
font-family: Calibri, Helvetica, sans-serif;
background-color: AntiqueWhite;
}
button {
background-color: black;
width: 100%;
color: white;
padding: 15px;
font-size: 15;
margin: 10px 0px;
border: none;
cursor: pointer;
}

input[type=text], input[type=password] {
width: 100%;
margin: 8px 0;
padding: 12px 20px;
display: inline-block;
border: 2px solid green;
box-sizing: border-box;
}
button:hover {
opacity: 0.7;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
margin: 10px 5px;
}


.container {
padding: 25px;


}
</style>
<a href="/main_page/">Back to home</a>
<br/><br/>
<table border=1>
<thead> Remember to give a rating!<thead>
<thead>
<th>Job Offer ID</th>
<th>Price</th>
<th>Location</th>
<th>Date From</th>
<th>Date To</th>
<th>Pet ID</th>
<th>Petsitter</th>
<th>Action</th>
</thead>
{% for transactions_nr in history_nr %}
<tr>

<td> {{ transactions_nr.0 }} </td>
<td> {{ transactions_nr.1 }} </td>
<td> {{ transactions_nr.2 }} </td>
<td> {{ transactions_nr.3 }} </td>
<td> {{ transactions_nr.4 }} </td>
<td> {{ transactions_nr.5 }} </td>
<td> {{ transactions_nr.6 }} </td>
<td><a href="give_rating/{{transactions_nr.0}}"><button>Give Rating</button></a><td>

</tr>
{% endfor %}
</table>
<br/><br/>
<table border=1>
<thead> Past Transactions<thead>
<thead>
<th>Job Offer ID</th>
<th>Price</th>
<th>Location</th>
<th>Date From</th>
<th>Date To</th>
<th>Pet ID</th>
<th>Petsitter</th>
<th>Rating</th>
</thead>
{% for transactions_r in history_r %}
<tr>

<td> {{ transactions_r.0 }} </td>
<td> {{ transactions_r.1 }} </td>
<td> {{ transactions_r.2 }} </td>
<td> {{ transactions_r.3 }} </td>
<td> {{ transactions_r.4 }} </td>
<td> {{ transactions_r.5 }} </td>
<td> {{ transactions_r.6 }} </td>
<td> {{ transactions_r.7 }} </td>
</tr>
{% endfor %}
</table>
</body>
</html>
33 changes: 0 additions & 33 deletions app/templates/app/index.html

This file was deleted.

Loading