Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #280

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Dev #280

Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion 0-setup_web_static.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# sets up the web servers for the deployment of web_static

# testing this motherfucking feature for fucks sake
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install nginx
Expand Down
Empty file modified 1-pack_web_static.py
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions 2-do_deploy_web_static.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
archive to the web servers
"""

"""
Testing github sync
"""

from fabric.api import put, run, env
from os.path import exists
env.hosts = ['142.44.167.228', '144.217.246.195']
Expand Down
Empty file modified 3-deploy_web_static.py
100644 → 100755
Empty file.
4 changes: 1 addition & 3 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This file lists all individuals having contributed content to the repository.


Jennifer Huang <[email protected]>
Alexa Orrico <[email protected]>
Joann Vuong <[email protected]>
Ergi Lama <[email protected]>
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,5 @@ EOF all create destroy help quit show update
No known bugs at this time.

## Authors
Alexa Orrico - [Github](https://github.com/alexaorrico) / [Twitter](https://twitter.com/alexa_orrico)
Jennifer Huang - [Github](https://github.com/jhuang10123) / [Twitter](https://twitter.com/earthtojhuang)
Jhoan Zamora - [Github](https://github.com/jzamora5) / [Twitter](https://twitter.com/JhoanZamora10)
David Ovalle - [Github](https://github.com/Nukemenonai) / [Twitter](https://twitter.com/disartDave)

Second part of Airbnb: Joann Vuong
## License
Public Domain. No copy write protection.
Ergi Lama - [Github](https://github.com/Ergi004)
Izabela Nelaj - [Github](https://github.com/izabela9)
Empty file modified api/v1/views/amenities.py
100644 → 100755
Empty file.
Empty file modified api/v1/views/cities.py
100644 → 100755
Empty file.
Empty file modified api/v1/views/users.py
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions berti.berti
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
berti
Binary file added models/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added models/__pycache__/amenity.cpython-311.pyc
Binary file not shown.
Binary file added models/__pycache__/base_model.cpython-311.pyc
Binary file not shown.
Binary file added models/__pycache__/city.cpython-311.pyc
Binary file not shown.
Binary file added models/__pycache__/place.cpython-311.pyc
Binary file not shown.
Binary file added models/__pycache__/review.cpython-311.pyc
Binary file not shown.
Binary file added models/__pycache__/state.cpython-311.pyc
Binary file not shown.
Binary file added models/__pycache__/user.cpython-311.pyc
Binary file not shown.
Binary file added models/engine/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions qdrant.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aaa
16 changes: 16 additions & 0 deletions script
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Define source and destination directories
src_dir="web_flask"
dest_dir="web_dynamic"

# Check if destination directory exists, if not create it
if [ ! -d "$dest_dir" ]; then
mkdir -p "$dest_dir"
fi

# Copy the specified files and directories
cp -r "$src_dir/static" "$dest_dir"
cp "$src_dir/templates/100-hbnb.html" "$dest_dir"
cp "$src_dir/__init__.py" "$dest_dir"
cp "$src_dir/100-hbnb.py" "$dest_dir"
1 change: 1 addition & 0 deletions stage.com
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Testing Repo Sync in Stage
1 change: 1 addition & 0 deletions test.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testing
1 change: 1 addition & 0 deletions testing.exe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testing
4 changes: 4 additions & 0 deletions tests/test_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Contains the class TestConsoleDocs
"""

"""
Testinggggg
"""

import console
import inspect
import pep8
Expand Down
Empty file modified tests/test_models/test_base_model.py
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions uore.exe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uore bacaaa
78 changes: 78 additions & 0 deletions web_dynamic/0-hbnb.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../static/styles/4-common.css">
<link rel="stylesheet" type="text/css" href="../static/styles/3-header.css">
<link rel="stylesheet" type="text/css" href="../static/styles/3-footer.css">
<link rel="stylesheet" type="text/css" href="../static/styles/6-filters.css">
<link type="text/css" rel="stylesheet" href="../static/styles/8-places.css">
<link rel="icon" href="../static/images/icon.png" />
<title>HBnB</title>
</head>
<body>
<header>
<div class="logo"></div>
</header>
<div class="container">
<section class="filters">
<div class="locations">
<h3>States</h3>
<h4>&nbsp;</h4>
<div class="popover">
<ul>
{% for state in states %}
<li>
<h2>{{ state[0].name }}:</h2>
<ul>
{% for city in state[1] %}
<li>{{ city.name }}</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="amenities">
<h3>Amenities</h3>
<h4>&nbsp;</h4>
<div class="popover">
<ul>
{% for amenity in amenities %}
<li>{{ amenity.name }}</li>
{% endfor %}
</ul>
</div>
</div>
<button type="button">Search</button>
</section>
<div class="placesh1"><h1>Places</h1></div>
<section class="places">
<!-- <h1>Places</h1> -->
{% for place in places %}
<article>
<div class="title_box">
<h2>{{ place.name }}</h2>
<div class="price_by_night">${{ place.price_by_night }}</div>
</div>
<div class="information">
<div class="max_guest">{{ place.max_guest }} Guest{% if place.max_guest != 1 %}s{% endif %}</div>
<div class="number_rooms">{{ place.number_rooms }} Bedroom{% if place.number_rooms != 1 %}s{% endif %}</div>
<div class="number_bathrooms">{{ place.number_bathrooms }} Bathroom{% if place.number_bathrooms != 1 %}s{% endif %}</div>
</div>
<div class="user">
<b>Owner:</b> {{ place.user.first_name }} {{ place.user.last_name }}
</div>
<div class="description">
{{ place.description | safe }}
</div>
</article>
{% endfor %}
</section>
</div>
<footer>
<p>Holberton School</p>
</footer>
</body>
</html>
45 changes: 45 additions & 0 deletions web_dynamic/0-hbnb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/python3
""" Starts a Flash Web Application """
from models import storage
from models.state import State
from models.city import City
from models.amenity import Amenity
from models.place import Place
from os import environ
from flask import Flask, render_template
app = Flask(__name__)
# app.jinja_env.trim_blocks = True
# app.jinja_env.lstrip_blocks = True


