Move geshi css classes to respective templates
Move geshi css classes to respective templates

--- a/include/controller/Controller_Blame.class.php
+++ b/include/controller/Controller_Blame.class.php
@@ -165,7 +165,7 @@
 							$this->tpl->assign('geshihead', $geshihead);
 							$this->tpl->assign('geshibody', $geshibody);
 							$this->tpl->assign('geshifoot', $geshifoot);
-							$this->tpl->assign('extracss', $geshi->get_stylesheet());
+							$this->tpl->assign('geshicss', $geshi->get_stylesheet());
 							$this->tpl->assign('geshi', true);
 						}
 					}

--- a/include/controller/Controller_Blob.class.php
+++ b/include/controller/Controller_Blob.class.php
@@ -211,7 +211,7 @@
 						$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
 						$geshi->set_overall_id('blobData');
 						$this->tpl->assign('geshiout', $geshi->parse_code());
-						$this->tpl->assign('extracss', $geshi->get_stylesheet());
+						$this->tpl->assign('geshicss', $geshi->get_stylesheet());
 						$this->tpl->assign('geshi', true);
 						return;
 					}

--- a/templates/blame.tpl
+++ b/templates/blame.tpl
@@ -6,6 +6,14 @@
  * Copyright (C) 2010 Christopher Han <xiphux@gmail.com>
  *}
 {extends file='projectbase.tpl'}
+
+{block name=css}
+{if $geshicss}
+  <style type="text/css">
+  {$geshicss}
+  </style>
+{/if}
+{/block}
 
 {block name=main}
 

--- a/templates/blob.tpl
+++ b/templates/blob.tpl
@@ -6,6 +6,14 @@
  *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
  *}
 {extends file='projectbase.tpl'}
+
+{block name=css}
+{if $geshicss}
+  <style type="text/css">
+  {$geshicss}
+  </style>
+{/if}
+{/block}
 
 {block name=javascript}
     <script src="js/ext/require.js"></script>

--- a/templates/main.tpl
+++ b/templates/main.tpl
@@ -32,11 +32,8 @@
     <link rel="stylesheet" href="css/{$stylesheet}.css" type="text/css" />
     {/if}
     <link rel="stylesheet" href="css/ext/jquery.qtip.css" type="text/css" />
-    {if $extracss}
-    <style type="text/css">
-    {$extracss}
-    </style>
-    {/if}
+    {block name=css}
+    {/block}
     {if $javascript}
     {block name=javascript}
     <script src="js/ext/require.js"></script>

comments