* fixed a bug in getFile() of the subversion model class

* enhanced the code folder view
This commit is contained in:
hyung-hwan 2010-05-17 13:11:42 +00:00
parent f9208d86a5
commit 42bf53b773
10 changed files with 181 additions and 69 deletions

View File

@ -3,5 +3,6 @@ $lang['CODE_COMMIT'] = 'Commit';
$lang['CODE_PROPERTIES'] = 'Properties';
$lang['CODE_PROPERTY'] = 'Property';
$lang['CODE_MSG_COMMITTED_BY'] = 'Committed by %s';
$lang['CODE_MSG_COMMITTED_BY_ON'] = 'Committed by %s on %s';
?>

View File

@ -3,5 +3,6 @@ $lang['CODE_COMMIT'] = '커밋';
$lang['CODE_PROPERTIES'] = '속성';
$lang['CODE_PROPERTY'] = '속성';
$lang['CODE_MSG_COMMITTED_BY_ON'] = '%s가 %s에 커밋함';
$lang['CODE_MSG_COMMITTED_BY'] = '%s이(가) 커밋함';
$lang['CODE_MSG_COMMITTED_BY_ON'] = '%s이(가) %s에 커밋함';
?>

View File

@ -87,7 +87,7 @@ class SubversionModel extends Model
$fileinfo['type'] = 'dir';
$fileinfo['size'] = 0;
$fileinfo['created_rev'] = $info[0]['revision'];
$fileinfo['last_author'] = $info[0]['last_changed_rev'];
$fileinfo['last_author'] = $info[0]['last_changed_author'];
$fileinfo['content'] = $list;
$fileinfo['logmsg'] = (count($log) > 0)? $log[0]['msg']: '';
return $fileinfo;

View File

@ -187,7 +187,7 @@ if ($fileext == '') $fileext = "html"
<div class="title"><?= $this->lang->line('Message') ?></div>
<pre id="code_file_mainarea_result_info_logmsg">
<?= $file['logmsg'] ?>
<?= htmlspecialchars ($file['logmsg']) ?>
</pre>
<?php

View File

