From 6f5815bd9b8a6d4919e544df6c29da7a08630a74 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 8 Jan 2016 17:51:39 +0000 Subject: [PATCH] updated the code file view to use the title-band class partially --- codepot/src/codepot/views/code_edit.php | 63 +++---- codepot/src/codepot/views/code_file.php | 235 ++++++++++++------------ 2 files changed, 151 insertions(+), 147 deletions(-) diff --git a/codepot/src/codepot/views/code_edit.php b/codepot/src/codepot/views/code_edit.php index 980c35c3..267adb12 100644 --- a/codepot/src/codepot/views/code_edit.php +++ b/codepot/src/codepot/views/code_edit.php @@ -37,17 +37,17 @@ var base_return_anchor = codepot_merge_path('', 'load->view (
-
-id}{$revreqroot}", - htmlspecialchars($project->name)); - - $exps = explode ('/', $headpath); - $expsize = count($exps); - $par = ''; - for ($i = 1; $i < $expsize; $i++) - { - $par .= '/' . $exps[$i]; - $xpar = $this->converter->AsciiToHex ($par); - - print '/'; +
+
+ id}/{$xpar}{$revreq}", - htmlspecialchars($exps[$i])); - } + "code/${caller}/{$project->id}{$revreqroot}", + htmlspecialchars($project->name)); - if ($headpath != $file['fullpath']) - { - print ' - '; - print htmlspecialchars($file['fullpath']); - } -?> -
+ $exps = explode ('/', $headpath); + $expsize = count($exps); + $par = ''; + for ($i = 1; $i < $expsize; $i++) + { + $par .= '/' . $exps[$i]; + $xpar = $this->converter->AsciiToHex ($par); -
+ print '/'; + print anchor ( + "code/${caller}/{$project->id}/{$xpar}{$revreq}", + htmlspecialchars($exps[$i])); + } + if ($headpath != $file['fullpath']) + { + print ' - '; + print htmlspecialchars($file['fullpath']); + } + ?> +
+ +
'; @@ -304,7 +304,8 @@ $this->load->view ( print ' '; print anchor ("code/${caller}/{$project->id}/{$hex_headpath}{$revreq}", $this->lang->line('Return'), 'id="code_edit_mainarea_return_button"'); ?> - +
+
diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index 5db2ef38..90c42239 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -34,23 +34,23 @@ $(function () { print '$("#code_file_mainarea_result_info").hide();'; ?> - if ($("#code_file_mainarea_result_info").is(":visible")) - btn_label = "lang->line('Hide metadata')?>"; - else - btn_label = "lang->line('Show metadata')?>"; + //if ($("#code_file_mainarea_result_info").is(":visible")) + // btn_label = "lang->line('Hide metadata')?>"; + //else + // btn_label = "lang->line('Show metadata')?>"; - btn = $("#code_file_mainarea_metadata_button").button({"label": btn_label}).click (function () { + btn = $("#code_file_mainarea_metadata_button").button().click (function () { if ($("#code_file_mainarea_result_info").is(":visible")) { $("#code_file_mainarea_result_info").hide("blind",{},200); - $("#code_file_mainarea_metadata_button").button( - "option", "label", "lang->line('Show metadata')?>"); + //$("#code_file_mainarea_metadata_button").button( + // "option", "label", "lang->line('Show metadata')?>"); } else { $("#code_file_mainarea_result_info").show("blind",{},200); - $("#code_file_mainarea_metadata_button").button( - "option", "label", "lang->line('Hide metadata')?>"); + //$("#code_file_mainarea_metadata_button").button( + // "option", "label", "lang->line('Hide metadata')?>"); } return false; // prevent the default behavior @@ -124,44 +124,86 @@ $this->load->view (
-
-converter->AsciiToHex ('.') . $revreq; - } +
+
+ converter->AsciiToHex ('.') . $revreq; + } - print anchor ( - "code/file/{$project->id}{$revreqroot}", - htmlspecialchars($project->name)); - - $exps = explode ('/', $headpath); - $expsize = count($exps); - $par = ''; - for ($i = 1; $i < $expsize; $i++) - { - $par .= '/' . $exps[$i]; - $xpar = $this->converter->AsciiToHex ($par); - - print '/'; print anchor ( - "code/file/{$project->id}/{$xpar}{$revreq}", - htmlspecialchars($exps[$i])); - } + "code/file/{$project->id}{$revreqroot}", + htmlspecialchars($project->name)); - if ($headpath != $file['fullpath']) - { - print ' - '; - print htmlspecialchars($file['fullpath']); - } -?> -
+ $exps = explode ('/', $headpath); + $expsize = count($exps); + $par = ''; + for ($i = 1; $i < $expsize; $i++) + { + $par .= '/' . $exps[$i]; + $xpar = $this->converter->AsciiToHex ($par); + + print '/'; + print anchor ( + "code/file/{$project->id}/{$xpar}{$revreq}", + htmlspecialchars($exps[$i])); + } + + if ($headpath != $file['fullpath']) + { + print ' - '; + print htmlspecialchars($file['fullpath']); + } + ?> +
+ +
+ id}/${xpar}/{$file['prev_rev']}", ''); + print ' '; + + // anchor to the revision history at the root directory + print anchor ( + //"code/revision/{$project->id}/!/{$file['created_rev']}", + "code/revision/{$project->id}/${xpar}/{$file['created_rev']}", + sprintf("%s %s", $this->lang->line('Revision'), $file['created_rev']) + ); + + if (!empty($file['created_tag'])) + { + print ' '; + print (''); + print htmlspecialchars($file['created_tag']); + print (''); + } + + print ' '; + print anchor ("code/file/{$project->id}/${xpar}/{$file['next_rev']}", ''); + + print ' | '; + printf ('%s: %s', $this->lang->line('Size'), $file['size']); + + + if ((isset($login['id']) && $login['id'] != '')) + { + print ' '; + print anchor ("code/edit/{$project->id}/{$xpar}{$revreq}", $this->lang->line('Edit'), 'id="code_file_mainarea_edit_button"'); + } + ?> + + lang->line('Metadata')?> + +
+ +
+
-
- - id}/${xpar}/{$file['prev_rev']}", ''); - print ' '; - - // anchor to the revision history at the root directory - print anchor ( - //"code/revision/{$project->id}/!/{$file['created_rev']}", - "code/revision/{$project->id}/${xpar}/{$file['created_rev']}", - sprintf("%s %s", $this->lang->line('Revision'), $file['created_rev']) - ); - - if (!empty($file['created_tag'])) - { - print ' '; - print (''); - print htmlspecialchars($file['created_tag']); - print (''); - } - - print ' '; - print anchor ("code/file/{$project->id}/${xpar}/{$file['next_rev']}", ''); - - print ' | '; - printf ('%s: %s', $this->lang->line('Size'), $file['size']); - - - if ((isset($login['id']) && $login['id'] != '')) - { - print ' '; - print anchor ("code/edit/{$project->id}/{$xpar}{$revreq}", $this->lang->line('Edit'), 'id="code_file_mainarea_edit_button"'); - } - ?> - - lang->line('Metadata')?> - -
@@ -335,47 +339,46 @@ if ($login['settings'] != NULL &&
 
-
lang->line('CODE_COMMIT') ?>
-
    -
  • lang->line('CODE_MSG_COMMITTED_BY_ON'), $file['last_author'], $file['time']); ?>
  • -
+
lang->line('CODE_COMMIT') ?>
+
    +
  • lang->line('CODE_MSG_COMMITTED_BY_ON'), $file['last_author'], $file['time']); ?>
  • +
-
lang->line('Message') ?>
-
-
-
+
lang->line('Message') ?>
+
+	
+	
- 0) -{ - print '
'; - print $this->lang->line('CODE_PROPERTIES'); - print '
'; - - print '
    '; - foreach ($file['properties'] as $pn => $pv) + 0) { - print '
  • '; - print htmlspecialchars($pn); - if ($pv != '') + print '
    '; + print $this->lang->line('CODE_PROPERTIES'); + print '
    '; + + print '
      '; + foreach ($file['properties'] as $pn => $pv) { - print ' - '; - print htmlspecialchars($pv); + print '
    • '; + print htmlspecialchars($pn); + if ($pv != '') + { + print ' - '; + print htmlspecialchars($pv); + } + print '
    • '; } - print ''; + print '
    '; } - print '
'; -} -?> - - -
LOC
-id}/{$xpar}{$revreq}"); - print ""; -?> + ?> + +
LOC
+ id}/{$xpar}{$revreq}"); + print ""; + ?>