Commit Graph
395 Commits
Author SHA1 Message Date
Felix Rabinovich 314d55d858 User Administration. Add users. Take 3 2008-12-26 03:47:04 +00:00
Felix Rabinovich 9a71309844 User Administration. Delete users. Take 3 2008-12-26 03:22:52 +00:00
Bharat Mediratta 0fc14c1bfc Simplify the watermark module. We can now upload, edit and delete one
watermark.  The UI is rough and we don't yet apply the watermark to
images.. that's next.
2008-12-26 01:32:12 +00:00
Felix Rabinovich 7f95c80e88 User Administration. Edit users. Take 3 2008-12-26 00:58:15 +00:00
Bharat Mediratta 2c91a7e9ce Rework log and message helpers to be parallel, but separate.
1) they now have their own matching severity constants
2) they both have convenience functions success(), info(), warning() and error()
3) they both have severity_class()
2008-12-25 23:43:44 +00:00
Bharat Mediratta 94e3ae2e0f Add edit/delete links (they're just stubs now, but they open a dialog).
Add active/position to Watermark_Model
2008-12-25 22:31:20 +00:00
Bharat Mediratta 75b9a7872c Remove extra uniquifying text that Forge adds to uploaded files. 2008-12-25 21:54:09 +00:00
Bharat Mediratta 71d0373838 Return the form on success so that we clear out any prior error forms 2008-12-25 21:41:18 +00:00
Bharat Mediratta 324b612003 Oops, and also re-ajaxify the form if we replace it. 2008-12-25 21:40:05 +00:00
Bharat Mediratta ead45ffbc2 Reload the form if it's available so that we show form errors and we reset the form on success. 2008-12-25 21:39:22 +00:00
Felix Rabinovich 82ed38d78e Ajaxify 'add users' 2008-12-25 20:59:33 +00:00
Bharat Mediratta 36b903b234 Remove a test for code that was removed 2008-12-25 10:14:28 +00:00
Felix Rabinovich 730d74c87a fixes in user edit and delete 2008-12-25 06:29:12 +00:00
Felix Rabinovich 3a22e0a2df fixed minor log:add typo 2008-12-25 06:11:07 +00:00
Bharat Mediratta d4a5264925 get_add_form() -> add_add_form_admin() 2008-12-25 05:57:45 +00:00
Bharat Mediratta fdc0f83024 Big round of normalization of the way that our controllers
communicate.  Almost all controllers now use JSON to speak to the
theme when we're dealing with form processing.  This means tht we only
send the form back and forth, but we use a JSON protocol to tell the
browser success/error status as well as the location of any newly
created resources, or where the browser should redirect the user.

Lots of small changes:
1) Admin -> Edit Profile is gone.  Instead I fixed the "Modify Profile" link
   in the top right corner to be a modal dialog

2) We use json_encode everywhere.  No more Atom/XML for now.  We can bring those
   back later, though.  For now there's a lot of code duplication but that'll be
   easy to clean up.

3) REST_Controller is no longer abstract.   All methods its subclasses should create
   throw exceptions, which means that subclasses don't have to implement stubs for
   those methods.

4) New pattern: helper method get_add_form calls take an Item_Model,
   not an id since we have to load the Item_Model in the controller
   anyway to check permissions.

5) User/Groups REST resources are separate from User/Group in the site
   admin.  They do different things, we should avoid confusing overlap.
