Commit Graph
264 Commits
Author SHA1 Message Date
Bharat Mediratta e0efdee8b2 Fix /item -> /items to conform to new REST api. 2008-11-19 04:14:09 +00:00
Bharat Mediratta c0aa61787c Change output_format() to autodetect for html / xml / json 2008-11-19 03:42:43 +00:00
Bharat Mediratta 3e67a35cb0 change mime_type column from 255 chars to 64 2008-11-19 03:39:38 +00:00
Bharat Mediratta 89bb3c42f7 Update the unit test for mime types. Can't test it right now because routing is broken for the test framework so we have to fix that first. 2008-11-19 03:39:12 +00:00
Bharat Mediratta 20a0700fcb Set the content type to application/rss+xml 2008-11-19 03:29:57 +00:00
Tim Almdal c7b2090f0c add the mime type column on the item table 2008-11-19 03:29:53 +00:00
Bharat Mediratta a197c057c8 rename views/feed.media_rss.php to views/feed.mrss.php because
mrss is a more standard abbreviation for MediaRSS.  Sigh.
2008-11-19 03:23:40 +00:00
Bharat Mediratta c67f9069d0 Rename views/media_rss.html.php -> views/feed.media_rss.php because as
Tim points out, "it's not html".  My bad!
2008-11-19 03:21:43 +00:00
Bharat Mediratta 9311c12f1f rename views/media.rss.php to views/media_rss.html.php for consistency. 2008-11-19 03:18:59 +00:00
Bharat Mediratta df4832bf6f Change Media_RSS_Controller so that it does not extend REST_Controller, since it
doesn't refer to a fixed resource or collection of resources.

Fix some minor bugs in the code so that we can actually generate a
feed.  It looks pretty cool!  Improved pagination links, but didn't actually test them.
2008-11-19 03:17:56 +00:00
Tim Almdal 693080669a fix a few minor issues 2008-11-19 02:50:11 +00:00
Tim Almdal ad7ace9b72 The continuing evolution of the slideshow...
1) added a mime_type property to the item module(no database change)
2) created a media_rss module
3) moved most of the functionality for the downloading the images to the media_rss module
2008-11-19 02:31:20 +00:00
Jozef Selesi b2772f5a05 * Renamed the album, item and photo controllers to albums, items and photos in order to follow the convention that controllers that refer to a collection of resources have plural names.
* Added a bug workaround to routes.php
2008-11-19 00:12:25 +00:00
Jozef Selesi 1992343c2e * Changed REST API. Now there are two separate methods for forms:
GET /form/edit/{controller}/{resource_id} -> controller::_form_edit($resource)
  GET /form/add/{controller}/{parameters}   -> controller::_form_add($parameters)
* Updated comment, user and core modules to reflect the API changes
* Cleaned up routing and handling of requests to /{controller}
2008-11-18 23:40:47 +00:00
Tim Almdal 4bf486955c The start of the slideshow module. Mostly framework stuff, no real implementation yet 2008-11-18 19:09:24 +00:00
Tim Almdal 4dfa22606f Correct the placement of the slideshow button on the photo.html page 2008-11-18 16:39:35 +00:00
Tim Almdal 6f4fae0786 Added the is_installed to the module helper and change to photo.html to not try to display a comment if it is not installed 2008-11-18 16:26:36 +00:00
Jozef Selesi b63ea2cdbf - All comments of an item can now be seen /comments?item_id=
- Return proper Content-Type header for GET /comments requests
- Got rid of the query processing for index() in REST_Controller()
- Small misc fixes
2008-11-18 15:48:08 +00:00
Bharat Mediratta d4fc15f76c Fix a typo in the text MPTT link 2008-11-18 09:07:46 +00:00
Bharat Mediratta d8225e44c4 Fix a typo user_id -> owner_id 2008-11-18 09:03:49 +00:00
Bharat Mediratta 394de8ec0a Gracefully handle the no-comments case 2008-11-18 09:03:26 +00:00
Jozef Selesi 3ebb751cda First iteration of REST controller refactoring. RESTful controllers that refer to collections should now have plural names and there should be only one controller per resource. Updated existing classes that implement REST_Controller. The routing now works like this:
GET    /controller    -> controller::_index()
POST   /controller    -> controller::_create()
GET    /controller/id -> controller::_show()
PUT    /controller/id -> controller::_update()
DELETE /controller/id -> controller::_delete()
GET    /form/edit/controller/resource_id -> controller::_form()
GET    /form/add/controller/data         -> controller::_form()
2008-11-18 08:28:32 +00:00
Bharat Mediratta 59dbd1dc83 Move User_Controller to Users_Controller per jozefs request. 2008-11-18 08:10:14 +00:00
Tim Almdal 8b6796fa5f Synchronize the model rules with the database definitions and vice-versa. 2008-11-18 00:38:36 +00:00
Bharat Mediratta c031fcef23 Remove stray <ul> from comment list 2008-11-17 04:54:13 +00:00
Bharat Mediratta c91e90406b Add output formats to our REST controllers. Add support for JSON and
XML to the comment controllers as a proof of concept.  It's not fully
baked; we should examine ways to create helpers to make this process
easier.
2008-11-17 00:30:18 +00:00
Bharat Mediratta 0975e702a9 Add _method=put to the edit form
Properly implement User_Controller::_put()
2008-11-16 19:26:44 +00:00
Bharat Mediratta 1a2cb5ff04 Put _method into the edit form's url; Implement Comment::_put() properly 2008-11-16 19:23:41 +00:00
Bharat Mediratta b6de985922 Handle _method in either GET or POST 2008-11-16 19:22:27 +00:00
Bharat Mediratta 5d14531af9 Drop the call to render() and just use the View's __toString method to
print it out.
2008-11-16 19:12:01 +00:00
Bharat Mediratta bcb2230a6b Remove a @todo 2008-11-16 10:19:01 +00:00
Bharat Mediratta 4610fc8e7f Create Forge::add_rules_from() which pulls validation rules from the model and
associates them with the form.  This replaces the various _add_validation_rules()
functions in the user and comment modules.

