Skip to content

Commit

Permalink
revised relative directory
Browse files Browse the repository at this point in the history
  • Loading branch information
lunaceee committed Jun 24, 2017
1 parent ead0b0f commit 672fcb0
Show file tree
Hide file tree
Showing 231 changed files with 106 additions and 63 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="static/css/images/binocular-big.png">
# <img src="front_end/src/static/css/images/binocular-big.png">

# Wes World
## Descriptions
Expand Down Expand Up @@ -28,19 +28,19 @@ I also added a caching validation engine to discriminate expired listing URLs.

## <a name="features"></a>Features
### Animation on Landing Page
<img src="static/css/images/gifs/ww_landing_page.gif" />
<img src="front_end/src/static/css/images/gifs/ww_landing_page.gif" />

### Search Page
<img src="static/css/images/gifs/ww_search_page.gif" />
<img src="front_end/src/static/css/images/gifs/ww_search_page.gif" />

### Log in window
<img src="static/css/images/gifs/ww_log_in_page.gif" />
<img src="front_end/src/static/css/images/gifs/ww_log_in_page.gif" />

### Saving an Ensemble
<img src="static/css/images/gifs/ww_save_ensemble.gif" />
<img src="front_end/src/static/css/images/gifs/ww_save_ensemble.gif" />

### User Profile Page
<img src="static/css/images/gifs/ww_user_profile.gif" />
<img src="front_end/src/static/css/images/gifs/ww_user_profile.gif" />

### <a name="installation"></a>Setup/Installation

Expand Down
81 changes: 38 additions & 43 deletions back_end/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@
@app.route('/')
def show_home_page():
"""Show home page."""
return render_template('homepage.html')
logo_url = "../front_end/static/css/images/binocular-big.svg"
slogan_url = "../front_end/static/css/images/ww-slogan-2.svg"

return jsonify(
logo_url=logo_url,
slogan_url=slogan_url
)

@app.route('/nav')
def nav_bar():
"""testing purpose"""
return render_template('nav.html',
user_id=session.get('logged_in'),
logged_in=bool(session.get('logged_in')))


@app.route('/register', methods=["GET", "POST"])
def register_page():
Expand Down Expand Up @@ -76,21 +78,20 @@ def register_page():
email = request.form.get("email")
password = sha256_crypt.encrypt((str(request.form.get("password"))))
pic = random.choice(profile_pic)
print "pic_url", pic
email_re = re.search(r".+@.+\..+", email) # email validation
username_re = re.search(r"[^@]+", username)

if not username_re:
flash("Username can not contain '@' sign.")
return rediect("/search")
return redirect("/search")

if not email_re:
flash("Please use legal email format.")
return rediect("/search")
return redirect("/search")

if User.query.filter(User.username == username).first():
flash("That username is already taken, please choose another one.")
return rediect("/search")
return redirect("/search")

# flash("Thanks for registering!")
new_user = User(username=username, email=email, password=password, pic=pic)
Expand All @@ -104,11 +105,6 @@ def register_page():
return rediect("/search")


# @app.route('/login')
# def show_login_form():
# """Show login form."""
# return render_template('log_in.html')


@app.route('/login', methods=['POST'])
def process_form():
Expand Down Expand Up @@ -181,7 +177,7 @@ def show_user_profile(user_id):
for pair_lst in movie_ensemble.values():
pair_lst.sort(reverse=True)

return render_template('user_profile.html',
return render_template('../front_end/templates/user_profile.html',
pic=pic,
email=email,
username=username,
Expand Down Expand Up @@ -420,33 +416,32 @@ def search():

print "COLORS", colors

return render_template('search.html',
movie_list=movie_list,
color_dict=color_dict,
user_id=session.get('logged_in'),
logged_in=bool(session.get('logged_in')),
chosen_movie=session.get('movie'),
movie_names=movie_names,
t_img_url=best_dict['top'][1],
bo_img_url=best_dict['bottom'][1],
s_img_url=best_dict['shoe'][1],
a_img_url=best_dict['accessory'][1],
b_img_url=best_dict['bag'][1],
d_img_url=best_dict['dress'][1],
top_listing=top_listing,
bottom_listing=bottom_listing,
accessory_listing=accessory_listing,
shoe_listing=shoe_listing,
bag_listing=bag_listing,
dress_listing=dress_listing,
movie_id=movie.id,
top_color=top_color,
dress_color=dress_color,
bottom_color=bottom_color,
accessory_color=accessory_color,
shoe_color=shoe_color,
bag_color=bag_color
)
return jsonify(dict(movie_list=movie_list,
color_dict=color_dict,
user_id=session.get('logged_in'),
logged_in=bool(session.get('logged_in')),
chosen_movie=session.get('movie'),
movie_names=movie_names,
t_img_url=best_dict['top'][1],
bo_img_url=best_dict['bottom'][1],
s_img_url=best_dict['shoe'][1],
a_img_url=best_dict['accessory'][1],
b_img_url=best_dict['bag'][1],
d_img_url=best_dict['dress'][1],
top_listing=top_listing,
bottom_listing=bottom_listing,
accessory_listing=accessory_listing,
shoe_listing=shoe_listing,
bag_listing=bag_listing,
dress_listing=dress_listing,
movie_id=movie.id,
top_color=top_color,
dress_color=dress_color,
bottom_color=bottom_color,
accessory_color=accessory_color,
shoe_color=shoe_color,
bag_color=bag_color)
)

@app.route('/blacklist', methods=['POST'])
def blacklist():
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ flaskapp:
- PGPASSWORD

volumes:
- ./back_end /app
- ./back_end:/app

ports:
# HOST : CONTAINER
- "8877:5000"
- "5000:5000"

react:

Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ flaskapp:
ports:
# HOST : CONTAINER
- "80:80"
- "5000:5000"

links:
- pg
Expand All @@ -29,8 +30,8 @@ react:
# HOST : CONTAINER
- "3000:3000"

links:
- flaskapp
#links:
#- flaskapp

environment:
- VIRTUAL_HOST=wesworld.us
5 changes: 3 additions & 2 deletions front_end/src/App.js → front_end/src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import {Nav} from "Nav";
import logo from '../static/css/images/binocular.svg';
import '../App.css';

class App extends Component {
render() {
Expand Down
18 changes: 18 additions & 0 deletions front_end/src/components/Nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React, { Component } from 'react';
import logo from "../static/css/images/binocular.svg"

class Nav extends Component {
render(){
return(
<div className="Nav">
<img src={logo} className="App-logo" alt="logo"/>
<div>
<button>Register</button>
<button>Log in</button>
</div>
</div>
);
}
}

export default Nav;
12 changes: 12 additions & 0 deletions front_end/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Wes World</title>
<link rel="stylesheet" href="style/style.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/48938155eb24b4ccdde09426066869504c6dab3c/dist/css/bootstrap.min.css">
</head>
<body>
<div id="container">
</div>
</body>
</html>
7 changes: 5 additions & 2 deletions front_end/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import App from './components/App';
import registerServiceWorker from './registerServiceWorker';
import './index.css';

ReactDOM.render(<App />, document.getElementById('root'));

ReactDOM.render(
<App />,
document.getElementById('root'));
registerServiceWorker();
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 672fcb0

Please sign in to comment.