[kde-doc-english] www/sites/www-devel/edu

Elena M Ramírez eramirez at ximdex.com
Tue Apr 5 10:40:22 CEST 2011


SVN commit 1227144 by elenamramirez:

GUI: New design (css and images) for news page.

 AM            images/bg-date.png  
 AM            images/bg-news.png  
 M  +59 -6     kde-edu.css  
 M  +1 -1      news/index.php  
 M  +13 -9     site_includes/show_news.inc  


--- trunk/www/sites/www-devel/edu/kde-edu.css #1227143:1227144
@@ -38,9 +38,15 @@
   text-align:left;
 }
 
+#main table.kvtml tr td:first-child  {
+		text-align: center;
+		vertical-align: middle;
+}
+
 #main table.kvtml tr td img {
   margin:0;
   vertical-align:middle;
+  width: 20px;
 }
 
 #main dl dt {
@@ -55,21 +61,68 @@
 
 #main .edu-news {
   clear:both;
-  padding:15px;
+  padding:35px 0px 15px;
+  border-bottom: 1px dashed #c9d7e7;
+  margin-top: 15px;
+  background: url(../../images/bg-news.png) no-repeat left 50px;
 }
-
+#main .edu-news:first-child {
+	border-top: none;
+	}
 #main .edu-news-title {
-  margin-bottom:1ex;
+ /* margin-bottom:1ex;
   font-weight:bold;
-  font-size:larger;
+  font-size:larger;*/
+  font-size: 1.4em;
+  position: relative;
+  top: 35px;
+  left: 115px;
+  
 }
 
+#main .edu-news-title a{
+		border-bottom: none;
+		color: #0A71B4;
+	}
+
 #main .edu-news-date {
-  margin-bottom:1ex;
+  width: 120px;
+  background: url(../../images/bg-date.png) no-repeat left top;
+  margin-top: -15px;
 }
 
+#main .edu-news-date span{
+	display: block;	
+	text-align: center;
+	text-shadow: 1px 1px 0px #426fa1;
+	font-weight: bold;
+	font-family: Georgia;
+	margin-left: -3px;
+}
+
+
+#main .edu-news-date span.month{
+	padding-top: 10px;
+	text-transform: uppercase;
+	color: #426fa1;
+	text-shadow: 1px 1px 0px #c9d7e7;
+	font-size: .9em;
+}
+
+#main .edu-news-date span.day{
+	font-size: 1.6em;	
+	color: #FFF;
+	line-height: .9em;
+}
+#main .edu-news-date span.year{
+	
+	padding-bottom: 11px;
+	line-height: 1.2em;
+	color: #c9d7e7;
+}
 #main .edu-news-description {
-  padding:15px;
+  line-height: 1.3em;
+  padding: 20px;
 }
 
 #main .edu-news-readmore {
--- trunk/www/sites/www-devel/edu/news/index.php #1227143:1227144
@@ -8,7 +8,7 @@
 include "../site_includes/show_news.inc";
 ?>
 
-<p>You can read all news from our blogs as <a href="rss.php" title="RSS formatted KDE-Edu News Feed">RSS feed&nbsp;<img src="../pics/rss.png" class="inline" width="22" height="22" alt="RSS"/></a>.<br />
+<p>You can read all news from our blogs as <a href="rss.php" title="RSS formatted KDE-Edu News Feed"><img src="../pics/rss.png" class="inline" width="22" height="22" alt="RSS"/> RSS feed&nbsp;</a>.<br />
 Have a look at the KDE feed reader <a href="http://kde.org/applications/internet/akregator/" title="aKregator RSS/Atom reader">aKregator</a>.</p>
  
 <?php
--- trunk/www/sites/www-devel/edu/site_includes/show_news.inc #1227143:1227144
@@ -18,7 +18,8 @@
     // here come the list items, only using the title
 	  foreach($feedu->get_items(0, $length ) as $key => $item){
 	  	$date = date('j / M / Y', strtotime($item->get_date())); 
-      echo "  <li><a href=\"".$item->get_permalink()."\"><span class='title'>".$item->get_title()."</span><span class='date'>".$date."</span> <span class='desc'>".trim_desc($item->get_description())."</span></a></li>\n";
+	  $desc = substr($item->get_description(), 0, 40);
+      echo "  <li><a href=\"".$item->get_permalink()."\"><span class='title'>".$item->get_title()."</span><span class='date'>".$date."</span> <span class='desc'>".$desc."...</span></a></li>\n";
     }
     
     // list finished    
@@ -26,24 +27,27 @@
     
   } else {
   
+  	$dateFormat = '%sM%s%sj%s,%sY%s';
+  	$span1 = implode('\\', str_split('<span class="month">'));
+  	$span2 = implode('\\', str_split('<span class="day">'));
+  	$span3 = implode('\\', str_split('<span class="year">'));
+  	$spanClose = implode('\\', str_split('</span>'));
+    $dateFormat = sprintf($dateFormat, $span1, $spanClose, $span2, $spanClose, $span3, $spanClose);
+  	
     // here come the posts
 	  foreach($feedu->get_items(0, $length ) as $key => $item){
+	  	
 	    echo "<div class=\"edu-news\">\n";
       echo "  <div class=\"edu-news-title\"><a href=\"".$item->get_permalink()."\">".$item->get_title()."</a></div>\n";
-      echo "  <div class=\"edu-news-date\">" . $item->get_date( "F jS, Y" ) . "</div>\n";
+      echo "  <div class=\"edu-news-date\"><span class='month'>" . $item->get_date('M') . "</span><span class='day'>" . $item->get_date('j') . "</span><span class='year'>"  . $item->get_date('Y') . "</span></div>\n";
       echo "  <div class=\"edu-news-description\">" . $item->get_description() . "</div>\n";
       echo "  <div class=\"edu-news-readmore\"><a href=\"".$item->get_permalink()."\">Read more on " . $item->get_feed()->get_title() . " &raquo;</a></div>\n";
       echo "</div>\n";
+         
+      
     }
   }
 }
 
-function trim_desc($description) {
-	$maxChars = 40;
-	if (strlen($description) < $maxChars) {
-		$maxChars = strlen($description);
-	}
-	return substr($description, 0, $maxChars)."...";
 	
-}
 ?>
\ No newline at end of file


More information about the kde-doc-english mailing list