summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/server_add/controllers/admin_server_add.php2
-rw-r--r--modules/tag/css/tag.css34
-rw-r--r--modules/tag/helpers/tag.php3
-rw-r--r--modules/tag/js/tag.js33
-rw-r--r--modules/tag/views/admin_tags.html.php81
5 files changed, 67 insertions, 86 deletions
diff --git a/modules/server_add/controllers/admin_server_add.php b/modules/server_add/controllers/admin_server_add.php
index 837a2c00..cb71e1f1 100644
--- a/modules/server_add/controllers/admin_server_add.php
+++ b/modules/server_add/controllers/admin_server_add.php
@@ -83,7 +83,7 @@ class Admin_Server_Add_Controller extends Admin_Controller {
private function _get_admin_form() {
$form = new Forge("admin/server_add/add_path", "", "post",
- array("id" => "g-server-add-admin-form"));
+ array("id" => "g-server-add-admin-form", "class" => "g-short-form g-wide"));
$add_path = $form->group("add_path");
$add_path->input("path")->label(t("Path"))->rules("required")
->error_messages("not_readable", t("This directory is not readable by the webserver"))
diff --git a/modules/tag/css/tag.css b/modules/tag/css/tag.css
index b718de05..6dfba946 100644
--- a/modules/tag/css/tag.css
+++ b/modules/tag/css/tag.css
@@ -1,3 +1,5 @@
+/* Tag cloud ~~~~~~~~~~~~~~ */
+
#g-tag-cloud ul {
font-size: 1.2em;
text-align: justify;
@@ -75,40 +77,18 @@
}
#g-tag-admin ul {
- padding-bottom: .3em;
+ margin-bottom: 2em;
}
#g-tag-admin li {
- padding: .1em 0 .2em .3em;
-}
-
-#g-tag-admin .g-column {
- float: left;
- width: 200px;
+ padding: .1em 0 .2em 0;
}
-#g-edit-tag-form input {
- padding: 0 .2em 0 .2em;
- clear: none;
- float: left;
- margin: 0 .2em 0 0;
+#g-rename-tag-form ul {
+ margin-bottom: 0;
}
-#g-edit-tag-form input[type="text"].g-error {
+#g-rename-tag-form input[type="text"].g-error {
border: 2px solid red;
background: none;
}
-
-#g-edit-tag-form input[type="submit"] {
- height: 25px;
-}
-
-#g-edit-tag-form a, #g-edit-tag-form span {
- display: block;
- float: left;
- padding: .2em .2em 0 .1em;
-}
-
-#g-edit-tag-form span {
- float: right;
-}
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index b1d79458..01972a65 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -79,7 +79,6 @@ class tag_Core {
}
}
-
/**
* Return all the tags for a given item.
* @return array
@@ -111,7 +110,7 @@ class tag_Core {
}
static function get_rename_form($tag) {
- $form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "g-edit-tag-form", "class" => "g-short-form"));
+ $form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "g-rename-tag-form", "class" => "g-short-form"));
$group = $form->group("rename_tag")->label(t("Rename Tag"));
$group->input("name")->label(t("Tag name"))->value($tag->name)->rules("required|length[1,64]");
$group->inputs["name"]->error_messages("in_use", t("There is already a tag with that name"));
diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js
index 17845272..41fa4d41 100644
--- a/modules/tag/js/tag.js
+++ b/modules/tag/js/tag.js
@@ -18,10 +18,10 @@ function ajaxify_tag_form() {
function closeEditInPlaceForms() {
// closes currently open inplace edit forms
- if ($("#g-edit-tag-form").length) {
+ if ($("#g-rename-tag-form").length) {
$("#g-edit-error-message").remove();
- var li = $("#g-edit-tag-form").parent();
- $("#g-edit-tag-form").parent().html($("#g-edit-tag-form").parent().data("revert"));
+ var li = $("#g-rename-tag-form").parent();
+ $("#g-rename-tag-form").parent().html($("#g-rename-tag-form").parent().data("revert"));
li.height("");
$(".g-editable", li).bind("click", editInPlace);
$(".g-dialog-link", li).gallery_dialog();
@@ -41,34 +41,37 @@ function editInPlace(element) {
var tag_name = $(this).html();
var tag_width = $(this).width();
$(this).parent().data("revert", $(this).parent().html());
- var form = '<form id="g-edit-tag-form" method="post" class="g-inline ui-helper-clearfix" ';
+ var form = '<form id="g-rename-tag-form" method="post" class="g-short-form" ';
form += 'action="' + TAG_RENAME_URL.replace('__ID__', tag_id) + '">';
form += '<input name="csrf" type="hidden" value="' + csrf_token + '" />';
- form += '<input id="name" name="name" type="text" class="textbox" value="' +
- str_replace('"', "&quot;", tag_name) + '" />';
- form += '<input type="submit" class="submit ui-state-default ui-corner-all" value="' + save_i18n + '" i/>';
- form += '<a href="#">' + cancel_i18n + '</a>';
+ form += '<ul>';
+ form += '<li><input id="name" name="name" type="text" class="textbox" value="' +
+ str_replace('"', "&quot;", tag_name) + '" /></li>';
+ form += '<li><input type="submit" class="submit ui-state-default" value="' + save_i18n + '" /></li>';
+ form += '<li><a href="#" class="g-cancel">' + cancel_i18n + '</a></li>';
+ form += '</ul>';
form += '</form>';
// add edit form
$(this).parent().html(form);
- $("#g-edit-tag-form #name")
- .width(tag_width+30)
+ $("#g-rename-tag-form #name")
+ .width(tag_width)
.focus();
- //$("#g-edit-tag-form").parent().height( $("#g-edit-tag-form").height() );
- $("#g-edit-tag-form a").bind("click", closeEditInPlaceForms);
+ $(".g-short-form").gallery_short_form();
+ $("#g-rename-tag-form .g-cancel").bind("click", closeEditInPlaceForms);
ajaxify_editInPlaceForm = function() {
- $("#g-edit-tag-form").ajaxForm({
+ $("#g-rename-tag-form").ajaxForm({
dataType: "json",
success: function(data) {
+ console.log("success");
if (data.result == "success") {
closeEditInPlaceForms(); // close form
$("#g-tag-" + data.tag_id).text(data.new_tagname); // update tagname
- console.log(data);
window.location.reload();
} else if (data.result == "error") {
- $("#g-edit-tag-form #name")
+ console.log("error");
+ $("#g-rename-tag-form #name")
.addClass("g-error")
.focus();
$("#g-tag-admin").before("<p id=\"g-edit-error-message\" class=\"g-error\">" + data.message + "</p>");
diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php
index edc466bb..7771f7fe 100644
--- a/modules/tag/views/admin_tags.html.php
+++ b/modules/tag/views/admin_tags.html.php
@@ -14,51 +14,50 @@
var save_i18n = <?= html::js_string(t("save")->for_html_attr()) ?>;
var cancel_i18n = <?= html::js_string(t("cancel")->for_html_attr()) ?>;
</script>
-<div class="g-block">
- <h2>
- <?= t("Tag Admin") ?>
- </h2>
- <? $tags_per_column = $tags->count()/5 ?>
- <? $column_tag_count = 0 ?>
+<h2>
+ <?= t("Tag Admin") ?>
+</h2>
- <table id="g-tag-admin" class="g-block-content">
- <caption class="g-understate">
- <?= t2("There is one tag", "There are %count tags", $tags->count()) ?>
- </caption>
- <tr>
- <td>
- <? foreach ($tags as $i => $tag): ?>
- <? $current_letter = strtoupper(mb_substr($tag->name, 0, 1)) ?>
+<? $tags_per_column = $tags->count()/5 ?>
+<? $column_tag_count = 0 ?>
- <? if ($i == 0): /* first letter */ ?>
- <strong><?= html::clean($current_letter) ?></strong>
- <ul>
- <? elseif ($last_letter != $current_letter): /* new letter */ ?>
- <? if ($column_tag_count > $tags_per_column): /* new column */ ?>
- </td>
- <td>
- <? $column_tag_count = 0 ?>
- <? endif ?>
+<table id="g-tag-admin">
+ <caption class="g-understate">
+ <?= t2("There is one tag", "There are %count tags", $tags->count()) ?>
+ </caption>
+ <tr>
+ <td>
+ <? foreach ($tags as $i => $tag): ?>
+ <? $current_letter = strtoupper(mb_substr($tag->name, 0, 1)) ?>
- </ul>
- <strong><?= html::clean($current_letter) ?></strong>
- <ul>
+ <? if ($i == 0): /* first letter */ ?>
+ <strong><?= html::clean($current_letter) ?></strong>
+ <ul>
+ <? elseif ($last_letter != $current_letter): /* new letter */ ?>
+ <? if ($column_tag_count > $tags_per_column): /* new column */ ?>
+ </td>
+ <td>
+ <? $column_tag_count = 0 ?>
<? endif ?>
- <li>
- <span id="g-tag-<?= $tag->id ?>" class="g-editable g-tag-name"><?= html::clean($tag->name) ?></span>
- <span class="g-understate">(<?= $tag->count ?>)</span>
- <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>"
- class="g-dialog-link g-delete-link g-button">
- <span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a>
- </li>
+ </ul>
+ <strong><?= html::clean($current_letter) ?></strong>
+ <ul>
+ <? endif ?>
- <? $column_tag_count++ ?>
- <? $last_letter = $current_letter ?>
- <? endforeach /* $tags */ ?>
- </ul>
- </td>
- </tr>
- </table>
-</div>
+ <li>
+ <span id="g-tag-<?= $tag->id ?>" class="g-editable g-tag-name"><?= html::clean($tag->name) ?></span>
+ <span class="g-understate">(<?= $tag->count ?>)</span>
+ <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>"
+ class="g-dialog-link g-delete-link g-button">
+ <span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a>
+ </li>
+
+ <? $column_tag_count++ ?>
+ <? $last_letter = $current_letter ?>
+ <? endforeach /* $tags */ ?>
+ </ul>
+ </td>
+ </tr>
+</table>