Also fix displayed commit for renamed files
Also fix displayed commit for renamed files

--- a/config/projects.conf.php.example
+++ b/config/projects.conf.php.example
@@ -93,6 +93,8 @@
  *	     Compatibility mode relies more on the git executable for loading
  *	     data, at the expense of performance.  Use if you are having
  *	     trouble loading data for this project.
+ *
+ * 'website': the website url for the project.
  */
 //$git_projects_settings['php/gitphp.git'] = array(
 //	'category' => 'PHP',
@@ -102,7 +104,8 @@
 //	'pushurl' => '',
 //	'bugpattern' => '/#([0-9]+)/',
 //	'bugurl' => 'http://mantis.xiphux.com/view.php?id=${1}',
-//	'compat' => false
+//	'compat' => false,
+//	'website' => 'http://xiphux.com/programming/gitphp/'
 //);
 //$git_projects_settings['gentoo.git'] = array(
 //	'description' => 'Gentoo portage overlay',

--- a/css/gitphpskin.css
+++ b/css/gitphpskin.css
@@ -117,6 +117,16 @@
 	float: left; 
 	color: #555555;
 	font-style: italic; 
+}
+
+div.page_footer_text a {
+	color: #555555;
+	font-style: italic;
+	text-decoration: none;
+}
+
+div.page_footer_text a:hover {
+	text-decoration: underline;
 }
 
 

--- a/include/git/Project.class.php
+++ b/include/git/Project.class.php
@@ -219,6 +219,15 @@
 /*}}}2*/
 
 	/**
+	 * website
+	 *
+	 * Stores the website url internally
+	 *
+	 * @access protected
+	 */
+	protected $website = null;
+
+	/**
 	 * commitCache
 	 *
 	 * Caches fetched commit objects in case of
@@ -724,6 +733,36 @@
 	public function SetBugPattern($bPat)
 	{
 		$this->bugPattern = $bPat;
+	}
+
+/*}}}2*/
+
+/* website accessors {{{2*/
+
+	/**
+	 * GetWebsite
+	 *
+	 * Gets the website for this repository, if specified
+	 *
+	 * @access public
+	 * @return string website
+	 */
+	public function GetWebsite()
+	{
+		return $this->website;
+	}
+
+	/**
+	 * SetWebsite
+	 *
+	 * Sets the website for this repository
+	 *
+	 * @access public
+	 * @param string $site website
+	 */
+	public function SetWebsite($site)
+	{
+		$this->website = $site;
 	}
 
 /*}}}2*/

--- a/include/git/ProjectListBase.class.php
+++ b/include/git/ProjectListBase.class.php
@@ -298,6 +298,9 @@
 		if (isset($projData['compat'])) {
 			$projectObj->SetCompat($projData['compat']);
 		}
