Hello, everyone!
Update: For now, dated snapshots of the code can be found here.
The development team (Jeremy, Nick and I) has good news: as of midnight tonight, the initial release of the directory code is available for viewing! A working version is available for everyone to view and start using. You can even create an account and upload a picture, although you should probably stick to landscape layouts, not portraits (on the list of things to fix).
If you want to look at the code itself, you can find a zip file available for download at: http://emmausproject.com/files/snapshots/. Currently the code is available only in zip format, we plan to have a tarball available soon.
The goal of releasing the code right now is to give everyone a chance to look through it, get familiar with the structure and see Python and Django at work, up close and personal. As yet there's no way to modify or add to the code. That will change soon. We'll set up a subversion repository, which will be based off of this same website. Look for the URL in this forum topic.
Also coming soon (before Easter):
That's all for now. As you might guess from the title of this topic, future updates on release status and new features will be available here. Now start coding!
David
Some Comments
Looks great, y'all. Wasn't sure if I should add myself or add my family as an entry, until I saw that it had solitary fields for 'first name', 'cell phone', etc. My suggestions (probably already in the works) are that you can add your family's details (spouse, children's names, everyone's birthdays, anniversaries, salutation(s), etc.), which would show up in the directory index as "Bill and Carolyn Reinhardt" or something. Also having an input field for a website/blog would be neato. Browse and search by name on the entire directory would also be handy.
Awesome work though; I wish I could send you the entire New Orleans directory to import. (I wonder who has that...?) Of course I suppose they would have to all be notified first that their info is going public. And ok-- no selling my cell and email to spam lists, now! /jay kay
Bill Reinhardt
People of Praise, New Orleans Branch
billreinhardt@gmail.com
Great Ideas
Great ideas, Bill! Some are these are in fact in the works. Of course, the code is available for editing by anyone who wants to download it. No need to wait on the development team............
Look for more updates in the future!
David Salmon
Photo Upload
Great work guys!
After seeing David's gmail away msg, and before noticing the suggestion of landscape profile pics only, I tried submitting a pic to my profile on the online directory, and it was stretched.
Not a big deal for now...you mentioned that this is a recognized bug on track for fixing already. I might suggest adding a remove option (button) as well, which could just default back to a blank image with text "[users_first_name]'s picture".
It looks like you are resizing the uploaded image by pixel size 168x136 as default in the save method of models.py for the landscape layout? I can't think of a easy solution off the cuff, but I'll think about it.:
def save(self):
name = 'media/%s' %self.picture
im = Image.open(name)
im = im.resize((168, 136),)
im.save(name)
super(Person, self).save()
Although I haven't been able to keep quite up to speed with a development environments, etc. I noticed that you are starting to put in "FIXME" type comments where you have noted issues. Depending on the volume of feedback, input, issues found during beta testing, one suggestion I would propose is a use a defect/bug tracker especially as you make subversion available and/or start providing open source release tags of the code. One to consider would be bugzilla.
As nother tool that could be used to potentially copy existing technology out there (ie. translate html/css/javascript to django/python from existing sites), I might propose the firebug add-on for firefox. After installing this add-on, for example, I can go to facebook.com, right click on the 'upload image' button and select 'Inspect Element' from the drop down. The add-on allows me to get an immediate glance at the html, css, script language, as well as the code for the function of the upload button. Just a thought for you code-hungry explorers out there...
Congrats on the beta release, all!
__________________________
Hugh Springer, Jr.
People of Praise
Branch/Division: Servant
Email: hugh.springer@gmail.com
AIM: hughlspringer
(h) 651.698.4958
(c) 612.750.1230
Temporarily Fixed
A temporary fix is in place in the new version, using an if statement to determine the aspect ratio of the photos. Portrait photos are resized one way, landscapes another. This should cover most photos for the time being, but we could use a better system for the future.
Thanks for the report!
David Salmon
Re: Temporarily Fixed
FYI - for anyone who has already posted a pic, you'll either have to figure out a way to do global re-post for all pics / all profiles, or request that each user manually reposts the picture themselves, since the fix has been released.
It might be good approach to figure out ways of globally applying methods like a profile post, picture post, etc. - should there be need for it in the future if or when bugs are found and numerous profiles are already created.
...just a thought.
-Hugh
Automatic
You can always create a python script to do a tedious task, but in this case, the original aspect ratio of the picture is gone.
Aspect Ratio
Here is a nice way to do it:
def save(self):
....if self.picture:
........name = 'media/%s' % self.picture
........im = Image.open(name)
........width, height = im.size
........im = im.resize((200, height*200/width),)
........im.save(name)
....super(Person, self).save()
It will keep the width at a constant 200px, and change the height depending on the aspect ratio. (this is how facebook does it)
Nice!
Yey! We finally have some code! Here are some things I would like to see: http://www.sweecoo.com:9080
Text overlap on main page
This should fix the overlapping text on the right side of the main page:
in directory\media\common.css:
#main_main {
background-image: url("images/tabslice.jpg");
background-repeat: x;
width: 738px;
padding-left: 60px;
padding-right: 60px;
padding-top: 20px;
}
Thanks!
Thanks for the patch Collin. We've implemented it--check the site for the new appearance. Keep the patches coming!
David Salmon
Search Box
Heres some code for a simple search box:
in person/views.py:
from django.db.models import Q
def search(request):
....results = []
....if request.has_key('q'):
........keywords = request['q'].split(" ")
........results = Person.objects.all()
........for x in keywords:
............results = results.filter(Q(first_name__icontains=x) | Q(last_name__icontains=x))
....return render_to_response('person_search.html', {'persons': results })
in urls.py
(r'^search/$', 'directory.person.views.search'),
Here are the templates:
http://acm.cs.umn.edu/~sweecoo/person_search.html
http://acm.cs.umn.edu/~sweecoo/base.html
I can't get the search box to go exactly where I want it, but maybe someone else can fix it.
Security
We've updated the security on the site, so that you now have to log in to see pretty much any of the pages. No need to be concerned--this was not a response to any problems that had come up in the past few days. We had planned to implement security eventually anyway, but the success of the directory prompted us to act more quickly!
David Salmon
RE: Security
Its not necessarily intuitive that a user has to navigate back to the 'People of Praise' tab in order to log out.
In order to maintain security, particularly if a user is accessing the site from a public machine, I would suggest that an auto-logout function/method should be added and called when the browser is closed, or alternatively, the 'logout' link should be displayed on each tab.
Scenario for re-test:
1. Open http://diretory.emmausproject.com in a web browser.
2. Login.
3. Navigate to a directory listing.
4. Close browser.
5. Re-open http://directory.emmausproject.com in new browser session.
Result: Previous session is still saved in cache, and opens without requesting re-login.
Django Session Cookies
Both of those options are easy to do.
To tell the browser to log the person out when it is closed (this is actually up to the browser to decide when to end session), add this line to settings.py
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
(see http://www.djangoproject.com/documentation/sessions/#session-expire-at-browser-close)
otherwise a logout link can be added to the index.html template
<a href=/logout/>logout</a>
Appearance and Function, Suggest
I would like the Logout item to stand out more, and I suggest moving it to the upper right of EACH page, so one would not need to navigate back to People of Praise and then to the bottom of that page.
When the number of entries for a branch exceeds 20 or 25, could they display in 2, 3, even 4 columns? Then you would not need to scroll to the bottom of a long page. If columns are used, names should be alphabetical down the columns, instead of across the rows.
I like the Search function. When I entered "r", it displayed every name with an r in the string. To find Reinhardt, I entered "rein", which worked great. But multiple names don't align vertically.
A wonderful beginning - keep up good work.
Source
Hey could you guys upload another snapshot of the code again soon? It would be helpful to work with the new security.
Thanks,
Collin
New Code
Collin, we'll have a new version up by the end of the day!
David Salmon
Snapshots
Thanks Guys
Unable to create a new user
Someone recently raised this issue to me when they were attempting to create a new user profile. The error that they received was as follows:
" You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page."
-Hugh