diff --git a/.env b/.env index 6b111ae9d..0daba83a1 100644 --- a/.env +++ b/.env @@ -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' diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..ae56c489a --- /dev/null +++ b/.vscode/launch.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..c48c3a243 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "\"python.pythonPath\"": "\"Your_venv_path/bin/python\"" + } +} \ No newline at end of file diff --git a/AppStore/urls.py b/AppStore/urls.py index 5355daa5c..9db66d66d 100644 --- a/AppStore/urls.py +++ b/AppStore/urls.py @@ -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/', app.views.view, name='view'), - path('edit/', 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/', app.views.view_pet, name='view_pet'), + path('main_page/sit_pet/interested//', 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/', app.views.view_offer, name='view_offer'), + path('main_page/pending/view_user/', app.views.view_user, name='view_user'), + path('main_page/pending/offer_accepted//', app.views.offer_accepted, name='offer_accepted'), + path('main_page/history/', app.views.history, name = 'history'), + path('main_page/history/give_rating/', app.views.give_rating, name = 'give_rating'), + #path('', app.views.index, name='index'), + #path('add', app.views.add, name='add'), + #path('view/', app.views.view, name='view'), + #path('edit/', app.views.edit, name='edit') ] diff --git a/add_sql.sh b/add_sql.sh index 2304183ff..33de6467f 100755 --- a/add_sql.sh +++ b/add_sql.sh @@ -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 @@ -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 \ No newline at end of file diff --git a/app/static/app/images/pets.jpg b/app/static/app/images/pets.jpg new file mode 100644 index 000000000..8017397e3 Binary files /dev/null and b/app/static/app/images/pets.jpg differ diff --git a/app/templates/app/add.html b/app/templates/app/add.html deleted file mode 100644 index 6000dfbf2..000000000 --- a/app/templates/app/add.html +++ /dev/null @@ -1,26 +0,0 @@ - - -

Add New Customer

- Back to home - -

{{ status|safe }}

- -
- - {% csrf_token %} - -
- -
- -
- - - diff --git a/app/templates/app/edit.html b/app/templates/app/edit.html deleted file mode 100644 index 36da8b2a3..000000000 --- a/app/templates/app/edit.html +++ /dev/null @@ -1,26 +0,0 @@ - - -

Edit {{obj.5}}

- Back to home - -

{{ status|safe }}

- - -
- - {% csrf_token %} - -
- -
- -
- - - diff --git a/app/templates/app/give_rating.html b/app/templates/app/give_rating.html new file mode 100644 index 000000000..23f2e88a6 --- /dev/null +++ b/app/templates/app/give_rating.html @@ -0,0 +1,62 @@ + + +

Leave a rating!

+ + + + + Back to home +

+ +
+ + {% csrf_token %} + +
+ +
+ +
+ + \ No newline at end of file diff --git a/app/templates/app/history.html b/app/templates/app/history.html new file mode 100644 index 000000000..b03436080 --- /dev/null +++ b/app/templates/app/history.html @@ -0,0 +1,102 @@ + + +

Transaction History

+ + Back to home +

+ + Remember to give a rating! + + + + + + + + + + + {% for transactions_nr in history_nr %} + + + + + + + + + + + {% endfor %} +
Job Offer IDPriceLocationDate FromDate ToPet IDPetsitterAction
{{ transactions_nr.0 }} {{ transactions_nr.1 }} {{ transactions_nr.2 }} {{ transactions_nr.3 }} {{ transactions_nr.4 }} {{ transactions_nr.5 }} {{ transactions_nr.6 }} + +
+

+ + Past Transactions + + + + + + + + + + + {% for transactions_r in history_r %} + + + + + + + + + + + + {% endfor %} +
Job Offer IDPriceLocationDate FromDate ToPet IDPetsitterRating
{{ transactions_r.0 }} {{ transactions_r.1 }} {{ transactions_r.2 }} {{ transactions_r.3 }} {{ transactions_r.4 }} {{ transactions_r.5 }} {{ transactions_r.6 }} {{ transactions_r.7 }}
+ + \ No newline at end of file diff --git a/app/templates/app/index.html b/app/templates/app/index.html deleted file mode 100644 index e32368db1..000000000 --- a/app/templates/app/index.html +++ /dev/null @@ -1,33 +0,0 @@ -{% load static %} - - -

Customers in the App Store

- NUS logo
- New customer -

- - - - - - - - {% for cust in records %} - - - - - - - {% endfor %} -
IDFirst NameLast NameAction
{{ cust.5 }} {{ cust.0 }} {{ cust.1 }} - | - - | -
- {% csrf_token %} - - -
- - diff --git a/app/templates/app/interested.html b/app/templates/app/interested.html new file mode 100644 index 000000000..778f20654 --- /dev/null +++ b/app/templates/app/interested.html @@ -0,0 +1,47 @@ + + + +

Offer sent! The owner will get back to you!

+ Back to home + + \ No newline at end of file diff --git a/app/templates/app/login.html b/app/templates/app/login.html new file mode 100644 index 000000000..c0e247adb --- /dev/null +++ b/app/templates/app/login.html @@ -0,0 +1,66 @@ +{% load static %} + + + + Login Page + + + +

Welcome to Petsitting!

+

Login

+
pets
+
+ + {% if not_found %} +
User not found, please try again.
+ {% endif %} + +
+ {% csrf_token %} + + + + +
+ \ No newline at end of file diff --git a/app/templates/app/main_page.html b/app/templates/app/main_page.html new file mode 100644 index 000000000..b9ba9a3f9 --- /dev/null +++ b/app/templates/app/main_page.html @@ -0,0 +1,54 @@ + + +

Main Page

+ +

{{ status|safe }}

+ + + + + + + + + \ No newline at end of file diff --git a/app/templates/app/mypets.html b/app/templates/app/mypets.html new file mode 100644 index 000000000..946504b3e --- /dev/null +++ b/app/templates/app/mypets.html @@ -0,0 +1,68 @@ +{% load static %} + + +

My Pets

+ + Back to home +

+ + + + + + + + {% for animal in pets %} + + + + + + + + {% endfor %} +
Pet NamePet IDTypeBreed
{{ animal.0 }} {{ animal.1 }} {{ animal.2 }} {{ animal.3 }}
+
+

Fun Fact: {{allfact.0}} is the most common breed that have been sat on petsitting

+ + \ No newline at end of file diff --git a/app/templates/app/offer_accepted.html b/app/templates/app/offer_accepted.html new file mode 100644 index 000000000..2c7cfdac0 --- /dev/null +++ b/app/templates/app/offer_accepted.html @@ -0,0 +1,47 @@ + + + +

Offer accepted, please leave a review after the sitting!

+ Back to home + + \ No newline at end of file diff --git a/app/templates/app/pending.html b/app/templates/app/pending.html new file mode 100644 index 000000000..98920246b --- /dev/null +++ b/app/templates/app/pending.html @@ -0,0 +1,67 @@ + + +

Pending Offers

+ + Back to home +

+ + + + + + + {% for pendingoffers in pendingrecords %} + + + + + + {% endfor %} +
Offer IDInterested PetsitterAction
{{ pendingoffers.0 }} {{ pendingoffers.1 }} +
+
+
+
+ + \ No newline at end of file diff --git a/app/templates/app/register_job.html b/app/templates/app/register_job.html new file mode 100644 index 000000000..4cd5bb761 --- /dev/null +++ b/app/templates/app/register_job.html @@ -0,0 +1,63 @@ + + +

Register a new job

+ + Back to home + +

{{ status|safe }}

+ +
+ + {% csrf_token %} + + Price *