Move user edit form into user helper for consistency with the comment module.

Implement missing _form method in the user controller.
2008-11-16 07:51:42 +00:00
Bharat Mediratta ce7fbf979d Stop using the target param; replace the form by hand so that we can run ajaxify_comment_form() as needed. Otherwise the 2nd post attempt won't be ajax 2008-11-16 07:27:36 +00:00
Bharat Mediratta e3be3cecf5 Second half of renaming the tags module. Change all occurrences of
gTags to gTag in the CSS.
2008-11-16 07:20:58 +00:00
Bharat Mediratta e87a37b855 Rename 'tags' module to 'tag' for consistency of pluralization 2008-11-16 07:17:29 +00:00
Bharat Mediratta 140736a1e4 Several large changes:
1) Changed the way that we get forms.  Now, if you want to get a form
   for a REST resource you prefix /form to the resource id.  So:
    /form/photo/1    : returns a form for editing photo id 1
    /form/comments/1 : returns a form for adding a comment to photo id 1
    /form/comment/1  : returns a form for editing comment id 1

2) Changed the comment module to have two controllers:
    comment:  deals with a single comment resource
    comments: deal with collections of comments attached to an item

Related stuff:
- Moved the comments js into the theme
- Reworked Comment_Helper for clarity
- Moved form generation code down into Comment_Helper
- Cleaned up routes (eliminating new comment ones added in recent rev)
- Added form() function to all REST controllers
- Changed comment module to use a block instead of an arbitrary helper call from the theme
- Comment controller only returns HTML currently, but returns a 201 Created status
  code when a new comment is added, which the Ajax code can catch and act upon.
- Got rid of a lot of extra views in comment module
2008-11-16 07:14:12 +00:00
Bharat Mediratta b8b60df391 Rename gLogin -> gLoginForm
This disambiguates forms from blocks (for example in the comment
module we were calling both the form and block gComments).
2008-11-16 07:07:16 +00:00
Tim Almdal be67187ad9 Create MY_Forge to specify the defaul html 2008-11-16 06:43:31 +00:00
Felix Rabinovich 1a79a10893 prevent direct access. take 2 2008-11-16 06:09:11 +00:00
Felix Rabinovich d4c95a089e prevent direct access 2008-11-16 06:06:13 +00:00
Felix Rabinovich f27929e126 create a regular user and make scaffolding assign owner to logged in user 2008-11-16 05:46:42 +00:00
Bharat Mediratta 2d463c5531 use text::alternate where appropriate 2008-11-15 21:54:16 +00:00
Bharat Mediratta 6fd7194544 Destroy the session on logout, don't just delete the user. 2008-11-15 21:47:21 +00:00
Jozef Selesi fbc810098f Do comment add in a single request, some code cleanup. 2008-11-15 17:39:14 +00:00
Jozef Selesi 5e10b44a95 Remove unnecessary pasted code. 2008-11-15 17:04:16 +00:00
Jozef Selesi 0f11c77bcd Set svn:eol-style to LF. 2008-11-15 16:53:07 +00:00
Jozef Selesi f9eaa8c220 Initial add comment implementation. 2008-11-15 16:52:23 +00:00
Bharat Mediratta 66bd9d85b3 Show per-field error messages inline again 2008-11-15 10:15:12 +00:00
Bharat Mediratta ca05d94b70 Add gInline to the form's unordered list to clean it up. 2008-11-15 09:27:04 +00:00
Bharat Mediratta 89c6f8f914 Don't show gLoginMenu if there's no user module 2008-11-15 09:09:29 +00:00