@app.teardown_appcontext
def close_db(error):
""" Remove the current SQLAlchemy Session """
storage.close()


@app.route('/0-hbnb/', strict_slashes=False)
def hbnb():
""" HBNB is alive! """
states = storage.all(State).values()
states = sorted(states, key=lambda k: k.name)
st_ct = []

for state in states:
st_ct.append([state, sorted(state.cities, key=lambda k: k.name)])

amenities = storage.all(Amenity).values()
amenities = sorted(amenities, key=lambda k: k.name)

places = storage.all(Place).values()
places = sorted(places, key=lambda k: k.name)

return render_template('100-hbnb.html',
states=st_ct,
amenities=amenities,
places=places)


if __name__ == "__main__":
""" Main Function """
app.run(host='0.0.0.0', port=5000)
Empty file added web_dynamic/__init__.py
Empty file.
Binary file added web_dynamic/static/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web_dynamic/static/images/icon_bath.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web_dynamic/static/images/icon_bed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web_dynamic/static/images/icon_group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web_dynamic/static/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions web_dynamic/static/styles/3-footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
footer {
position: fixed;
background: white;
height: 60px;
width: 100%;
bottom: 0;
border-top: 1px solid #CCCCCC;
}
footer p {
position: absolute;
text-align: center;
top: 10%;
bottom: 0;
right: 0;
left: 0;
}
11 changes: 11 additions & 0 deletions web_dynamic/static/styles/3-header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
header {
background: white;
height: 70px;
width: 100%;
border-bottom: 1px solid #CCCCCC;
}
header .logo {
background: url("../images/logo.png") no-repeat;
left: 20px;
height: 100%;
}
11 changes: 11 additions & 0 deletions web_dynamic/static/styles/4-common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
body {
margin: 0;
padding: 0;
color: #484848;
font-size: 14px;
font-family: Circular,"Helvetica Neue",Helvetica,Arial,sans-serif;
}
body .container {
max-width: 1000px;
margin: 30px auto;
}
103 changes: 103 additions & 0 deletions web_dynamic/static/styles/6-filters.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
.container .filters {
position: relative;
background: white;
height: 70px;
width: 100%;
border: 1px solid #DDDDDD;
border-radius: 4px;
}
button {
position: absolute;
font-size: 18px;
background: #FF5A5F;
color: #FFFFFF;
height: 48px;
width: 20%;
border-style: none;
border-radius: 4px;
top: 15%;
right: 30px;
}
button:hover {
opacity: 0.9;
}
.filters div {
display: inline-grid;
}
.filters h2 {
margin-left: 15%;
margin-top: 0;
margin-bottom: 0;
font-weight: 600;
}
.filters h3 {
margin-left: 15%;
margin-bottom: 0;
font-weight: 600;
}
.filters h4 {
margin-left: 15%;
margin-top: 0;
font-weight: 400;
font-size: 14px;
}
.locations {
height: 100%;
width: 25%;
border-right: 1px solid #DDDDDD;
}
.amenities {
height: 100%;
width: 25%;
}

.popover {
visibility: hidden;
width: 100%;
border: 1px solid #DDDDDD;
border-radius: 4px;
background: #FAFAFA;
padding-bottom: 15px;
height: 300px;
overflow-y: scroll;
scrollbar-width: none;
max-height: 300px;
}

.popover::-webkit-scrollbar{
width: 0px;
}

.amenities .popover {
padding: 10px 0;
margin-left: -5px;
margin-top: 0%;
}

.amenities .popover ul{
margin: 0px;
}

.locations .popover {
margin-top: 0%;
}
.popover ul {
list-style-type: none;
padding-bottom: 10px;
padding-left: 10px;
}
.popover ul li{
padding: 4px;
padding-left: 10px;
}

.popover ul h2{
margin-top: 1.5%;
margin-bottom: 5%;
margin-left: 0px;
}

.amenities:hover .popover,
.locations:hover .popover {
visibility: visible;
}
Loading