2008-12-25 05:12:46 +00:00
Felix Rabinovich 6e68c5ca28 added sprintf to strings for tranlation support 2008-12-25 02:59:45 +00:00
Bharat Mediratta 2c6a80fb76 Don't let the admin delete themselves, either. That would be bad. 2008-12-25 02:48:07 +00:00
Bharat Mediratta 95ec6a8f57 Only admins can delete users. 2008-12-25 02:47:17 +00:00
Bharat Mediratta 216ecf3079 Fix rules for editing users. 2008-12-25 02:42:48 +00:00
Bharat Mediratta f6ebb436e4 Rest_Controller -> REST_Controller everywhere, for consistency. 2008-12-25 02:38:53 +00:00
Felix Rabinovich 481352c382 User administration: 1. Add users; 2. Group administration; 3. General cleanup 2008-12-25 02:16:41 +00:00
Bharat Mediratta fd49c74607 Convert tag module over to returning JSON. 2008-12-25 01:34:17 +00:00
Bharat Mediratta 7a9d4a2224 Fix the way we dump out comment in _show(). 2008-12-25 01:06:37 +00:00
Bharat Mediratta cdcd8bf377 Update the form first, then clear it on success (else it doesn't get cleared on success) 2008-12-25 00:56:10 +00:00
Bharat Mediratta d62acf041f Be consistent: resource is a url, data is the actual JSON encoded result. 2008-12-25 00:53:45 +00:00
Bharat Mediratta 0bb82b7621 Gut the comment module and simplify it. Stop trying to support Atom
and XML for now, we have no driver for those technologies so anything
we implement is not going to be sufficiently tested and therefore
it'll be broken.

Change all comment functions to return JSON and update the JS to deal
purely with JSON.  This is our new protocol for talking to the browser
and it should be flexible and portable.

Create comments.html.php.  This duplicates comment.html.php, but will
be more efficient for rendering comments since we won't be creating a
new View for every comment we render.
2008-12-25 00:47:40 +00:00
Felix Rabinovich 7a82beb752 Adding user 2008-12-24 19:59:12 +00:00
Bharat Mediratta 526ac39697 Remove stray response:: (not yet time for this.. it's coming!) 2008-12-24 04:25:11 +00:00
Bharat Mediratta c7193f9b2e Normalize our Admin controllers so that functions always print out
their results, as opposed to having them return their view back
upstream.  This is a little more code in every controller, but it's
much less magical and more consistent.

Look up the active_theme and active_admin_theme inside the view
itself, no need to do that in the controllers.  This makes view
initialization easier in the controllers.
2008-12-24 04:22:22 +00:00
Bharat Mediratta b2c9a59d1b Tersify a log message 2008-12-24 04:10:00 +00:00
Bharat Mediratta b0dff620e2 Minor cleanups. 2008-12-24 04:05:47 +00:00
Bharat Mediratta 672eca5337 Lots of deltas rolled up into a bigger change. Sorry for the mess.
1) Deleted in-place-editing.  We'll be replacing this with a real edit
   system that groups settings together and is more coherent.

2) Tweaked the way that dialog boxes work to get the ajax stuff working
   again.  It's imperfect and does not work properly for uploading images.
   This is going to get redone also, but this is a good resting point.

3) Created edit forms for albums and photos.  Moved _update and _create out
   of Items_Controller and into the individual subclasses.

4) Created access::required which is a shorthand for:
    if (!access::can(...)) {
      access::forbidden();
    }

5) Added validation rules to Items_Model

6) Converted login to use the regular modal dialog approach in the theme.
2008-12-24 00:20:26 +00:00
Felix Rabinovich c76d730a7c Edit user - first draft 2008-12-23 21:44:35 +00:00
Bharat Mediratta 32a3071477 Can't self-close a <div>. 2008-12-23 19:07:30 +00:00
Chad Kieffer 69daaffb05 Fixed indents 2008-12-23 06:33:28 +00:00
Bharat Mediratta 5713e3c66e Change photo::create() and album::create() to take ORM instances
instead of ids.
2008-12-23 04:36:09 +00:00
Bharat Mediratta 2502240ce4 Add very simple graphics toolkits.
Track a set of rules in Graphics_Rule_Model which specify how we turn
original images into thumbnails and resizes.  There's one set of rules
that applies to every image in the Gallery.

Track the state of thumbs and resizes with a "dirty" bit.  The new
graphics helper manages the rules and can rebuild the thumbs and
resizes for any images that are considered "dirty".

Introduce the concept of an "album cover" which is an item that an
album points to.  We'll use that item as the source for the album's
thumbnail/resize.

Conflated with this change (sorry!) I also changed the Var table to
use module_name instead of module_id.  This may be marginally less
efficient, but it's much easier to follow in the database.
2008-12-23 04:14:07 +00:00
Bharat Mediratta ddcf10dfce Allow the site admin to upload watermark images. Can't do much with them yet. 2008-12-23 01:29:17 +00:00
Bharat Mediratta d330e4203a Step 1 of converting watermarks over to be an admin page. 2008-12-23 00:13:22 +00:00
Bharat Mediratta 34daf50695 Add attribute to <script> element. 2008-12-23 00:06:20 +00:00
Bharat Mediratta c5173c5370 Remove stray comma. 2008-12-23 00:05:36 +00:00
Bharat Mediratta 47d068e4a8 Remove extraneous view, not necessary 2008-12-22 10:39:13 +00:00
Bharat Mediratta 17f77b8de4 Remove module.info from infrastructure modules that are effectively
libraries that would ship with the core.

Refactor welcome.php to use the newly refactored module::available()
2008-12-22 04:49:30 +00:00
Bharat Mediratta fe27bd1eb3 Change the way that we track modules.
Each module now has a "module.info" file that has information about
the module, including the core.  We can display the installed version,
and the version in the code.

Also take a first shot at a modules admin page.
2008-12-22 03:41:33 +00:00
Bharat Mediratta f7b4222e3f Fix capitalization. 2008-12-22 03:23:30 +00:00
Bharat Mediratta 849b271a8c Add info/warning/error classes to log messages. 2008-12-21 10:35:30 +00:00
Bharat Mediratta b3c05b1579 Move logging up to the controllers so that our logging can operate at a more meta level 2008-12-21 04:18:42 +00:00
Bharat Mediratta f0b6333344 Add a logging facility, and instrument login/logout to use it. 2008-12-21 03:50:11 +00:00
Bharat Mediratta 78ce8615f3 Implement the "recent comments" block with real data. 2008-12-21 02:02:41 +00:00