+		if (isset($projData['website']) && is_string($projData['website'])) {
+			$projectObj->SetWebsite($projData['website']);
+		}
 	}
 
 	/**

--- a/include/git/ProjectListDirectory.class.php
+++ b/include/git/ProjectListDirectory.class.php
@@ -91,7 +91,7 @@
 	 */
 	private function RecurseDir($dir)
 	{
-		if (!is_dir($dir))
+		if (!(is_dir($dir) && is_readable($dir)))
 			return;
 
 		GitPHP_Log::GetInstance()->Log(sprintf('Searching directory %1$s', $dir));

--- a/locale/gitphp.pot
+++ b/locale/gitphp.pot
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: GitPHP 0.2.4\n"
 "Report-Msgid-Bugs-To: xiphux@gmail.com\n"
-"POT-Creation-Date: 2011-07-22 23:42-0500\n"
+"POT-Creation-Date: 2011-08-25 20:54-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -19,8 +19,10 @@
 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
 
 # Used as link to and title for page displaying a blob, which is what git calls a single file
+#: templates/tag.tpl
 #: templates/blobdiff.tpl
 #: templates/commit.tpl
+#: templates/taglist.tpl
 #: templates/treelist.tpl
 #: templates/searchfiles.tpl
 #: templates/history.tpl
@@ -59,7 +61,7 @@
 #: templates/treelist.tpl
 #: templates/projectlist.tpl
 #: templates/shortloglist.tpl
-#: include/controller/Controller_Snapshot.class.php:85
+#: include/controller/Controller_Snapshot.class.php:92
 msgid "snapshot"
 msgstr ""
 
@@ -428,7 +430,7 @@
 #: include/controller/Controller_Commit.class.php:34
 #: include/controller/Controller_Log.class.php:34
 #: include/controller/Controller_Blame.class.php:34
-#: include/controller/Controller_Snapshot.class.php:43
+#: include/controller/Controller_Snapshot.class.php:49
 #: include/controller/Controller_Blob.class.php:34
 #: include/controller/Controller_Tag.class.php:34
 #: include/controller/Controller_Tags.class.php:34
@@ -454,6 +456,7 @@
 
 # Error message when user tries to access a project that doesn't exist
 # %1$s: the project the user tried to access
+#: include/controller/Controller_Snapshot.class.php:44
 #: include/controller/ControllerBase.class.php:93
 #, php-format
 msgid "Invalid project %1$s"
@@ -519,28 +522,28 @@
 # Error message when user specifies a path for a project root or project, but the path given isn't a directory
 # %1$s: the path the user specified
 #: include/git/ProjectListDirectory.class.php:47
-#: include/git/Project.class.php:250
+#: include/git/Project.class.php:326
 #, php-format
 msgid "%1$s is not a directory"
 msgstr ""
 
 # Error message when a path specified in the config is not a git repository
 # %1$s: the specified path
-#: include/git/Project.class.php:254
+#: include/git/Project.class.php:330
 #, php-format
 msgid "%1$s is not a git repository"
 msgstr ""
 
 # Error message when a path specified is using '..' to break out of the project root (a hack attempt)
 # %1$s: The specified path
-#: include/git/Project.class.php:258
+#: include/git/Project.class.php:334
 #, php-format
 msgid "%1$s is attempting directory traversal"
 msgstr ""
 
 # Error message when a path specified is outside of the project root
 # %1$s: The specified path
-#: include/git/Project.class.php:264
+#: include/git/Project.class.php:340
 #, php-format
 msgid "%1$s is outside of the projectroot"
 msgstr ""
@@ -573,6 +576,7 @@
 
 # Error message when user tries to specify a file with a list of the projects, but it isn't a file
 # %1$s: the path the user specified
+#: include/git/ProjectListScmManager.class.php:37
 #: include/git/ProjectListFile.class.php:38
 #, php-format
 msgid "%1$s is not a file"
@@ -662,7 +666,7 @@
 
 # Error message when user hasn't defined a project root in the config
 # "projectroot" refers to a root directory where the user's git projects are stored
-#: index.php:123
+#: index.php:125
 msgid "A projectroot must be set in the config"
 msgstr ""
 
@@ -763,7 +767,7 @@
 # Error message displayed when the git executable isn't found or doesn't work
 # %1$s: the git executable the system is trying to run
 # %2$s: the config value the user needs to set to specify the correct path
-#: index.php:131
+#: index.php:133
 #, php-format
 msgid ""
 "Could not run the git executable \"%1$s\".  You may need to set the \"%2$s\" "
@@ -773,7 +777,7 @@
 # Error message displayed when the diff executable isn't found or doesn't work
 # %1$s: the diff executable the system is trying to run
 # %2$s: the config value the user needs to set to specify the correct path
-#: index.php:136
+#: index.php:138
 #, php-format
 msgid ""
 "Could not run the diff executable \"%1$s\".  You may need to set the \"%2$s"
@@ -795,3 +799,8 @@
 msgid "Binary files %1$s and %2$s differ"
 msgstr ""
 
+# Used to label the url of the website of the project
+#: templates/project.tpl
+msgid "website"
+msgstr ""
+

--- a/templates/commit.tpl
+++ b/templates/commit.tpl
@@ -125,7 +125,7 @@
        {elseif $diffline->GetStatus() == "M" || $diffline->GetStatus() == "T"}
          <td>
            {if $diffline->GetToHash() != $diffline->GetFromHash()}
-             <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blobdiff&amp;h={$diffline->GetToHash()}&amp;hp={$diffline->GetFromHash()}&amp;hb={$par->GetHash()}&amp;f={$diffline->GetToFile()}" class="list">
+             <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blobdiff&amp;h={$diffline->GetToHash()}&amp;hp={$diffline->GetFromHash()}&amp;hb={$commit->GetHash()}&amp;f={$diffline->GetToFile()}" class="list">
 	       {$diffline->GetToFile()}
 	     </a>
            {else}
@@ -178,7 +178,7 @@
          <td class="link">
            <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob&amp;h={$diffline->GetToHash()}&amp;hb={$commit->GetHash()}&amp;f={$diffline->GetToFile()}">{t}blob{/t}</a>
 	   {if $diffline->GetToHash() != $diffline->GetFromHash()}
-	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blobdiff&amp;h={$diffline->GetToHash()}&amp;hp={$diffline->GetFromHash()}&amp;hb={$par->GetHash()}&amp;f={$diffline->GetToFile()}">{t}diff{/t}</a>
+	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blobdiff&amp;h={$diffline->GetToHash()}&amp;hp={$diffline->GetFromHash()}&amp;hb={$commit->GetHash()}&amp;f={$diffline->GetToFile()}">{t}diff{/t}</a>
 	   {/if}
 	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=history&amp;h={$commit->GetHash()}&amp;f={$diffline->GetFromFile()}">{t}history{/t}</a>
              | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob_plain&amp;h={$diffline->GetToHash()}&amp;f={$diffline->GetToFile()}">{t}plain{/t}</a>
@@ -207,7 +207,7 @@
          <td class="link">
 	   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob&amp;h={$diffline->GetToHash()}&amp;hb={$commit->GetHash()}&amp;f={$diffline->GetToFile()}">{t}blob{/t}</a>
 	   {if $diffline->GetToHash() != $diffline->GetFromHash()}
-	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blobdiff&amp;h={$diffline->GetToHash()}&amp;hp={$diffline->GetFromHash()}&amp;hb={$par->GetHash()}&amp;f={$diffline->GetToFile()}">{t}diff{/t}</a>
+	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blobdiff&amp;h={$diffline->GetToHash()}&amp;hp={$diffline->GetFromHash()}&amp;hb={$commit->GetHash()}&amp;f={$diffline->GetToFile()}">{t}diff{/t}</a>
 	   {/if}
 	    | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob_plain&amp;h={$diffline->GetToHash()}&amp;f={$diffline->GetToFile()}">{t}plain{/t}</a>
 	 </td>

--- a/templates/footer.tpl
+++ b/templates/footer.tpl
@@ -7,7 +7,13 @@
  *}
     <div class="page_footer">
       {if $project}
