Commit 06118de0 authored by Jason Frisvold's avatar Jason Frisvold
Browse files

- Switch tag management to a list of checkboxes

- Added config variable to control # of tag columns
- Fixed assign_tags to use count instead of id for array numbering
- Smarty code to vertically align and order tags
- - Thanks Smarty Forum (http://www.smarty.net/forums/viewtopic.php?t=2367)
- Remove method from forms (not needed since we're using ajax)
- Fixed the checked attribute to use variable= syntax
- Fixed missing end tag for link
parent 87078eb6
......@@ -44,6 +44,7 @@ tr.even { border: thin solid; color: black; }
#t_subject { width: 65%; }
#t_duedate { width: 10%; }
#t_action { width: 5%; }
#tags td { text-align: left; }
/* Division elements */
div.centered { text-align: center; }
......
......@@ -53,6 +53,19 @@
});
});
// Bind a click function to toggle checkboxes for tags
$( '#tag_management_list span' ).each( function() {
$( this ).bind('click', function() {
checkbox = $( this ).prev('input');
checkbox.attr('checked', !checkbox.attr('checked'));
});
});
// Bind the submit button for tag managment
$( '#tagSubmit' ).bind('click', function() {
alert('Do something here');
});
// Bind the edit tags function to each edit link
$( '.editTags' ).each( function() {
$( this ).bind('click', editTagsDialog );
......
......@@ -93,17 +93,21 @@ function assign_tags(&$smarty, &$user_obj, $usefilter = false) {
}
if ($result = $sqlhdlr->query($query)) {
$tfcount = 0;
$tlcount = 0;
while ($line = $result->fetch_array()) {
if (isset($filtered) && (in_array($line[0], $filtered))) {
$tagfilter[$line[0]]['id'] = $line[0];
$tagfilter[$line[0]]['tag'] = $line[1];
$tagfilter[$line[0]]['count'] = $line[2];
$tagfilter[$line[0]]['first'] = strtoupper(substr($line[1], 0, 1));
$tagfilter[$tfcount]['id'] = $line[0];
$tagfilter[$tfcount]['tag'] = $line[1];
$tagfilter[$tfcount]['count'] = $line[2];
$tagfilter[$tfcount]['first'] = strtoupper(substr($line[1], 0, 1));
$tfcount++;
} else {
$taglist[$line[0]]['id'] = $line[0];
$taglist[$line[0]]['tag'] = $line[1];
$taglist[$line[0]]['count'] = $line[2];
$taglist[$line[0]]['first'] = strtoupper(substr($line[1], 0, 1));
$taglist[$tlcount]['id'] = $line[0];
$taglist[$tlcount]['tag'] = $line[1];
$taglist[$tlcount]['count'] = $line[2];
$taglist[$tlcount]['first'] = strtoupper(substr($line[1], 0, 1));
$tlcount++;
}
}
......
......@@ -105,6 +105,8 @@
$smarty->assign('cur_sort_type', $user_obj->sort_stabilizer());
$smarty->assign('cur_sort_order', $user_obj->sort_order());
$smarty->assign('columns', $phpTodo_tag_columns);
// Get all of the feed info from the database
$query = sprintf('SELECT id FROM feeds WHERE user_id = %d',
$user_obj->user_id());
......
......@@ -65,6 +65,9 @@ $phpTodo_max_feeds = 5;
// The maximum number of tags a user can create
$phpTodo_max_tags = 25;
// The number of columns to use in the Tag Management preferences display
$phpTodo_tag_columns = 6;
// The RSS channel Time To Live (in Minutes)
$phpTodo_channelttl = 15;
......
......@@ -53,7 +53,7 @@
</td><td>
<input type='hidden' name='feed_id' value='{$row.feed_id|default:""}' />
{if (isset($row) && ($row.feed_show == 1))}
<input type='checkbox' name='feed_show' checked />
<input type='checkbox' name='feed_show' checked='checked' />
{else}
<input type='checkbox' name='feed_show' />
{/if}
......
......@@ -19,7 +19,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1' />
<link rel='shortcut icon' type='image/x-icon' href='{$phpTodo_favicon}'>
<link rel='shortcut icon' type='image/x-icon' href='{$phpTodo_favicon}' />
<link rel='stylesheet' href='css/reset.css' type='text/css' />
<link rel='stylesheet' href='{$phpTodo_stylesheet}' type='text/css' />
{include file='ajax_libraries.tpl'}
......@@ -74,24 +74,53 @@
</form>
</div>
<hr class='onethird' />
<div class='todolist'>
<div id='tag_management_list'>
<h3>Tag Management</h3>
<div id="tag_management_list">
{assign var='first' value=''}
{foreach name=fetag from=$taglist item=row}
{if $first != $row.first}
<b>{$row.first}:</b>
{math equation="ceil(count / columns)"
count=$taglist|@count
columns=$columns
assign="columnHeight"}
<form id='tags'>
<div class='centered'>
{section name=tr loop=$columnHeight}
{if $smarty.section.tr.first == true}
<table>
<tbody>
{/if}
<span class='editTags'>{$row.tag}</span>
{if ! $smarty.foreach.fetag.last}, {/if}
{assign var='first' value=$row.first}
{/foreach}
</div>
<tr>
{section name=td start=$smarty.section.tr.index step=$columnHeight loop=$columnHeight*$columns}
<td>
{if isset($taglist[td])}
<input type='checkbox' name='tag_{$taglist[td].id}' /><span>{$taglist[td].tag}</span>
{else}
{/if}
</td>
{/section}
</tr>
{if $smarty.section.tr.last == true}
</tbody>
</table>
{/if}
{/section}
<br />
<select name='tagAction'>
<option>Merge / Rename</option>
<option>Split</option>
<option>Delete</option>
</select>
<input type='button' id='tagSubmit' value='Go' />
</div>
</form>
</div>
<hr class='onethird' />
<div id='formdiv'>
<h3>Web Feeds</h3>
<form id='feeds' method='post' action='prefs.php'>
<form id='feeds' action='#'>
<div class='centered'>
<table id='feedsTable'>
<thead>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment