Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: r3822/3: New Sections panel
Dragondz wrote:
if it works for you then maybe it s a local install problem!
I wouldn’t like to risk it! My installation has been pretty well mangled during development and, while I try to keep it pristine and up-to-date with the current SVN, sometimes I experiment with things. If someone else could either confirm/deny the language update works / doesn’t work on live servers and/or local installs we can ascertain whether it’s a bug that needs fixing or an unfortunate side-effect of being local.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: r3822/3: New Sections panel
philwareham wrote:
I’m toying with moving the ‘show details’ toggle to the top right side of the page, since we have some dead space there and it’s logical for the details toggle to be before the table itself.
At the top of the page, or just before the table? The latter might make sense. Putting it at the top of the page just feels real odd. It is a control that applies to the table data after all.
My initial thoughts were to have the multi-edit manage fields duplicated at top and bottom of table list, but I’d like to hear user opinions on that.
I think that would be too much clutter. That is one of the many things that annoy me in the Wordpress UI. I prefer to see them at the bottom. The primary intent of those tables is to get an overview of the data available
EDIT: also, we are considering removing the ‘odd’ and ‘even’ classes from table
tbodyrows. Now that table layouts throughout the admin-side are tidied up this can be achieved withnth-childCSS rules by theme authors instead (OK, I know IE8 and below don’t support that rule but since it’s purely aesthetic we can accept that regression, right?).
Well IE8 doesn’t support :nth-child(), nth-child() is more verbose (vs the 2 classes) and is slower (the tables are simple & short enough that that doesn’t matter too much). Otherwise, fine by me.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: r3822/3: New Sections panel
Bloke wrote:
If someone else could either confirm/deny the language update works / doesn’t work on live servers and/or local installs we can ascertain whether it’s a bug that needs fixing or an unfortunate side-effect of being local.
Updating languages works fine here on both my localhost installs (never failed). Will test again once I update my test install on a live server (@DreamHost) – I didn’t fail so far, but it is a bit behind the SVN times. And it was sometimes sloooow.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: r3822/3: New Sections panel
Is that Create new section field on the Section panel by design? Shouldn’t that just be a link pointing to the editor form. Not that it looks stranded (which it does), but when creating a new section it just blobs the section somewhere there on the list. To set any of the options for the new section, you will have to scroll through the pages to find it and then click it’s name. Usability nightmare, some might add.
The field actually confuses me. What is that the field should exactly do. Does it set the Title and automatically create a sanitized version for the name, or does it just set the section name, or does it use that same value for both… brain hurts. Can’t know by looking. Hulk smash button to see. Hulk no see section. Hulk scroll to section.
PS. the link in the message when creating a new section points to the old location (uses the anchor thing).
Last edited by Gocom (2012-06-23 03:39:59)
Offline
Offline
Offline
Re: r3822/3: New Sections panel
Gocom wrote:
It’s pretty neat how it uses events in its advantage to load the strings.
As in “not at all”, you mean?
Offline
Offline
Re: r3822/3: New Sections panel
I think that since we now display each section’s article_count it would deserve its own sortable table column. It would be much more useful without requiring a lot of additional code.
Offline
Re: r3822/3: New Sections panel
wet wrote:
I think that since we now display each section’s article_count it would deserve its own sortable table column. It would be much more useful without requiring a lot of additional code.
What about performance? The counting currently adds up to 100 extra individual queries to the page. Joining the queries wouldn’t be a bad idea. Which is probably what you, Robert, are thinking of, if you are making the column sortable.
Offline
Re: r3822/3: New Sections panel
I’m thinking of nothing particular at all but just trying to influence Stef as he’s this feature’s owner ;)
Offline
Offline
Re: r3822/3: New Sections panel
@gocom
I think you’re right about the create new section field on sections list page. It should instead be just a link to the edit form like on users page. In the future that edit panel will be modal so that’d work fine
Offline
Re: r3822/3: New Sections panel
Above sub-query in a form of a patch:
Index: include/txp_section.php
===================================================================
--- include/txp_section.php (revision 3828)
+++ include/txp_section.php (working copy)
@@ -160,10 +160,9 @@
list($page, $offset, $numPages) = pager($total, $limit, $page);
echo n.section_search_form($crit, $search_method).'</div>';
+
+ $rs = safe_rows_start('*, (SELECT count(*) FROM '.safe_pfx('textpattern').' articles WHERE articles.Section = txp_section.name) AS article_count', 'txp_section', "$criteria order by $sort_sql limit $offset, $limit");
- $rs = safe_rows_start('*', 'txp_section',
- "$criteria order by $sort_sql limit $offset, $limit");
-
if ($rs)
{
echo n.'<div id="'.$event.'_container" class="txp-container">';
@@ -194,8 +193,7 @@
a.'dir='.$dir.a.'page='.$page.a.'search_method='.$search_method.a.'crit='.$crit;
$page_url = '?event=page'.a.'name='.$sec_page;
$style_url = '?event=css'.a.'name='.$sec_css;
- $article_count = safe_count('textpattern', "Section = '".doSlash($sec_name)."'");
-// $can_delete = ($sec_name == 'default' || $article_count > 0) ? false : true;
+// $can_delete = ($sec_name == 'default' || $sec_article_count > 0) ? false : true;
$is_default_section = ($sec_name == 'default');
echo tr(
@@ -208,7 +206,7 @@
td(txpspecialchars($sec_title), '', 'name').
td(
'<a href="'.$page_url.'" title="'.gTxt('edit').'">'.$sec_page.'</a>'.n.
- ( ($article_count > 0) ? '<a title="'.gTxt('article_count', array('{num}' => $article_count)).'" href="?event=list'.a.'step=list'.a.'search=Go'.a.'search_method=section'.a.'crit='.htmlspecialchars($sec_name).'">('.$article_count.')</a>' : ($is_default_section ? '' : '(0)') )
+ ( ($sec_article_count > 0) ? '<a title="'.gTxt('article_count', array('{num}' => $sec_article_count)).'" href="?event=list'.a.'step=list'.a.'search=Go'.a.'search_method=section'.a.'crit='.htmlspecialchars($sec_name).'">('.$sec_article_count.')</a>' : ($is_default_section ? '' : '(0)') )
, '', 'page').
td('<a href="'.$style_url.'" title="'.gTxt('edit').'">'.$sec_css.'</a>', '', 'style').
Which then allows easily using article_count in the order by statement, and creating sortable <table> columns with it. Plus it saves memory and 100 queries.
Offline
Re: r3822/3: New Sections panel
philwareham wrote:
I think you’re right about the create new section field on sections list page. It should instead be just a link to the edit form like on users page. In the future that edit panel will be modal so that’d work fine
Speaking of links and Users panel; shouldn’t those be links too? Currently on the User’s panel those are forms too with buttons. I.e. shouldn’t this:
<form method="post" action="index.php" id="change_password"><p><input type="submit" value="Change your password" /><input type="hidden" value="admin" name="event" /><input type="hidden" value="new_pass_form" name="step" /></p>
<input type="hidden" value="11e2da4b41b1a2d7ad1a65104bfca654" name="_txp_token" />
</form>
<form method="post" action="index.php" id="author_create"><p><input type="submit" value="Add new author" /><input type="hidden" value="admin" name="event" /><input type="hidden" value="author_edit" name="step" /></p>
<input type="hidden" value="11e2da4b41b1a2d7ad1a65104bfca654" name="_txp_token" />
</form>
</div>
Be just simply:
<p class="nav-tertiary"><a class="navlink" href="?event=users&step=new_pass_form">Change your Password</a><a class="navlink" href="#">Add new author</a></p>
Last edited by Gocom (2012-06-23 06:53:00)
Offline