summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-24 00:20:26 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-24 00:20:26 +0000
commit672eca53371b131484d00cbe6a069092d0b7f6b3 (patch)
tree507cce76fc6dc9d022455eed9075e039fa779da2 /themes
parentc76d730a7c07253e7cc3224a78c616ce63989f40 (diff)
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.
Diffstat (limited to 'themes')
-rw-r--r--themes/default/css/screen.css10
-rw-r--r--themes/default/js/ui.init.js23
-rw-r--r--themes/default/views/album.html.php6
-rw-r--r--themes/default/views/photo.html.php4
-rw-r--r--themes/default/views/tag.html.php2
5 files changed, 15 insertions, 30 deletions
diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css
index f4c8c786..ba36274d 100644
--- a/themes/default/css/screen.css
+++ b/themes/default/css/screen.css
@@ -710,16 +710,6 @@ div.gAnnotatedThemeBlock div.title {
* 10) Ajax/DOM features
*********************************************************************/
-.gInPlaceEdit,
-.gInPlaceEdit form,
-.gInPlaceEdit input {
- display: inline;
-}
-
-span.gInPlaceEdit:hover {
- color: #6b8cb7;
-}
-
#gDialog {
text-align: left;
}
diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js
index f4a7c49c..b816dc46 100644
--- a/themes/default/js/ui.init.js
+++ b/themes/default/js/ui.init.js
@@ -105,28 +105,23 @@ function openDialog(element) {
$("body").append(eDialog);
var buttons = {};
- var form = $("#gDialog").find("form");
- var ajaxify_dialog = function() {
- $(form).ajaxForm({
+ buttons["Submit"] = function() {
+ $("#gDialog form").ajaxForm({
complete: function(xhr, statusText) {
if (xhr.status == 201) {
$("#gDialog").dialog("close");
window.location = xhr.getResponseHeader("Location");
+ } else if (xhr.status == 202) {
+ $("#gDialog").dialog("close");
+ window.location.reload();
} else {
- $("#gDialog").replaceWith(data.responseText);
- ajaxify_dialog();
+ $("#gDialog form").replaceWith(xhr.responseText);
}
}
- });
- };
- ajaxify_dialog();
- buttons["Submit"] = function() {
- var form = $("#gDialog").find("form");
- form[0].submit();
+ }).submit();
};
buttons["Reset"] = function() {
- var form = $("#gDialog").find("form");
- form[0].reset();
+ $("#gDialog form").reset();
};
$("#gDialog").dialog({
@@ -160,7 +155,7 @@ function openDialog(element) {
// Resize height if content's shorter than dialog
if (contentHt < $("#gDialog").data("height.dialog")) {
$(".ui-dialog").animate({height: contentHt});
- }
+ };
});
return false;
}
diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php
index d76e0618..fe974337 100644
--- a/themes/default/views/album.html.php
+++ b/themes/default/views/album.html.php
@@ -1,8 +1,8 @@
<? defined("SYSPATH") or die("No direct script access."); ?>
<div id="gAlbumHeader">
<?= $theme->album_top() ?>
- <h1><?= $item->title_edit ?></h1>
- <div class="gDescription"><?= $item->description_edit ?></div>
+ <h1><?= $item->title ?></h1>
+ <div class="gDescription"><?= $item->description ?></div>
</div>
<ul id="gAlbumGrid">
@@ -19,7 +19,7 @@
width="<?= $child->thumb_width ?>"
height="<?= $child->thumb_height ?>" />
</a>
- <h2><?= $child->title_edit ?></h2>
+ <h2><?= $child->title ?></h2>
<?= $theme->thumb_bottom($child) ?>
<ul class="gMetadata">
<?= $theme->thumb_info($child) ?>
diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php
index 8b00f0a5..7cfe542a 100644
--- a/themes/default/views/photo.html.php
+++ b/themes/default/views/photo.html.php
@@ -1,14 +1,14 @@
<? defined("SYSPATH") or die("No direct script access."); ?>
<div id="gItemHeader">
<?= $theme->photo_top() ?>
- <h1><?= $item->title_edit ?></h1>
+ <h1><?= $item->title ?></h1>
</div>
<div id="gItem">
<img id="gPhotoID-<?= $item->id ?>" alt="<?= $item->title ?>" src="<?= $item->resize_url() ?>"
width="<?= $item->resize_width ?>"
height="<?= $item->resize_height ?>" />
- <div><?= $item->description_edit ?></div>
+ <div><?= $item->description ?></div>
<?= $theme->photo_bottom() ?>
</div>
diff --git a/themes/default/views/tag.html.php b/themes/default/views/tag.html.php
index 6be16e43..ac33e092 100644
--- a/themes/default/views/tag.html.php
+++ b/themes/default/views/tag.html.php
@@ -20,7 +20,7 @@
width="<?= $child->thumb_width ?>"
height="<?= $child->thumb_height ?>" />
</a>
- <h2><?= $child->title_edit ?></h2>
+ <h2><?= $child->title ?></h2>
<?= $theme->thumb_bottom($child) ?>
<ul class="gMetadata">
<?= $theme->thumb_info($child) ?>