Skip to content

Commit

Permalink
Fix html validation and css for manage tags pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryn Warriner committed Feb 9, 2011
1 parent 413abf7 commit ee85bea
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 270 deletions.
14 changes: 10 additions & 4 deletions css/default.css
Expand Up @@ -126,10 +126,10 @@ td.login-info-right { width: 33%; padding: 0px; text-align: right; white-space:
.main-menu ul li a { padding-right: .9em; border-right: 1px solid #000; text-decoration: underline; }
.main-menu ul li > a#logout-link { padding-right: 0; border-right: none; }

#manage-menu, #account-menu, #summary-menu , #summary-submenu, #manage-config-menu, #manage-user-filter-menu { float: left; width: 100%; margin: 0; padding: 0; overflow: hidden; font-size: 1em; position: relative; top: -1.5em; }
#manage-menu ul, #manage-config-menu ul, #summary-menu ul, #summary-submenu ul, #manage-user-filter-menu ul { clear: left; float: left; list-style: none; position: relative; left: 50%; padding: 0; margin: 0; text-align: center; }
#manage-menu ul li, #manage-config-menu ul li, #summary-menu ul li, #summary-submenu ul li, #manage-user-filter-menu ul li { display:block; float: left; list-style: none; margin: .5em 0; padding: 0; position: relative; right: 50%; }
#manage-menu ul a, #manage-config-menu ul a, #summary-menu ul a, #summary-submenu ul a, #account-menu ul a, #doc-menu ul a, #manage-user-filter-menu ul a { text-decoration: underline; padding: 0 .25em; }
#manage-menu, #account-menu, #summary-menu , #summary-submenu, #manage-config-menu, #manage-user-filter-menu, #manage-tags-filter-menu { float: left; width: 100%; margin: 0; padding: 0; overflow: hidden; font-size: 1em; position: relative; top: -1.5em; }
#manage-menu ul, #manage-config-menu ul, #summary-menu ul, #summary-submenu ul, #manage-user-filter-menu ul, #manage-tags-filter-menu ul { clear: left; float: left; list-style: none; position: relative; left: 50%; padding: 0; margin: 0; text-align: center; }
#manage-menu ul li, #manage-config-menu ul li, #summary-menu ul li, #summary-submenu ul li, #manage-user-filter-menu ul li, #manage-tags-filter-menu ul li { display:block; float: left; list-style: none; margin: .5em 0; padding: 0; position: relative; right: 50%; }
#manage-menu ul a, #manage-config-menu ul a, #summary-menu ul a, #summary-submenu ul a, #account-menu ul a, #doc-menu ul a, #manage-user-filter-menu ul a, #manage-tags-filter-menu ul a { text-decoration: underline; padding: 0 .25em; }

#account-menu, #doc-menu { top: 0; }
#account-menu ul, #doc-menu ul { margin: 0 auto; padding: .25em; float: right; text-align: center; }
Expand Down Expand Up @@ -547,3 +547,9 @@ ul.project-list li span.view-state:before { content: ' ('; }
ul.project-list li span.view-state:after { content: ') '; }
ul.project-list li span.project-name { display: block; float: left; min-width: 15em; }
ul.project-list li span.access-level, ul.project-list li span.view-state { display: block; float: left; margin: 0em .25em; }

.tag-list td span.tag-filter:before { content: ' ['; padding: 0em .5em; }
.tag-list td span.tag-filter:after { content: '] '; padding: 0em .5em; }
.tag-link {
margin: 0em .5em;
}
186 changes: 69 additions & 117 deletions manage_tags_page.php
Expand Up @@ -55,10 +55,6 @@

compress_enable();

html_page_top( lang_get( 'manage_tags_link' ) );

print_manage_menu( 'manage_tags_page.php' );

$t_can_edit = access_has_global_level( config_get( 'tag_edit_threshold' ) );
$f_filter = utf8_strtoupper( gpc_get_string( 'filter', config_get( 'default_manage_tag_prefix' ) ) );
$f_page_number = gpc_get_int( 'page_number', 1 );
Expand All @@ -75,26 +71,6 @@
$t_prefix_array[] = "$i";
}

echo '<br /><table class="width75"><tr>';

foreach ( $t_prefix_array as $t_prefix ) {
if ( $t_prefix === 'ALL' ) {
$t_caption = lang_get( 'show_all_tags' );
} else {
$t_caption = $t_prefix;
}

if ( $t_prefix == $f_filter ) {
$t_link = "<strong>$t_caption</strong>";
} else {
$t_link = '<a href="manage_tags_page.php?filter=' . $t_prefix .'">' . $t_caption . '</a>';
}

echo '<td>' . $t_link . '</td>';
}

echo '</tr></table>';

$t_where_params = array();

if ( $f_filter === 'ALL' ) {
Expand Down Expand Up @@ -143,101 +119,77 @@

$t_result = db_query_bound( $t_query, $t_where_params, $t_per_page, $t_offset );

?>

<br/>

<!-- Tag Table Start -->
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="4">
<?php echo lang_get( 'manage_tags_link' ) ?> [<?php echo $t_total_tag_count ?>]
<?php print_link( '#tagcreate', lang_get( 'tag_create' ) ) ?>
</td>
</tr>
<tr class="row-category">
<td width="25%"><?php echo lang_get( 'tag_name' ) ?></td>
<td width="20%"><?php echo lang_get( 'tag_creator' ) ?></td>
<td width="20%"><?php echo lang_get( 'tag_created' ) ?></td>
<td width="20%"><?php echo lang_get( 'tag_updated' ) ?></td>
</tr>
<?php
foreach ( $t_result as $t_tag_row ) {
$t_tag_name = string_display_line( $t_tag_row['name'] );
$t_tag_description = string_display( $t_tag_row['description'] );
?>
<tr <?php echo helper_alternate_class() ?>>
<?php if ( $t_can_edit ) { ?>
<td><a href="tag_view_page.php?tag_id=<?php echo $t_tag_row['id'] ?>" ><?php echo $t_tag_name ?></a></td>
<?php } else { ?>
<td><?php echo $t_tag_name ?></td>
<?php } ?>
<td><?php echo string_display_line( user_get_name( $t_tag_row['user_id'] ) ) ?></td>
<td><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_created'] ) ?></td>
<td><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_updated'] ) ?></td>
</tr>
<?php } ?>

<tr>
<td class="right" colspan="8">
<span class="small">
<?php
/* @todo hack - pass in the hide inactive filter via cheating the actual filter value */
print_page_links( 'manage_tags_page.php', 1, $t_page_count, (int)$f_page_number, $f_filter );
?>
</span>
</td>
</tr>
</table>
html_page_top( lang_get( 'manage_tags_link' ) );
print_manage_menu( 'manage_tags_page.php' ); ?>

<div id="manage-tags-filter-menu">
<ul class="menu"><?php
foreach ( $t_prefix_array as $t_prefix ) {
$t_caption = ( $t_prefix === 'ALL' ? lang_get( 'show_all_tags' ) : $t_prefix );
if ( $t_prefix == $f_filter ) {
$t_link = "<strong>$t_caption</strong>";
} else {
$t_link = '<a href="manage_tags_page.php?filter=' . $t_prefix .'">' . $t_caption . '</a>';
}
echo "<li>$t_link </li>";
} ?>
</ul>
</div>

<div class="table-container">
<h2><?php echo lang_get( 'manage_tags_link' ) ?> [<?php echo $t_total_tag_count ?>]</h2>
<div class="section-link"><?php print_link( '#tagcreate', lang_get( 'tag_create' ) ) ?></div>
<table cellspacing="1" cellpadding="5" border="1">
<tr class="row-category">
<td><?php echo lang_get( 'tag_name' ) ?></td>
<td><?php echo lang_get( 'tag_creator' ) ?></td>
<td><?php echo lang_get( 'tag_created' ) ?></td>
<td><?php echo lang_get( 'tag_updated' ) ?></td>
</tr><?php
foreach ( $t_result as $t_tag_row ) {
$t_tag_name = string_display_line( $t_tag_row['name'] );
$t_tag_description = string_display( $t_tag_row['description'] ); ?>
<tr <?php echo helper_alternate_class() ?>><?php
if ( $t_can_edit ) { ?>
<td><a href="tag_view_page.php?tag_id=<?php echo $t_tag_row['id'] ?>" ><?php echo $t_tag_name ?></a></td><?php
} else { ?>
<td><?php echo $t_tag_name ?></td><?php
} ?>
<td><?php echo string_display_line( user_get_name( $t_tag_row['user_id'] ) ) ?></td>
<td><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_created'] ) ?></td>
<td><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_updated'] ) ?></td>
</tr><?php
} ?>
</table>
<div class="pager-links"><?php
/* @todo hack - pass in the hide inactive filter via cheating the actual filter value */
print_page_links( 'manage_tags_page.php', 1, $t_page_count, (int)$f_page_number, $f_filter ); ?>
</div>
</div>

<?php if ( $t_can_edit ) { ?>

<br />
<a name="tagcreate" />

<!-- Create Tag Form -->

<form method="post" action="tag_create.php">
<?php echo form_security_field( 'tag_create' ); ?>

<table class="width75" cellspacing="1">

<!-- Title -->

<tr>
<td class="form-title" colspan="2">
<?php echo lang_get( 'tag_create' ) ?>
</td>
</tr>
<tr class="row-1">
<td class="category">
<span class="required">*</span>
<?php echo lang_get( 'tag_name' ) ?>
</td>
<td>
<input type="text" name="name" size="50" maxlength="100" />
<?php echo sprintf( lang_get( 'tag_separate_by' ), config_get( 'tag_separator' ) ); ?>
</td>
</tr>
<tr class="row-2">
<th class="category">
<?php echo lang_get( 'tag_description' ) ?>
</th>
<td><textarea name="description" cols="80" rows="6"></textarea>
</td>
</tr>
<tr>
<td class="left">
<span class="required"> * <?php echo lang_get( 'required' ) ?></span>
</td>
<td class="center" colspan="2">
<input type="submit" class="button" value="<?php echo lang_get( 'tag_create' ) ?>" />
</td>
</tr>

</table>
</form>

<div id="manage-tags-create-div" class="form-container">
<a name="tagcreate" />
<form id="manage-tags-create-form" method="post" action="tag_create.php">
<fieldset class="has-required">
<legend><span><?php echo lang_get( 'tag_create' ) ?></span></legend>
<?php echo form_security_field( 'tag_create' ); ?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<label for="tag-name" class="required"><span><?php echo lang_get( 'tag_name' ) ?></span></label>
<span class="input"><input type="text" id="tag-name" name="name" size="40" maxlength="100" />
<span><?php echo sprintf( lang_get( 'tag_separate_by' ), config_get( 'tag_separator' ) ); ?></span>
</span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<label for="tag-description"><span><?php echo lang_get( 'tag_description' ) ?></span></label>
<span class="textarea"><textarea id="tag-description" name="description" cols="80" rows="6"></textarea></span>
<span class="label-style"></span>
</div>
<span class="submit-button"><input type="submit" class="button" value="<?php echo lang_get( 'tag_create' ) ?>" /></span>
</fieldset>
</form>
</div>
<?php
} #End can Edit

Expand Down
113 changes: 49 additions & 64 deletions tag_update_page.php
Expand Up @@ -74,70 +74,55 @@

html_page_top( sprintf( lang_get( 'tag_update' ), $t_name ) );
?>

<br/>
<form method="post" action="tag_update.php">
<?php echo form_security_field( 'tag_update' ) ?>
<table class="width100" cellspacing="1">

<!-- Title -->
<tr>
<td class="form-title" colspan="2">
<?php echo sprintf( lang_get( 'tag_update' ), $t_name ) ?>
<input type="hidden" name="tag_id" value="<?php echo $f_tag_id ?>"/>
</td>
<td class="right" colspan="3">
<?php print_bracket_link( 'tag_view_page.php?tag_id='.$f_tag_id, lang_get( 'tag_update_return' ) ); ?>
</td>
</tr>

<!-- Info -->
<tr class="row-category">
<td width="15%"><?php echo lang_get( 'tag_id' ) ?></td>
<td width="25%"><?php echo lang_get( 'tag_name' ) ?></td>
<td width="20%"><?php echo lang_get( 'tag_creator' ) ?></td>
<td width="20%"><?php echo lang_get( 'tag_created' ) ?></td>
<td width="20%"><?php echo lang_get( 'tag_updated' ) ?></td>
</tr>

<tr <?php echo helper_alternate_class() ?>>
<td><?php echo $t_tag_row['id'] ?></td>
<td><input type="text" <?php echo helper_get_tab_index() ?> name="name" value="<?php echo $t_name ?>"/></td>
<td><?php
if ( access_has_global_level( config_get( 'tag_edit_threshold' ) ) ) {
echo '<select ', helper_get_tab_index(), ' name="user_id">';
print_user_option_list( $t_tag_row['user_id'], ALL_PROJECTS, config_get( 'tag_create_threshold' ) );
echo '</select>';
} else {
echo string_display_line( user_get_name($t_tag_row['user_id']) );
}
?></td>
<td><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_created'] ) ?> </td>
<td><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_updated'] ) ?> </td>
</tr>

<!-- spacer -->
<tr class="spacer">
<td colspan="5"></td>
</tr>

<!-- Description -->
<tr <?php echo helper_alternate_class() ?>>
<th class="category"><?php echo lang_get( 'tag_description' ) ?></th>
<td colspan="4">
<textarea name="description" <?php echo helper_get_tab_index() ?> cols="80" rows="6"><?php echo string_textarea( $t_description ) ?></textarea>
</td>
</tr>

<!-- Submit Button -->
<tr>
<td class="center" colspan="6">
<input <?php echo helper_get_tab_index() ?> type="submit" class="button" value="<?php echo lang_get( 'tag_update_button' ) ?>" />
</td>
</tr>

</table>
</form>
<div class="form-container">
<form method="post" action="tag_update.php">
<fieldset>
<legend><span><?php echo sprintf( lang_get( 'tag_update' ), $t_name ) ?></span></legend>
<div class="section-link"><?php print_bracket_link( 'tag_view_page.php?tag_id='.$f_tag_id, lang_get( 'tag_update_return' ) ); ?></div>
<input type="hidden" name="tag_id" value="<?php echo $f_tag_id ?>"/>
<?php echo form_security_field( 'tag_update' ) ?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<span class="display-label"><span><?php echo lang_get( 'tag_id' ) ?></span></span>
<span class="display-value"><span><?php echo $t_tag_row['id'] ?></span></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<label for="tag-name"><span><?php echo lang_get( 'tag_name' ) ?></span></label>
<span class="input"><input type="text" <?php echo helper_get_tab_index() ?> id="tag-name" name="name" value="<?php echo $t_name ?>"/></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<?php
if ( access_has_global_level( config_get( 'tag_edit_threshold' ) ) ) {
echo '<label for="tag-user-id"><span>', lang_get( 'tag_creator' ), '</span></label>';
echo '<span class="select"><select ', helper_get_tab_index(), ' id="tag-user-id" name="user_id">';
print_user_option_list( $t_tag_row['user_id'], ALL_PROJECTS, config_get( 'tag_create_threshold' ) );
echo '</select></span>';
} else { ?>
<span class="display-label"><span><?php echo lang_get( 'tag_creator' ); ?></span></span>
<span class="display-value"><span><?php echo string_display_line( user_get_name($t_tag_row['user_id']) ); ?></span></span><?php
} ?>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<span class="display-label"><span><?php echo lang_get( 'tag_created' ) ?></span></span>
<span class="display-value"><span><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_created'] ) ?></span></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<span class="display-label"><span><?php echo lang_get( 'tag_updated' ) ?></span></span>
<span class="display-value"><span><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_updated'] ) ?></span></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<label for="tag-description"><span><?php echo lang_get( 'tag_description' ) ?></span></label>
<span class="textarea"><textarea id="tag-description" name="description" <?php echo helper_get_tab_index() ?> cols="80" rows="6"><?php echo string_textarea( $t_description ) ?></textarea></span>
<span class="label-style"></span>
</div>
<span class="submit-button"><input <?php echo helper_get_tab_index() ?> type="submit" class="button" value="<?php echo lang_get( 'tag_update_button' ) ?>" /></span>
</fieldset>
</form>
</div>

<?php
html_page_bottom();

0 comments on commit ee85bea

Please sign in to comment.