@ -4,6 +4,42 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/common.css" />
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/code.css" />
<script type="text/javascript" src="<?=base_url()?>/js/jquery.min.js"></script>
<script type="text/javascript" src="<?=base_url()?>/js/jquery-ui.min.js"></script>
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/jquery-ui.css" />
<?php
$file_count = count($file['content']);
?>
<script type="text/javascript">
<?php if ($file_count > 0): ?>
$(function () {
if ($("#code_folder_mainarea_result_info").is(":visible"))
btn_label = "<?=$this->lang->line('Hide details')?>";
else
btn_label = "<?=$this->lang->line('Show details')?>";
btn = $("#code_folder_mainarea_details_button").button({"label": btn_label}).click (function () {
if ($("#code_folder_mainarea_result_info").is(":visible"))
{
$("#code_folder_mainarea_result_info").hide("blind",{},200);
$("#code_folder_mainarea_details_button").button(
"option", "label", "<?=$this->lang->line('Show details')?>");
}
else
{
$("#code_folder_mainarea_result_info").show("blind",{},200);
$("#code_folder_mainarea_details_button").button(
"option", "label", "<?=$this->lang->line('Hide details')?>");
}
});
});
<?php endif; ?>
</script>
<title><?=htmlspecialchars($project->name)?></title>
</head>
@ -36,41 +72,6 @@ $this->load->view (
<!---------------------------------------------------------------------------->
<div class="sidebar" id="code_folder_sidebar">
<div class="box" id="code_folder_sidebar_info">
<div class="boxtitle"><?=$this->lang->line('Revision')?>: <?=$file['created_rev']?></div>
<pre><?=$file['logmsg']?></pre>
<?php
if (array_key_exists('properties', $file) &&
count($file['properties']))
{
print '<div class="boxtitle">';
print $this->lang->line('CODE_PROPERTIES');
print '</div>';
print '<ul>';
foreach ($file['properties'] as $pk => $pv)
{
print '<li>';
print htmlspecialchars ($pk);
if ($pv != '')
{
print ' - ';
print htmlspecialchars ($pv);
}
print '</li>';
}
print '</ul>';
}
?>
</div>
</div> <!-- code_folder_sidebar -->
<!---------------------------------------------------------------------------->
<div class="mainarea" id="code_folder_mainarea">
<div class="title">
@ -114,19 +115,29 @@ $this->load->view (
?>
</div>
<div class="infostrip" id="code_folder_mainarea_infostrip">
<?=$this->lang->line('Revision')?>: <?=$file['created_rev']?>
<?php if ($file_count > 0): ?>
|
<a id="code_folder_mainarea_details_button" href='#'><?=$this->lang->line('Details')?></a>
<?php endif; ?>
</div>
<div id="code_folder_mainarea_result">
<?php
function comp_files ($a, $b)
{
if ($a['type'] == $b['type'])
{
return ($a['name'] > $b['name'])? -1:
($a['name'] < $b['name'])? 1: 0;
return strcasecmp ($a['name'], $b['name']);
}
return ($a['type'] == 'dir')? -1: 1;
}
if (count($file['content']) <= 0)
if ($file_count <= 0)
{
print $this->lang->line('MSG_NO_CODE_AVAIL');
}
@ -144,7 +155,6 @@ $this->load->view (
usort ($file['content'], 'comp_files');
print '<div id="code_folder_mainarea_result">';
print '<table id="code_folder_mainarea_result_table">';
print '<tr class="heading">';
print '<th>' . $this->lang->line('Name') . '</th>';
@ -226,10 +236,49 @@ $this->load->view (
}
}
print '</table>';
print '<div id="code_folder_mainarea_result_info">';
print '<pre id="code_folder_mainarea_result_info_logmsg">';
print '<div class="title">';
print $this->lang->line('CODE_COMMIT');
print '</div>';
printf ($this->lang->line('CODE_MSG_COMMITTED_BY'), $file['last_author']);
print '<div class="title">';
print $this->lang->line('Message');
print '</div>';
print '<pre id="code_folder_mainarea_result_info_logmsg">';
print htmlspecialchars ($file['logmsg']);
print '</pre>';
if (array_key_exists('properties', $file) && count($file['properties']) > 0)
{
print '<div class="title">';
print $this->lang->line('CODE_PROPERTIES');
print '</div>';
print '<ul id="code_folder_mainarea_result_info_property_list">';
foreach ($file['properties'] as $pn => $pv)
{
print '<li>';
print htmlspecialchars($pn);
if ($pv != '')
{
print ' - ';
print htmlspecialchars($pv);
}
print '</li>';
}
print '</ul>';
}
print '</div>';
}
?>
</div> <!-- code_folder_mainarea_result -->
</div> <!-- code_folder_mainarea -->

View File

@ -132,13 +132,11 @@ $history = $file['history'];
print anchor ("code/file/{$project->id}/{$xpar}/{$history['rev']}", htmlspecialchars($p['path']));
print '</td>';
/*
print '<td>';
print anchor ("code/blame/{$project->id}/{$xpar}/{$history['rev']}", $this->lang->line('Blame'));
print ' ';
//print anchor ("code/blame/{$project->id}/{$xpar}/{$history['rev']}", $this->lang->line('Blame'));
//print ' ';
print anchor ("code/diff/{$project->id}/{$xpar}/{$history['rev']}", $this->lang->line('Difference'));
print '</td>';
*/
print '</tr>';
}

View File

