Login or Register

RSS IconRecent posts in this topic

avatar
tyneskj on Dec 12. 2006. 1:14 am
I have made a working modification for a 10 day color gradiant (yellow-to-red-shift) with a simple case setup, using elseif.

-Colors in rewrites.css could use a little less saturation.
-A more elegant solution with concatenation would be nice.
Basically something like...

$cssvar = '<div class=\"milestone important\"';
for($countervar=0,$countervar<10,$countervar++) {
echo " $cssvar.$countervariable.'>'; }

2 files modified
rewrite.css
view_milestone.php

rewrites.css
---------------------
.important {
border-color: red++++;
/* background: #FFFAFA; */
background-color: #FF5500;
}
.important0 {
border-color: red+++;
background-color: #FF7700;
}
.important1 {
border-color: red++;
background-color: #FF9900;
}
.important2 {
border-color: red+;
background-color: #FFBB00;
}
.important3 {
border-color: red;
background-color: #FFDD00;
}
.important4 {
border-color: yellow++++++;
background-color: #FFFF00;
}
.important5 {
border-color: yellow+++++;
background-color: #FFFF22;
}
.important6 {
border-color: yellow++++;
background-color: #FFFF44;
}
.important7 {
border-color: yellow+++;
background-color: #FFFF66;
}
.important8 {
border-color: yellow++;
background-color: #FFFF88;
}
.important9 {
border-color: yellow+;
background-color: #FFFFAA;
/*weakest important value Green=-#1A,blue=-#14*/
/*prior value FFFFCC*/
}

view_milestone.php
---------------------
<?php
add_stylesheet_to_page('project/milestones.css');
?>
<?php if($milestone->isCompleted()) { ?>
<div class="milestone success">
<?php } elseif($milestone->isLate()) { ?>
<div class="milestone important">
<!-- *****OPEN******** Addition of importance ranking -->
<?php } elseif($milestone->isToday()) { ?>
<div class="milestone important0">
<?php } elseif($milestone->getLeftInDays()==1) { ?>
<div class="milestone important1">
<?php } elseif($milestone->getLeftInDays()==2) { ?>
<div class="milestone important2">
<?php } elseif($milestone->getLeftInDays()==3) { ?>
<div class="milestone important3">
<?php } elseif($milestone->getLeftInDays()==4) { ?>
<div class="milestone important4">
<?php } elseif($milestone->getLeftInDays()==5) { ?>
<div class="milestone important5">
<?php } elseif($milestone->getLeftInDays()==6) { ?>
<div class="milestone important6">
<?php } elseif($milestone->getLeftInDays()==7) { ?>
<div class="milestone important7">
<?php } elseif($milestone->getLeftInDays()==8) { ?>
<div class="milestone important8">
<?php } elseif($milestone->getLeftInDays()==9) { ?>
<div class="milestone important9">
<!-- *****CLOSE******** Addition of importance ranking -->
<?php } else { ?>
<div class="milestone hint">
<?php } // if?>
avatar
tyneskj on Dec 12. 2006. 2:20 am
I have put together the 3 modifications I have made & posted them to flickr
-10 day color yellow-to-red
- New Tasks | New Messages
- Task list discription
-Only Open Task are listed

http://www.flickr.com/photos/12017965@N00/320575234/
avatar
armeck on Jan 26. 2007. 1:07 pm
This is a nice idea, thanks. So do I simply add the text to the files you list or is there something more to do?
avatar
ryan.doherty on Feb 6. 2007. 6:05 pm
This is a good idea, but I think your code can be cleaned up a bit. Remove all your ifelse's and do something like:

<?php
if(1 <= $milestone->getLeftInDays() && 9 >= $milestone->getLeftInDays())
{
$class= 'important'.$milestone->getLeftInDays();
?>
<div class="milestone <?php echo $class;?>">

<?php } //end if ?>

And are +'s allowed in CSS color declarations? I don't think they are...

-Ryan
Topic is locked. If you have something important to say about issues discussed on this page please write at hi@a51dev.com.

RSS IconRecent posts in this topic