README.md 5.08 KB
Newer Older
Renfred Harper's avatar
Renfred Harper committed
1
What's Open
Renfred Harper's avatar
Renfred Harper committed
2
===
Tyler Hallada's avatar
Tyler Hallada committed
3

Tyler Hallada's avatar
Tyler Hallada committed
4
5
Simple Django site displaying which dining locations are currently open on 
George Mason University's campus.
Tyler Hallada's avatar
Tyler Hallada committed
6

7
8
9
For more up-to-date information, view the [What's Open 
wiki page](http://wiki.srct.gmu.edu/wiki/index.php/Whatsopen).

Renfred Harper's avatar
Renfred Harper committed
10
11
Contributing
---
12
13
14
15
16
17
18
19
20
21
22
UPDATE:

Please join the #whats-open channel at srct.slack.com in order to chat with project
members about how to contribute. There are pinned posts in the sidebar of that channel
containing step by step instructions about how to get setup in addition to info about 
branches and the direction of the project.

Thanks!


OUTDATED:
Tyler Hallada's avatar
Tyler Hallada committed
23

24
25
26
27
What's Open needs all the help it can get. Even if you don't feel 
like you can be helpful with the heavily technical aspects, 
we definitely need designers and technical writers.
 
28
29
30
There are many things that can be done with this project (see the "To Do" 
section), but sometimes it's the small things that count, so don't be afraid of 
contributing just for a spelling mistake.
Tyler Hallada's avatar
Tyler Hallada committed
31

32
33
If you need help at all please contact any SRCT member. We want people to
contribute, so if you are struggling, or just want to learn, then we are willing
Tyler Hallada's avatar
Tyler Hallada committed
34
35
to help.

Renfred Harper's avatar
Renfred Harper committed
36
37
Set Up
---
Tyler Hallada's avatar
Tyler Hallada committed
38

Tyler Hallada's avatar
Tyler Hallada committed
39
To get started, you'll need the following installed:
Tyler Hallada's avatar
Tyler Hallada committed
40

Tyler Hallada's avatar
Tyler Hallada committed
41
* [Python 2.7](http://www.python.org/download/)
42
* [Django 1.5 or later](https://www.djangoproject.com/download/)
Tyler Hallada's avatar
Tyler Hallada committed
43
* [Git](http://git-scm.com/book/en/Getting-Started-Installing-Git)
Tyler Hallada's avatar
Tyler Hallada committed
44
45
* [virtualenv](http://www.virtualenv.org/en/latest/index.html#installation) 
  (to install you will need either 
46
47
  [pip](http://www.pip-installer.org/en/latest/installing.html) or
  [easy_install](http://pythonhosted.org/distribute/easy_install.html))
Tyler Hallada's avatar
Tyler Hallada committed
48

49
50
51
Then type the following commands in your terminal (if you're on Windows, 
[Cygwin](http://www.cygwin.com/) is recommended).

Tyler Hallada's avatar
Tyler Hallada committed
52
```bash
53
git clone http://git.gmu.edu/srct/whats-open.git
Tyler Hallada's avatar
Tyler Hallada committed
54
55
56
57
58
cd whats-open/
virtualenv venv --distribute
source venv/bin/activate
pip install -r requirements.txt
python manage.py syncdb
59
python manage.py migrate website
Tyler Hallada's avatar
Tyler Hallada committed
60
61
```

62
63
More detailed info on installation can be found on the [SRCT 
wiki](http://wiki.srct.gmu.edu/wiki/index.php/Whatsopen#Installation)
Renfred Harper's avatar
Renfred Harper committed
64
65
Running the Site Locally
---
Tyler Hallada's avatar
Tyler Hallada committed
66

Tyler Hallada's avatar
Tyler Hallada committed
67
68
69
Now that everything is set-up you can run the server on your computer.

```bash
70
python manage.py runserver
Tyler Hallada's avatar
Tyler Hallada committed
71
72
```

73
Go to http://127.0.0.1:8000/ in your browser and you should see the website. 
Tyler Hallada's avatar
Tyler Hallada committed
74
Though, there won't be any restaurants showing. You will need to add them to 
75
76
77
the database. Go to http://127.0.0.1:8000/admin/ to add new Restaurant and Schedule 
objects to your database (the login would be the same username and password you 
entered when creating a superuser during the `python manage.py syncdb` command).
Tyler Hallada's avatar
Tyler Hallada committed
78

Renfred Harper's avatar
Renfred Harper committed
79
80
Modifying and Deploying Code
---
Tyler Hallada's avatar
Tyler Hallada committed
81
82
83
84
85
86
87
88

With the means of testing the website, you can really start contributing.

If you're new to Django and don't know where to start, I highly recommend
giving the [tutorial](https://docs.djangoproject.com/en/dev/intro/tutorial01/)
a try. However, it leaves out a lot of important things, so remember, Google is
your friend. If you can't figure it out there, ask me.

89
90
91
92
For the JavaScript, I will be using jQuery whenever possible because I prefer
it to straight up JavaScript. jQuery has [great
documentation](http://docs.jquery.com/) and I've found [Mozilla's documentation
on JavaScript](https://developer.mozilla.org/en-US/docs/JavaScript) to be
93
useful as well. But if your Google-fu is sharp, that should suffice.
94

95
Once you actually make your changes and have fully tested them you can push the 
96
97
code to the git repository. The best way to do this is to fork the project, make
the changes in your local repository, push to gitlab, and submit a pull request.
Tyler Hallada's avatar
Tyler Hallada committed
98
99
100
101
102
103
104

There are many ways to use git, and this is one example:

```
git commit -a
git push origin master
```
Tyler Hallada's avatar
Tyler Hallada committed
105

Tyler Hallada's avatar
Tyler Hallada committed
106
Some more helpful links on how to use Git:
Tyler Hallada's avatar
Tyler Hallada committed
107

Tyler Hallada's avatar
Tyler Hallada committed
108
109
110
111
112
113
114
* [Git Reference](http://gitref.org/)
* [OpenHatch's Training Mission](https://openhatch.org/missions/git)
* [Visual Git
  Reference](http://marklodato.github.com/visual-git-guide/index-en.html)
* [Git For Ages 4 And
  Up](http://blip.tv/open-source-developers-conference/git-for-ages-4-and-up-4460524)

115

Renfred Harper's avatar
Renfred Harper committed
116
117
To Do
---
Tyler Hallada's avatar
Tyler Hallada committed
118

Tyler Hallada's avatar
Tyler Hallada committed
119
120
121
122
123
* Get all restaurants displaying correct open times on the page. AKA. make
  extensive tests.
* Sort by location view
* Add times until opening/closing for restaurants that are close, and exact
  times for those that aren't.
Tyler Hallada's avatar
Tyler Hallada committed
124
125
126
127
128
129
130
131
132
133
* Make page refresh, or more preferably have the data refresh. For
  example, with AJAX calls.
* Create more useful API calls. Document them.
* Allow switching between campuses. In the database, mark which campus each
  restauraunt is on, include this information in the JSON object returned at
  `ajax/schedule` and store the campus choice in the user's cookies
  so that when they come back the page will already be set to their campus.
  Default would be Fairfax of course.
  [jquery-cookie](https://github.com/carhartl/jquery-cookie) would be useful
  for this.
134
135
* What's open for everything on campus, not just campuses-- for the card office, library, gyms, tutoring centers, places off campus that accept Mason Money
* I'm seeing an "IndexError: list index out of range" that doesn't apparently affect anything being tossed in the managepy output