renewed the code revision view

This commit is contained in:
hyung-hwan 2016-01-09 04:35:03 +00:00
parent 67dd3a3262
commit 5cc9a37098
4 changed files with 74 additions and 64 deletions

View File

@ -383,8 +383,6 @@ if ($login['settings'] != NULL &&
</pre> </pre>
</div> <!-- code_file_mainarea_result -->
<div id="code_file_mainarea_loc_info" class="infobox"> <div id="code_file_mainarea_loc_info" class="infobox">
<div class="title">LOC</div> <div class="title">LOC</div>
<?php <?php
@ -394,6 +392,8 @@ if ($login['settings'] != NULL &&
?> ?>
</div> <!-- code_file_mainarea_loc_info --> </div> <!-- code_file_mainarea_loc_info -->
</div> <!-- code_file_mainarea_result -->
</div> <!-- code_file_mainarea --> </div> <!-- code_file_mainarea -->
<div class='footer-pusher'></div> <!-- for sticky footer --> <div class='footer-pusher'></div> <!-- for sticky footer -->

View File

@ -892,10 +892,10 @@ $this->load->view (
<div class="result" id="code_folder_mainarea_result"> <div class="result" id="code_folder_mainarea_result">
<div id="code_folder_mainarea_result_loc_by_lang_graph"></div> <div id="code_folder_mainarea_result_loc_by_lang_graph"></div>
<div id="code_folder_mainarea_result_loc_by_file_graph"></div> <div id="code_folder_mainarea_result_loc_by_file_graph"></div>
<?php <?php
function comp_files ($a, $b) function comp_files ($a, $b)
{ {
if ($a['type'] == $b['type']) if ($a['type'] == $b['type'])
@ -1116,7 +1116,7 @@ $this->load->view (
print '</div>'; print '</div>';
} }
?> ?>
</div> <!-- code_folder_mainarea_result --> </div> <!-- code_folder_mainarea_result -->

View File

@ -22,18 +22,25 @@
<link type="text/css" rel="stylesheet" href="<?php print base_url_make('/css/jquery-ui.css')?>" /> <link type="text/css" rel="stylesheet" href="<?php print base_url_make('/css/jquery-ui.css')?>" />
<?php <?php
$hex_headpath = $this->converter->AsciiToHex(($headpath == '')? '.': $headpath);
if ($revision <= 0) if ($revision <= 0)
{ {
$revreq = ''; $revreq = '';
$revreqroot = ''; $revreqroot = '';
$history_path = "/code/history/{$project->id}/{$hex_headpath}";
} }
else else
{ {
$revreq = "/{$file['created_rev']}"; $revreq = "/{$file['created_rev']}";
$revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq; $revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq;
if ($hex_headpath == '') $revtrailer = $revreqroot;
else $revtrailer = "/{$hex_headpath}{$revreq}";
$history_path = "/code/history/{$project->id}{$revtrailer}";
} }
$hex_headpath = $this->converter->AsciiToHex(($headpath == '')? '.': $headpath);
$creole_base = site_url() . "/wiki/show/{$project->id}/"; $creole_base = site_url() . "/wiki/show/{$project->id}/";
$creole_file_base = site_url() . "/wiki/attachment0/{$project->id}/"; $creole_file_base = site_url() . "/wiki/attachment0/{$project->id}/";
?> ?>
@ -86,8 +93,15 @@ var work_in_progress = false;
<?php $is_loggedin = ($login['id'] != ''); ?> <?php $is_loggedin = ($login['id'] != ''); ?>
<?php $can_edit = ($is_loggedin && $login['id'] == $file['history']['author']); ?> <?php $can_edit = ($is_loggedin && $login['id'] == $file['history']['author']); ?>
<?php if ($can_edit): ?>
$(function() { $(function() {
$("#code_revision_history_button").button().click (function() {
$(location).attr ('href', codepot_merge_path("<?php print site_url(); ?>", '<?php print $history_path; ?>'));
return false;
});
<?php if ($can_edit): ?>
$('#code_revision_edit_revision_tag_form').dialog ( $('#code_revision_edit_revision_tag_form').dialog (
{ {
title: '<?php print $this->lang->line('Tag');?>', title: '<?php print $this->lang->line('Tag');?>',
@ -255,12 +269,9 @@ $(function() {
return false; return false;
} }
); );
});
<?php endif; ?> <?php endif; ?>
<?php if ($is_loggedin): ?> <?php if ($is_loggedin): ?>
$(function() {
$('#code_revision_new_review_comment_tabs').tabs (); $('#code_revision_new_review_comment_tabs').tabs ();
$('#code_revision_new_review_comment_tabs').bind ('tabsshow', function (event, ui) { $('#code_revision_new_review_comment_tabs').bind ('tabsshow', function (event, ui) {
if (ui.index == 1) preview_new_review_comment ($('#code_revision_new_review_comment').val()); if (ui.index == 1) preview_new_review_comment ($('#code_revision_new_review_comment').val());
@ -459,8 +470,9 @@ $(function() {
} }
} }
?> ?>
});
<?php endif; ?> <?php endif; ?>
});
function render_wiki() function render_wiki()
{ {
@ -490,7 +502,7 @@ function hide_unneeded_divs()
} }
$(function() { $(function() {
$("#code_revision_mainarea_result_msg_container").accordion ({ $("#code_revision_mainarea_result_message").accordion ({
collapsible: true collapsible: true
}); });
@ -617,12 +629,6 @@ $history = $file['history'];
print anchor ("#", $this->lang->line('Tag'), array ('id' => 'code_revision_edit_revision_tag_button')); print anchor ("#", $this->lang->line('Tag'), array ('id' => 'code_revision_edit_revision_tag_button'));
print '</span>'; print '</span>';
} }
print ' | ';
printf ('%s: %s', $this->lang->line('Committer'), htmlspecialchars($history['author']));
print ' | ';
printf ('%s: %s', $this->lang->line('Last updated on'), date('r', strtotime($history['date'])));
?> ?>
</div> </div>
@ -631,45 +637,46 @@ $history = $file['history'];
<div class="menu" id="code_revision_mainarea_menu"> <div class="menu" id="code_revision_mainarea_menu">
<?php <?php
$history_anchor_text = '<i class="fa fa-history"></i> ' . $this->lang->line('History');
if ($revision > 0 && $revision < $next_revision)
{
print anchor ("code/revision/{$project->id}/{$hex_headpath}", $this->lang->line('Head revision'));
print ' | ';
}
if ($revision > 0)
{
if ($hex_headpath == '') $revtrailer = $revreqroot;
else $revtrailer = "/{$hex_headpath}{$revreq}";
print anchor ("code/history/{$project->id}{$revtrailer}", $history_anchor_text);
}
else
{
print anchor ("code/history/{$project->id}/{$hex_headpath}", $history_anchor_text);
}
?> ?>
</div> <!-- code_revision_mainarea_menu --> </div> <!-- code_revision_mainarea_menu -->
<div class="result" id="code_revision_mainarea_result"> <div class="result" id="code_revision_mainarea_result">
<div id="code_revision_mainarea_result_msg_container" class="collapsible-box"> <div id="code_revision_mainarea_result_message" class="collapsible-box">
<div class="collapsible-box-header" ><?php print $this->lang->line('Message')?>&nbsp; <div id="code_revision_mainarea_result_message_header" class="collapsible-box-header" >
<?php if ($can_edit): ?> <?php
<span class='anchor'> print '<div class="metadata-committer">';
<?php print anchor ("#", $this->lang->line('Edit'), $user_icon_url = codepot_merge_path (site_url(), '/user/icon/' . $this->converter->AsciiToHex($history['author']));
array ('id' => 'code_revision_edit_revision_message_button')); print "<img src='{$user_icon_url}' class='metadata-committer-icon' />";
?> print htmlspecialchars ($history['author']);
</span> print '</div>';
<?php endif; ?>
</div>
<div id="code_revision_mainarea_result_msg" class="collapsible-box-panel"> print '<div class="metadata-menu">';
<pre id="code_revision_mainarea_result_msg_text" class="pre-wrapped"> if ($can_edit)
<?php print htmlspecialchars($history['msg']); ?> {
</pre> print '<span class="anchor">';
</div> print anchor ("#", $this->lang->line('Edit'),
array ('id' => 'code_revision_edit_revision_message_button'));
print '</span>';
}
$history_anchor_text = '<i class="fa fa-history"></i> ' . $this->lang->line('History');
print anchor ("#", $history_anchor_text, 'id="code_revision_history_button"');
print '</div>';
print '<div class="metadata-commit-date">';
printf ('[%s] ', $history['rev']);
print strftime ('%Y-%m-%d %H:%M:%S %z', strtotime($history['date']));
print '</div>';
?>
<div style='clear: both'></div>
</div>
<div id="code_revision_mainarea_result_message_body">
<pre id="code_revision_mainarea_result_message_text" class="pre-wrapped"><?php print htmlspecialchars($history['msg']); ?></pre>
</div>
</div> </div>
<div id="code_revision_mainarea_result_files" class="collapsible-box"> <div id="code_revision_mainarea_result_files" class="collapsible-box">

View File

@ -78,12 +78,14 @@
} }
#code_file_mainarea_metadata_header, #code_file_mainarea_metadata_header,
#code_blame_mainarea_metadata_header { #code_blame_mainarea_metadata_header,
#code_revision_mainarea_result_message_header {
line-height: 2em; line-height: 2em;
} }
#code_file_mainarea_metadata_header .metadata-committer-icon, #code_file_mainarea_metadata_header .metadata-committer-icon,
#code_blame_mainarea_metadata_header .metadata-committer-icon { #code_blame_mainarea_metadata_header .metadata-committer-icon,
#code_revision_mainarea_result_message_header .metadata-committer-icon {
height: 2em; height: 2em;
width: auto; width: auto;
vertical-align: middle; vertical-align: middle;
@ -95,24 +97,28 @@
} }
#code_file_mainarea_metadata_header .metadata-committer, #code_file_mainarea_metadata_header .metadata-committer,
#code_blame_mainarea_metadata_header .metadata-committer { #code_blame_mainarea_metadata_header .metadata-committer,
#code_revision_mainarea_result_message_header .metadata-committer {
float: left; float: left;
color: #111111; color: #111111;
} }
#code_file_mainarea_metadata_header .metadata-menu, #code_file_mainarea_metadata_header .metadata-menu,
#code_blame_mainarea_metadata_header .metadata-menu { #code_blame_mainarea_metadata_header .metadata-menu,
#code_revision_mainarea_result_message_header .metadata-menu {
float: left; float: left;
margin-left: 1em; margin-left: 1em;
} }
#code_file_mainarea_metadata_header .metadata-commit-date, #code_file_mainarea_metadata_header .metadata-commit-date,
#code_blame_mainarea_metadata_header .metadata-commit-date { #code_blame_mainarea_metadata_header .metadata-commit-date,
#code_revision_mainarea_result_message_header .metadata-commit-date {
float: right; float: right;
} }
#code_file_mainarea_metadata_body, #code_file_mainarea_metadata_body,
#code_blame_mainarea_metadata_body { #code_blame_mainarea_metadata_body,
#code_revision_mainarea_result_message_body {
background-color: #FCFCFC; background-color: #FCFCFC;
padding: 0 0.5em 0 0.5em; padding: 0 0.5em 0 0.5em;
margin: 0; margin: 0;
@ -240,13 +246,10 @@
} }
#code_revision_mainarea_result .collapsible-box{ #code_revision_mainarea_result .collapsible-box{
margin-top: 0.5em; margin-bottom: 0.5em;
} }
#code_revision_mainarea_result_msg { #code_revision_mainarea_result_message_text {
}
#code_revision_mainarea_result_msg_text {
line-height: 1.3em; line-height: 1.3em;
padding: 0 0.2em 0 0.2em; padding: 0 0.2em 0 0.2em;
} }