From 12bf0f72bb1e0c5d897bd7b11bea363cfb0b9e06 Mon Sep 17 00:00:00 2001
From: plegall
Date: Mon, 20 Feb 2012 19:28:43 +0000
Subject: feature 2581: new design on albums list management.
icons removed, replaced by text links visible on :hover
better ergonomy for automatic order: the "save manual order" submit button
only appears when a change is detected in the album ordering. The "automatic
sort order" becomes a dedicated fieldset, hidden by default, displayed "on
user demand".
new virtual album form displayed only "on user demand"
cat_list, cat_move and permalinks are 3 tabs for the "Albums > Manage" link
in the menubar.
permalinks admin page slightly redesign: fieldsets instead of centered h3,
"on user demand" form to add/modify permalinks.
git-svn-id: http://piwigo.org/svn/trunk@13282 68402e56-0260-453c-a942-63ccdbb3a9ee
---
admin/cat_list.php | 100 +++++++-------
admin/cat_move.php | 7 +
admin/include/albums_tab.inc.php | 35 +++++
admin/permalinks.php | 10 +-
admin/themes/clear/icon/cat_move.png | Bin 415 -> 249 bytes
admin/themes/clear/theme.css | 4 +-
admin/themes/default/template/admin.tpl | 2 -
admin/themes/default/template/cat_list.tpl | 200 ++++++++++++++++-----------
admin/themes/default/template/cat_move.tpl | 6 +-
admin/themes/default/template/permalinks.tpl | 67 ++++++---
admin/themes/default/theme.css | 26 ++--
admin/themes/roma/theme.css | 4 +-
12 files changed, 297 insertions(+), 164 deletions(-)
create mode 100644 admin/include/albums_tab.inc.php
(limited to 'admin')
diff --git a/admin/cat_list.php b/admin/cat_list.php
index c8df189d1..f1d57390b 100644
--- a/admin/cat_list.php
+++ b/admin/cat_list.php
@@ -99,6 +99,13 @@ $navigation = '';
$navigation.= l10n('Home');
$navigation.= '';
+// +-----------------------------------------------------------------------+
+// | tabs |
+// +-----------------------------------------------------------------------+
+
+$page['tab'] = 'list';
+include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');
+
// +-----------------------------------------------------------------------+
// | virtual categories management |
// +-----------------------------------------------------------------------+
@@ -134,71 +141,68 @@ else if (isset($_POST['submitAdd']))
}
}
// save manual category ordering
-else if (isset($_POST['submitOrder']))
+else if (isset($_POST['submitManualOrder']))
{
- if ('manual' == $_POST['order_type'])
- {
- asort($_POST['catOrd'], SORT_NUMERIC);
- save_categories_order(array_keys($_POST['catOrd']));
+ asort($_POST['catOrd'], SORT_NUMERIC);
+ save_categories_order(array_keys($_POST['catOrd']));
- array_push(
- $page['infos'],
- l10n('Album manual order was saved')
- );
- }
- else
- {
- $query = '
+ array_push(
+ $page['infos'],
+ l10n('Album manual order was saved')
+ );
+}
+else if (isset($_POST['submitAutoOrder']))
+{
+ $query = '
SELECT id
FROM '.CATEGORIES_TABLE.'
WHERE id_uppercat '.
(!isset($_GET['parent_id']) ? 'IS NULL' : '= '.$_GET['parent_id']).'
;';
- $category_ids = array_from_query($query, 'id');
+ $category_ids = array_from_query($query, 'id');
- if (isset($_POST['recursive']))
- {
- $category_ids = get_subcat_ids($category_ids);
- }
-
- $categories = array();
- $names = array();
- $id_uppercats = array();
+ if (isset($_POST['recursive']))
+ {
+ $category_ids = get_subcat_ids($category_ids);
+ }
+
+ $categories = array();
+ $names = array();
+ $id_uppercats = array();
- $query = '
+ $query = '
SELECT id, name, id_uppercat
FROM '.CATEGORIES_TABLE.'
WHERE id IN ('.implode(',', $category_ids).')
;';
- $result = pwg_query($query);
- while ($row = pwg_db_fetch_assoc($result))
- {
- array_push(
- $categories,
- array(
- 'id' => $row['id'],
- 'id_uppercat' => $row['id_uppercat'],
- )
- );
- array_push(
- $names,
- $row['name']
- );
- }
-
- array_multisort(
- $names,
- SORT_REGULAR,
- 'asc' == $_POST['ascdesc'] ? SORT_ASC : SORT_DESC,
- $categories
+ $result = pwg_query($query);
+ while ($row = pwg_db_fetch_assoc($result))
+ {
+ array_push(
+ $categories,
+ array(
+ 'id' => $row['id'],
+ 'id_uppercat' => $row['id_uppercat'],
+ )
);
- save_categories_order($categories);
-
array_push(
- $page['infos'],
- l10n('Albums automatically sorted')
+ $names,
+ $row['name']
);
}
+
+ array_multisort(
+ $names,
+ SORT_REGULAR,
+ 'asc' == $_POST['ascdesc'] ? SORT_ASC : SORT_DESC,
+ $categories
+ );
+ save_categories_order($categories);
+
+ array_push(
+ $page['infos'],
+ l10n('Albums automatically sorted')
+ );
}
// +-----------------------------------------------------------------------+
diff --git a/admin/cat_move.php b/admin/cat_move.php
index 1643448f1..d57c5b144 100644
--- a/admin/cat_move.php
+++ b/admin/cat_move.php
@@ -70,6 +70,13 @@ $template->assign(
)
);
+// +-----------------------------------------------------------------------+
+// | tabs |
+// +-----------------------------------------------------------------------+
+
+$page['tab'] = 'move';
+include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');
+
// +-----------------------------------------------------------------------+
// | Categories display |
// +-----------------------------------------------------------------------+
diff --git a/admin/include/albums_tab.inc.php b/admin/include/albums_tab.inc.php
new file mode 100644
index 000000000..3db2d98a3
--- /dev/null
+++ b/admin/include/albums_tab.inc.php
@@ -0,0 +1,35 @@
+add('list', l10n('List'), $my_base_url.'cat_list');
+$tabsheet->add('move', l10n('Move'), $my_base_url.'cat_move');
+$tabsheet->add('permalinks', l10n('Permalinks'), $my_base_url.'permalinks');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+?>
\ No newline at end of file
diff --git a/admin/permalinks.php b/admin/permalinks.php
index 9e5e8fec9..4beb0dbc6 100644
--- a/admin/permalinks.php
+++ b/admin/permalinks.php
@@ -49,7 +49,7 @@ function parse_sort_variables(
foreach( $sortable_by as $field)
{
$url = $base_url;
- $disp = '⇓'; // TODO: an small image is better
+ $disp = '↓'; // TODO: an small image is better
if ( $field !== @$_GET[$get_param] )
{
@@ -106,6 +106,14 @@ DELETE FROM '.OLD_PERMALINKS_TABLE.'
$template->set_filename('permalinks', 'permalinks.tpl' );
+// +-----------------------------------------------------------------------+
+// | tabs |
+// +-----------------------------------------------------------------------+
+
+$page['tab'] = 'permalinks';
+include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');
+
+
$query = '
SELECT
id, permalink,
diff --git a/admin/themes/clear/icon/cat_move.png b/admin/themes/clear/icon/cat_move.png
index c58178692..b3f937614 100644
Binary files a/admin/themes/clear/icon/cat_move.png and b/admin/themes/clear/icon/cat_move.png differ
diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css
index 042f44042..5a717fcb2 100644
--- a/admin/themes/clear/theme.css
+++ b/admin/themes/clear/theme.css
@@ -116,7 +116,7 @@ INPUT.bigbutton:hover { background-color: #ddd; color:#0cc; border: 0; }
.throw { font-size: 120%; line-height: 26px; padding-top: 10px; font-weight: bold; }
label { cursor:pointer }
.categoryLi, .menuLi { background: #ddd }
-.virtual_cat, .menuLi_hidden { background: #ccc !important; }
+.menuLi_hidden { background: #ccc !important; }
a.Piwigo {
font-family: verdana, arial, helvetica, sans-serif !important;
font-size: 11px; font-weight: normal; letter-spacing: 0;
@@ -311,3 +311,5 @@ input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hove
background-color:#ff7700;
color:white;
}
+
+p.albumTitle img {margin-bottom:-3px;}
\ No newline at end of file
diff --git a/admin/themes/default/template/admin.tpl b/admin/themes/default/template/admin.tpl
index f9da9fccf..a35aab58a 100644
--- a/admin/themes/default/template/admin.tpl
+++ b/admin/themes/default/template/admin.tpl
@@ -49,9 +49,7 @@ Raphael("menubarUsers", 20, 16).path("").scale(0.6, 0.6, 0, 0).attr({fill: "#464
diff --git a/admin/themes/default/template/cat_list.tpl b/admin/themes/default/template/cat_list.tpl
index 51c9f9b03..47c32ff75 100644
--- a/admin/themes/default/template/cat_list.tpl
+++ b/admin/themes/default/template/cat_list.tpl
@@ -1,93 +1,118 @@
-{footer_script require='jquery.ui.sortable'}
-jQuery(document).ready(function(){ldelim}
- jQuery(".catPos").hide();
- jQuery(".drag_button").show();
- jQuery(".categoryLi").css("cursor","move");
- jQuery(".categoryUl").sortable({ldelim}
- axis: "y",
- opacity: 0.8
- });
- jQuery("#categoryOrdering").submit(function(){ldelim}
- ar = jQuery('.categoryUl').sortable('toArray');
- for(i=0;i{$CATEGORIES_NAV} › {'Album list management'|@translate}
-{'Album list management'|@translate}
+
+
+
+ {'Cancel'|@translate}
+
+
{if count($categories) }
-
-
-
{/if}
+
diff --git a/admin/themes/default/template/cat_move.tpl b/admin/themes/default/template/cat_move.tpl
index d0dc98e13..d8a9c9430 100644
--- a/admin/themes/default/template/cat_move.tpl
+++ b/admin/themes/default/template/cat_move.tpl
@@ -1,6 +1,3 @@
-
-{include file='include/resize.inc.tpl'}
-
{'Move albums'|@translate}
@@ -28,9 +25,8 @@
-
+
-
diff --git a/admin/themes/default/template/permalinks.tpl b/admin/themes/default/template/permalinks.tpl
index 57d8afa37..8ec0f3a6d 100644
--- a/admin/themes/default/template/permalinks.tpl
+++ b/admin/themes/default/template/permalinks.tpl
@@ -1,32 +1,62 @@
+{footer_script require='jquery.ui.sortable'}{literal}
+jQuery(document).ready(function(){
+ jQuery("#addPermalinkOpen").click(function(){
+ jQuery("#addPermalink").show();
+ jQuery("#showAddPermalink").hide();
+ });
+
+ jQuery("#addPermalinkClose").click(function(){
+ jQuery("#addPermalink").hide();
+ jQuery("#showAddPermalink").show();
+ });
+});
+{/literal}{/footer_script}
+
+{literal}
+
+{/literal}
+
{'Permalinks'|@translate}
-
-
+
+ {'Permalink'|@translate}
+
+
+
+
+
+
+ {'Cancel'|@translate}
-
+
-{'Permalinks'|@translate}
-
+
-{'Permalink history'|@translate}
-
+
\ No newline at end of file
diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css
index dd49c3ee4..53f220fb6 100644
--- a/admin/themes/default/theme.css
+++ b/admin/themes/default/theme.css
@@ -151,26 +151,24 @@ SELECT.categoryList {
width: 100%;
}
-FORM#categoryOrdering {
- padding-left: 1em; /* same as FIELDSET margin (there is no fieldset in this form) */
- padding-right: 1em; /* same as FIELDSET margin (there is no fieldset in this form) */
-}
FORM#categoryOrdering p {
text-align: left;
- margin-top: 1em;
- margin-bottom: 1em;
+ /* margin-top: 1em; */
+ /* margin-bottom: 1em; */
}
UL.categoryUl {
list-style: none;
padding: 0;
- margin: 0;
+ margin: 1em;
}
LI.categoryLi {
+/*
width: 100%;
- border: 1px solid #666;
- padding: 0px 5px;
+*/
+ padding: 5px;
margin-bottom: 5px;
+ border-radius:5px;
}
FORM#categoryOrdering UL.categoryActions {
@@ -1072,4 +1070,12 @@ p#uploadModeInfos {text-align:left;margin-top:1em;font-size:90%;color:#999;}
#pendingComments .bottomButtons {
text-align:left;
-}
\ No newline at end of file
+}
+
+FORM#categoryOrdering p.albumTitle {margin:0;}
+FORM#categoryOrdering p.albumActions {visibility:hidden; margin:0}
+FORM#categoryOrdering .categoryLi:hover p.albumActions {visibility:visible;}
+
+.showCreateAlbum {text-align:left; margin:0 1em 1em 1em;line-height:22px;}
+#autoOrder p, #createAlbum p {text-align:left; margin:0 0 1em 0;}
+#autoOrder p.actionButtons, #createAlbum p.actionButtons {margin-bottom:0;}
\ No newline at end of file
diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css
index 02830f05e..238148a4b 100644
--- a/admin/themes/roma/theme.css
+++ b/admin/themes/roma/theme.css
@@ -85,8 +85,8 @@ INPUT[type="submit"]:hover , INPUT[type="reset"]:hover { cursor: pointer; }
INPUT.bigbutton:hover { background-color: #222; color:#f33; border: 0; }
.throw { font-size: 120%; line-height: 26px; padding-top: 10px; font-weight: bold; color: #ff3363; }
label { cursor:pointer }
-.categoryLi, .menuLi { background: #222 }
-.virtual_cat, .menuLi_hidden { background: #333 !important; }
+.categoryLi, .menuLi { background: #333 }
+.menuLi_hidden { background: #333 !important; }
a.Piwigo {
font-family: verdana, arial, helvetica, sans-serif !important;
font-size: 11px; font-weight: normal; letter-spacing: 0;
--
cgit v1.2.3