browncr / cr-www

GNU Affero General Public License v3.0
3 stars 2 forks source link

Implement staff bios page #4

Closed melloc closed 9 years ago

melloc commented 9 years ago

Show staff bios.

wang-g commented 9 years ago

At the end of day one, I can list out all the users (including their names/years/bios), and sort them according to exec/editor/writer using the lev attribute. This seems like a good start.

What I'm stuck on at this stage is how to include the staff photos. The photos seem to be stored in the StaffPhotos table in java.sql.Blob format. I've looked online for a while, but couldn't find a way to display Blob images from a database directly in a view. All the posts I've found talk about Play 1.x.x applications using Java. For example, this one. How should I proceed? I'm not sure where to continue looking into this issue.

Other than the staff photos, the Staff Bios page seems pretty much complete. Except for the formatting. Is the CSS something I should worry about right now? I assumed that for now we'd just stick with the default layout. If we do need to work with CSS, where can I find the relevant stylesheets?

Finally, I haven't started working on the Edit User Bios page yet. I'd rather hold off on that until Cody moves us to the H2 database, so I don't accidentally mess with the live database that I'm currently connecting to.

Let me know what you guys think! Any suggestions? day-one_staff_bios

melloc commented 9 years ago

For the photos, you'll need to create a route handler that forwards to a controller that will fetch it from the database. Take a look at /usr2/cr/sites/www/httpdocs/staff_photo.php to see how it's currently done. You'll then want the following route:

GET /staff_photos/:edition/:uid/:version controllers.Bios.staffPhoto(edition: String, uid: Int)
melloc commented 9 years ago

And I wouldn't worry about editing user bios yet, since that blocks on being able to log in. We can worry about that once we've finished with the things that non-staff can see.

melloc commented 9 years ago

Closed by #16.