Commit Graph

99 Commits

Author SHA1 Message Date
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
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
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
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
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
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
f9eaa8c220 Initial add comment implementation. 2008-11-15 16:52:23 +00:00
Bharat Mediratta
16828a4bc7 Delete the user from the session when uninstalling the user module 2008-11-15 09:08:59 +00:00
Bharat Mediratta
c152e5db5a Only remove the user from the session when logging out. 2008-11-15 09:05:21 +00:00
Bharat Mediratta
9d1a598ec0 Add support for modifying user data. It still needs work.
Make the continue= param a GET only parameter so that it's not part of
the form.
2008-11-15 08:15:00 +00:00
Bharat Mediratta
ae7839ffaa Revise the user login code.
* Remove user registration link and popup from the theme; this
  shouldn't be done in a popup. Use ajaxform to simplify the way
  that we load the login popup.

* Create form.html.php, this is a template for Forge based forms.

* Move user validation rules into User_Model and let forms
  populate the rules into their forms as useful.

* Undo r18688's changes regarding the REST code.  We should never
  accept a null resource, this breaks the REST abstraction.

* Change login and user controllers to use Forge which lets us delete
  login.html.php and user.html.php since those now are generated by
  the theme-owned form template
2008-11-15 06:23:09 +00:00
Tim Almdal
bd1ec2df1f The state of of the user registration functionality 2008-11-14 18:16:13 +00:00
Tim Almdal
d7745f2ad8 Add the name attr to the input fields and use the form.serialize() method to generate the post data 2008-11-14 17:23:10 +00:00
Tim Almdal
ed90edfa96 Remove class="gInline" and set the css as suggested by thumb in -devel 2008-11-14 16:56:17 +00:00
Bharat Mediratta
5a2fe6bb0b Internationalize all strings 2008-11-14 08:22:53 +00:00
Tim Almdal
652cc48b77 change the display name to a varchar 2008-11-14 07:42:20 +00:00
Tim Almdal
2386902926 Remove the logout action from the login controller 2008-11-14 07:20:00 +00:00
Bharat Mediratta
f0695f2030 Move logout to its own controller 2008-11-14 05:21:47 +00:00
Bharat Mediratta
71dc730986 Change quotes style 2008-11-14 05:09:07 +00:00
Bharat Mediratta
0fe8d44472 Create module helper and refactor all the code that creates, updates
and deletes modules into it.
2008-11-13 10:38:28 +00:00
Tim Almdal
6d7130bffc Progress is being made... you can now logout 2008-11-13 05:17:58 +00:00
Tim Almdal
f62719ba61 Login is now working, but you can't logout 2008-11-13 04:56:12 +00:00
Chad Kieffer
c63ddc3432 Major updates to form CSS. Now using unordered lists for layouts. Added .gInline for forms like login, search, tags. Updated comment, login, search, and tagging forms. All form styles live in screen.css now. Still a lot to do, but this is a good foundation. 2008-11-13 03:39:18 +00:00
Tim Almdal
74216a3c63 The login processing is starting to take shape. Login_Form is gone. The html for the login form is retrieve via an ajax call when the user clicks on login. Can't login with a valid id yet, but you certainly get error messages when things are wrong :-) 2008-11-12 21:42:40 +00:00
Tim Almdal
2a9f8b5bcd Added a legend to the fieldset 2008-11-12 18:13:59 +00:00
Tim Almdal
91b149adbf Generate the login view using fieldsets and an un order list 2008-11-12 17:48:04 +00:00
Tim Almdal
2019e9a931 Remove user_password class and move the functionality into the user helper class 2008-11-12 15:53:39 +00:00
Jozef Selesi
56dcb953b0 Code cleanup, add test for time formatting function. 2008-11-12 15:43:05 +00:00
Jozef Selesi
a1ca946a89 Make comment post time display more user-friendly by displaying 'today', 'yesterday', 'x days ago' etc. 2008-11-12 12:00:13 +00:00
Bharat Mediratta
ed8f1d4152 gBlockContent lives on the outer div, so remove it from the inner form. 2008-11-12 10:54:01 +00:00
Jozef Selesi
31bea40e2e Set svn:eol-style LF on a new file and add the standard preamble to some files. 2008-11-12 07:07:13 +00:00
Tim Almdal
1da2428183 More updates for user management. The controllers don't work yet. But the login link in the header wil open up a login box like the mockup 2008-11-12 03:40:49 +00:00
Bharat Mediratta
ba348181f7 Rename tag_cloud.html.php to tags_block.html.php for consistency 2008-11-11 23:12:16 +00:00
Bharat Mediratta
b0a3308740 Minor cleanup; localization, indentation, etc. 2008-11-11 22:46:25 +00:00
Jozef Selesi
752459c64c Display comments from the database. 2008-11-11 20:54:12 +00:00