enhanced the code file and folder views to show revision links

This commit is contained in:
hyung-hwan 2022-02-18 11:51:03 +00:00
parent 6e52705d22
commit 28344edb5e
2 changed files with 20 additions and 2 deletions

View File

@ -989,7 +989,16 @@ $this->load->view (
<div id='code_file_metadata_body' class='codepot-metadata-collapsible-body'>
<div class='codepot-plain-text-view'>
<pre><?php print htmlspecialchars ($file['logmsg']); ?></pre>
<?php
$transformed_message = htmlspecialchars($file['logmsg']);
// handle [[#RXXX]]
$transformed_message = preg_replace (
"/\[\[(#R([[:digit:]]+))\]\]/",
'[[' . anchor ("/code/revision/{$project->id}/!./\${2}", "\${1}", "class='codepot-hashed-revision-number'") . ']]',
$transformed_message
);
?>
<pre id="code_file_metadata_text"><?php print $transformed_message; ?></pre>
</div>
<?php

View File

@ -1272,7 +1272,16 @@ $this->load->view (
<div id='code_folder_metadata_body' class='codepot-metadata-collapsible-body'>
<div class='codepot-plain-text-view'>
<pre><?php print htmlspecialchars ($file['logmsg']); ?></pre>
<?php
$transformed_message = htmlspecialchars($file['logmsg']);
// handle [[#RXXX]]
$transformed_message = preg_replace (
"/\[\[(#R([[:digit:]]+))\]\]/",
'[[' . anchor ("/code/revision/{$project->id}/!./\${2}", "\${1}", "class='codepot-hashed-revision-number'") . ']]',
$transformed_message
);
?>
<pre id="code_folder_metadata_text"><?php print $transformed_message; ?></pre>
</div>
<?php