'; + print htmlspecialchars($readme_text); + print ''; + print '
diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index aa978552..e5fe3f40 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -108,6 +108,17 @@ class Code extends Controller $data['next_revision'] = $this->subversion->getNextRev ($projectid, $path, $rev); + $data['readme_text'] = ''; + $data['readme_file'] = ''; + foreach (array('README.wiki', 'README.txt', 'README') as $rf) + { + $readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev); + if ($readme !== FALSE) + { + $data['readme_text'] = $readme['content']; + $data['readme_file'] = $rf; + } + } $this->load->view ($this->VIEW_FOLDER, $data); } } @@ -563,6 +574,17 @@ class Code extends Controller $data['next_revision'] = $this->subversion->getNextRev ($projectid, $path, $rev); + $data['readme_text'] = ''; + $data['readme_file'] = ''; + foreach (array('README.wiki', 'README.txt', 'README') as $rf) + { + $readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev); + if ($readme !== FALSE) + { + $data['readme_text'] = $readme['content']; + $data['readme_file'] = $rf; + } + } $this->load->view ($this->VIEW_FOLDER, $data); } } @@ -623,6 +645,18 @@ class Code extends Controller $this->subversion->getPrevRev ($project->id, $path, $rev); $data['next_revision'] = $this->subversion->getNextRev ($project->id, $path, $rev); + + $data['readme_text'] = ''; + $data['readme_file'] = ''; + foreach (array('README.wiki', 'README.txt', 'README') as $rf) + { + $readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev); + if ($readme !== FALSE) + { + $data['readme_text'] = $readme['content']; + $data['readme_file'] = $rf; + } + } $this->load->view ($this->VIEW_FOLDER, $data); } } diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index be0da14e..9262d6ef 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -8,6 +8,15 @@ + + + + + + + + + @@ -183,6 +192,23 @@ $(function () { //$("#code_folder_mainarea_result_info_loc_progress" ).progressbar().hide(); }); + +function renderReadme() +{ + 0 && substr_compare($readme_file, '.wiki', -5) === 0): + ?> + creole_render_wiki ( + "code_folder_mainarea_result_readme_text", + "code_folder_mainarea_result_readme", + "=site_url()?>/wiki/show/=$project->id?>/", + "=site_url()?>/wiki/attachment0/=$project->id?>/" + ); + prettyPrint(); + + +}
'; + print htmlspecialchars($readme_text); + print ''; + print '