@ -1,9 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/common.css" />
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/project.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/common.css">
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/project.css">
<script type="text/javascript" src="<?=base_url()?>/js/creole.js"></script>
<script type="text/javascript">
@ -26,11 +28,11 @@ function render_wiki()
<div class="content" id="project_home_content">
<!---------------------------------------------------------------------------->
<!-- /////////////////////////////////////////////////////////////////////// -->
<?php $this->load->view ('taskbar'); ?>
<!---------------------------------------------------------------------------->
<!-- /////////////////////////////////////////////////////////////////////// -->
<?php
$this->load->view (
@ -52,7 +54,7 @@ $this->load->view (
);
?>
<!---------------------------------------------------------------------------->
<!-- /////////////////////////////////////////////////////////////////////// -->
<div class="sidebar" id="project_home_sidebar">
<div class="box">
@ -201,7 +203,7 @@ $this->load->view (
</div> <!-- project_home_sidebar -->
<!---------------------------------------------------------------------------->
<!-- /////////////////////////////////////////////////////////////////////// -->
<div class="mainarea" id="project_home_mainarea">
@ -218,11 +220,11 @@ $this->load->view (
</div> <!-- project_home_mainarea -->
<!---------------------------------------------------------------------------->
<!-- /////////////////////////////////////////////////////////////////////// -->
<?php $this->load->view ('footer'); ?>
<!---------------------------------------------------------------------------->
<!-- /////////////////////////////////////////////////////////////////////// -->
</div> <!-- project_home_content -->

View File

@ -1,9 +1,10 @@
<html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/common.css" />
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/site.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/common.css">
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/site.css">
<script type="text/javascript" src="<?=base_url()?>/js/creole.js"></script>
<script type="text/javascript">
function render_wiki()
@ -28,11 +29,11 @@ function render_wiki()
<div class="content" id="site_home_content">
<!---------------------------------------------------------------------------->
<!-- ////////////////////////////////////////////////////////////////////// -->
<?php $this->load->view ('taskbar'); ?>
<!---------------------------------------------------------------------------->
<!-- ////////////////////////////////////////////////////////////////////// -->
<?php
@ -52,7 +53,7 @@ $this->load->view (
);
?>
<!---------------------------------------------------------------------------->
<!-- ////////////////////////////////////////////////////////////////////// -->
<div class="mainarea" id="site_home_mainarea">
@ -211,7 +212,7 @@ foreach ($latest_projects as $project)
</pre>
</div> <!-- site_home_mainarea_text -->
<!----------------------------------------------------------->
<!-- ////////////////////////////////////////////////////////////////////// -->
</div> <!-- site_home_mainarea -->

View File

@ -23,16 +23,42 @@ function show_taskbar ($con, $login)
$user_pass = "";
//$hex = $con->converter->AsciiToHex (current_url());
print form_hidden ('user_url', set_value ('user_url', current_url()));
print form_hidden (
'user_url',
set_value ('user_url', current_url())
);
//print anchor ("main/signin/{$hex}", $con->lang->line('Sign in'));
print form_label($con->lang->line('Username').' ', 'user_name');
print form_input ('user_name', set_value ('user_name', $user_name), 'size=12');
print form_label(
$con->lang->line('Username'),
'taskbar_user_name'
);
print '&nbsp;';
print form_label($con->lang->line('Password').' ', 'user_pass');
print form_password ('user_pass', set_value ('user_pass', $user_pass), 'size=12');
print form_input (
'user_name',
set_value ('user_name', $user_name),
'size=12 id="taskbar_user_name"'
);
print '&nbsp;';
print form_submit ('login', $con->lang->line('Sign in'), 'class="button"');
print form_label (
$con->lang->line('Password'),
'taskbar_user_pass'
);
print '&nbsp;';
print form_password (
'user_pass',
set_value ('user_pass', $user_pass),
'size=12 id="taskbar_user_pass"'
);
print '&nbsp;';
print form_submit (
'login',
$con->lang->line('Sign in'),
'class="button"'
);
print form_close();
}

View File

@ -7,6 +7,7 @@
#code_folder_mainarea_result {
overflow: auto;
position: relative;
}
#code_folder_mainarea_result_table tr {
@ -14,6 +15,39 @@
white-space: nowrap;
}
#code_folder_mainarea_result_info {
position: absolute;
top: 5;
right: 5;
width: 22em;
background: #E5ECF9 none repeat scroll 0 0;
border: #D4DBE8 1px solid;
overflow: auto;
padding: 0.2em 0.4em 0.2em 0.4em;
font-size: 0.9em;
}
#code_folder_mainarea_result_info pre {
overflow: auto;
border: 0;
margin: 0;
padding: 0;
background-color: inherit;
white-space: -moz-pre-wrap;
white-space: -o-pre-wrap;
white-space: pre-wrap;
}
#code_folder_mainarea_result_info .title {
background-color: #8888FF;
color: #FFFFFF;
border: #D4DBE8 1px solid;
margin: 0.3em 0 0.3em 0;
padding: 0.1em 0.1em 0.1em 0.1em;
font-size: inherit;
text-transform: uppercase;
}
/*-----------------------------------------------
* project source file view
*-----------------------------------------------*/