-        <div class="page_footer_text">{$project->GetDescription()}</div>
+        <div class="page_footer_text">
+	{if $project->GetWebsite()}
+	<a href="{$project->GetWebsite()}">{$project->GetDescription()}</a>
+	{else}
+	{$project->GetDescription()}
+	{/if}
+	</div>
         <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=rss" class="rss_logo">{t}RSS{/t}</a>
         <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=atom" class="rss_logo">{t}Atom{/t}</a>
       {else}

--- a/templates/project.tpl
+++ b/templates/project.tpl
@@ -26,6 +26,9 @@
    {/if}
    {if $project->GetPushUrl()}
      <tr><td>{t}push url{/t}</td><td><a href="{$project->GetPushUrl()}">{$project->GetPushUrl()}</a></td></tr>
+   {/if}
+   {if $project->GetWebsite()}
+     <tr><td>{t}website{/t}</td><td><a href="{$project->GetWebsite()}">{$project->GetWebsite()}</a></td></tr>
    {/if}
  </table>
 

--- a/templates/tag.tpl
+++ b/templates/tag.tpl
@@ -16,7 +16,11 @@
  {assign var=object value=$tag->GetObject()}
  {assign var=objtype value=$tag->GetType()}
  <div class="title">
+   {if $objtype == 'blob'}
+   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob&amp;h={$object->GetHash()}" class="title">{$tag->GetName()}</a>
+   {else}
    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=commit&amp;h={$object->GetHash()}" class="title">{$tag->GetName()}</a>
+   {/if}
  </div>
  <div class="title_text">
    <table cellspacing="0">

comments