Separate data from presentation for the developer photos, simplify the

code and center the images in the table.

NOTE: I don't want to get all MVC-y, but lets try to keep data and html as 
separate as possible. Thanks.



SVN revision: 52145
This commit is contained in:
Andres Blanc 2010-09-10 16:31:50 +00:00
parent 8e6eb46bda
commit dcbf1b7a61
4 changed files with 17 additions and 10 deletions

View File

@ -98,7 +98,7 @@ documentation feel free to report it in the <a href="http://trac.enlightenment.o
<tbody>
<?php foreach ( developers_active() as $login => $data ): ?>
<tr <?php tr_odd() ?>>
<td class="photo"> <?php echo $data['Photo']; ?></td>
<td class="photo"> <?php echo dev_data_photo($data) ?></td>
<td class="name"> <?php td(dev_data_contact($data)) ?></td>
<td class="manage"> <?php td(@$data['Managing'] . @$data['Contributing']) ?></td>
<td class="irc"> <?php td(dev_data_irc($data)) ?></td>

View File

@ -1,4 +1,6 @@
<?php
/* DON'T PUT HTML HERE, PUT IT IN HELPERS.PHP */
/**
@return Multi-level array of developer data in the format:
@ -35,7 +37,6 @@ function _developer_path_filter ( $path )
return true;
}
function _developer_list ( $paths )
{
$developers = array();
@ -44,14 +45,7 @@ function _developer_list ( $paths )
{
$file = file("$path/info.txt", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$entry = _developer_info($file);
if ( file_exists("$path/icon-sml.png") )
{
$f = basename($path);
$entry['Photo'] = "<img src=http://download.enlightenment.org/devs/$f/icon-sml.png width=40 height=54 border=0>";
} else
{
$entry['Photo'] = "<img src=i/logo-s.png width=18 height=24 border=0>";
}
$entry['Photo'] = file_exists("$path/icon-sml.png");
$developers[$entry['Name']] = $entry;
}
@ -76,6 +70,9 @@ function _developer_info ( $file )
/**
@return Multi-level array of inactive developer data (with less fields).
@todo Create a "inactive" folder in SVN to move the data of inactive
developers there instead of deleting them. Parse that.
*/
function developers_inactive ()
{

View File

@ -1,4 +1,5 @@
<?php
/* PUT HTML RELATED FUNCTIONS HERE */
/* Not yet... */
// function button ( $url, $title )
@ -34,6 +35,14 @@ function tr_odd ( $reset = false )
Functions for developers lists.
*/
function dev_data_photo( $data )
{
if ( $data['Photo'] )
return "<img src='http://download.enlightenment.org/devs/{$data['Login']}/icon-sml.png' width='40' height='54' border='0'>";
else
return "<img src='i/logo-s.png' width='18' height='24' border='0'>";
}
function dev_data_www ( $data )
{
$url = @$data["WWW"];

View File

@ -71,6 +71,7 @@ table.data tbody tr td { color: #444; background-color: #fff; padding: 3px; text
table.data tbody tr.odd td { color: #444; background-color: #eee; }
table.developers td.name { width: 12em; }
table.developers td.photo { text-align: center }
table.developers td.location { width: 14em; }
table.developers.active caption { display: none; }
table.developers td { padding-right: 1ex; }