Skip to content

Commit

Permalink
* ajusted style of 'my/profileedit'.
Browse files Browse the repository at this point in the history
 * fixed style of 'user/login'.
  • Loading branch information
catouse committed Mar 18, 2014
1 parent 1b8230f commit 1c6aaba
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 105 deletions.
9 changes: 6 additions & 3 deletions lib/front/front.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,13 @@ static public function radio($name = '', $options = array(), $checked = '', $att
$string = '';
foreach($options as $key => $value)
{
$string .= "<label class='radio-inline'>\n";
$string .= "<input type='radio' name='$name' value='$key' ";
$string .= ($key == $checked) ? " checked ='checked'" : "";
$string .= $attrib;
$string .= " id='$name$key' /><label for='$name$key'>$value</label>\n";
$string .= " id='$name$key' />\n ";
$string .= $value;
$string .= '</label>';
}
return $string;
}
Expand All @@ -224,10 +227,10 @@ static public function checkbox($name, $options, $checked = "", $attrib = "")
foreach($options as $key => $value)
{
$key = str_replace('item', '', $key);
$string .= "<div class='checkbox'><label><input type='checkbox' name='{$name}[]' value='$key' ";
$string .= "<label class='checkbox-inline'><input type='checkbox' name='{$name}[]' value='$key' ";
$string .= strpos($checked, ",$key,") !== false ? " checked ='checked'" : "";
$string .= $attrib;
$string .= " id='$name$key' /> $value</label></div>\n";
$string .= " id='$name$key' /> $value</label>\n";
}
return $string;
}
Expand Down
4 changes: 4 additions & 0 deletions module/common/view/kindeditor.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
$module = $this->moduleName;
$method = $this->methodName;
js::set('themeRoot', $themeRoot);
if(!isset($config->$module->editor->$method)) return;
$editor = $config->$module->editor->$method;
$editor['id'] = explode(',', $editor['id']);
Expand Down Expand Up @@ -46,8 +47,11 @@ function initKindeditor(afterInit)
var K = KindEditor, $editor = $('#' + editorID);
keEditor = K.create('#' + editorID,
{
cssPath:[v.themeRoot + 'zui/css/min.css'],
width:'100%',
items:editorTool,
filterMode: true,
bodyClass:'article-content',
cssPath:['<?php echo $jsRoot?>kindeditor/plugins/code/prettify.css'],
urlType:'relative',
uploadJson: createLink('file', 'ajaxUpload'),
Expand Down
3 changes: 3 additions & 0 deletions module/my/lang/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@
$lang->my->home->createProject = "create a project?";
$lang->my->home->createProduct = "create a product?";
$lang->my->home->help = "<a href='http://www.zentao.net/help-read-79236.html' target='_blank'>Help Book</a>";

$lang->my->form->lblBasic = 'Basic info';
$lang->my->form->lblContact = 'Contact info';
3 changes: 3 additions & 0 deletions module/my/lang/zh-cn.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@
$lang->my->home->createProject = "创建一个项目?";
$lang->my->home->createProduct = "创建一个产品?";
$lang->my->home->help = "<a href='http://www.zentao.net/help-read-79236.html' target='_blank'>帮助文档</a>";

$lang->my->form->lblBasic = '基本信息';
$lang->my->form->lblContact = '联系信息';
164 changes: 79 additions & 85 deletions module/my/view/editprofile.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,89 +12,83 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<form method='post' target='hiddenwin'>
<table align='center' class='table-4 a-left'>
<caption><?php echo $lang->my->editProfile;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->user->account;?></th>
<td><?php echo $user->account . html::hidden('account',$user->account);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->realname;?></th>
<td><?php echo html::input('realname', $user->realname);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->commiter;?></th>
<td><?php echo html::input('commiter', $user->commiter);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->email;?></th>
<td><?php echo html::input('email', $user->email);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->gender;?></th>
<td><?php echo html::radio('gender', $lang->user->genderList, $user->gender);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->password;?></th>
<td><?php echo html::password('password1');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->password2;?></th>
<td><?php echo html::password('password2');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->birthyear;?></th>
<td><?php echo html::input('birthday', $user->birthday,"class='date'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->join;?></th>
<td><?php //echo html::input('account', $user->account, "readonly");
echo $user->join;
echo html::hidden('join',$user->join);
?>
</td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->skype;?></th>
<td><?php echo html::input('skype', $user->skype);?></td>
</tr>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->qq;?></th>
<td><?php echo html::input('qq', $user->qq);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->yahoo;?></th>
<td><?php echo html::input('yahoo', $user->yahoo);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->gtalk;?></th>
<td><?php echo html::input('gtalk', $user->gtalk);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->wangwang;?></th>
<td><?php echo html::input('wangwang', $user->wangwang);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->mobile;?></th>
<td><?php echo html::input('mobile', $user->mobile);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->phone;?></th>
<td><?php echo html::input('phone', $user->phone);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->address;?></th>
<td><?php echo html::input('address', $user->address);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->zipcode;?></th>
<td><?php echo html::input('zipcode', $user->zipcode);?></td>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::backButton();?></td>
</tr>
</table>
</form>
<div class='container w-800px'>
<div id='featurebar'>
<div class='heading'><i class='icon-pencil'></i> <?php echo $lang->my->editProfile;?></div>
</div>
<form method='post' target='hiddenwin' class='form-condensed'>
<fieldset>
<legend><?php echo $lang->my->form->lblBasic;?></legend>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->user->account;?></th>
<td><?php echo html::input('account', $user->account, "class='form-control' disabled='disabled'");?></td>
<th class='w-100px'><?php echo $lang->user->realname;?></th>
<td><?php echo html::input('realname', $user->realname, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->commiter;?></th>
<td><?php echo html::input('commiter', $user->commiter, "class='form-control'");?></td>
<th><?php echo $lang->user->email;?></th>
<td><?php echo html::input('email', $user->email, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->gender;?></th>
<td><?php echo html::radio('gender', $lang->user->genderList, $user->gender);?></td>
<th><?php echo $lang->user->password;?></th>
<td><?php echo html::password('password1', '', "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->password2;?></th>
<td><?php echo html::password('password2', '', "class='form-control'");?></td>
<th><?php echo $lang->user->birthyear;?></th>
<td><?php echo html::input('birthday', $user->birthday,"class='form-date form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->join;?></th>
<td><?php
echo $user->join;
echo html::hidden('join',$user->join);
?>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->my->form->lblContact;?></legend>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->user->skype;?></th>
<td><?php echo html::input('skype', $user->skype, "class='form-control'");?></td>
<th class='w-100px'><?php echo $lang->user->qq;?></th>
<td><?php echo html::input('qq', $user->qq, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->yahoo;?></th>
<td><?php echo html::input('yahoo', $user->yahoo, "class='form-control'");?></td>
<th><?php echo $lang->user->gtalk;?></th>
<td><?php echo html::input('gtalk', $user->gtalk, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->wangwang;?></th>
<td><?php echo html::input('wangwang', $user->wangwang, "class='form-control'");?></td>
<th><?php echo $lang->user->mobile;?></th>
<td><?php echo html::input('mobile', $user->mobile, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->phone;?></th>
<td><?php echo html::input('phone', $user->phone, "class='form-control'");?></td>
<th><?php echo $lang->user->address;?></th>
<td><?php echo html::input('address', $user->address, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->zipcode;?></th>
<td><?php echo html::input('zipcode', $user->zipcode, "class='form-control'");?></td>
<td></td>
</tr>
</table>
</fieldset>
<?php echo html::submitButton('', '', 'btn-primary') . html::backButton();?>
</form>
</div>
<?php include '../../common/view/footer.html.php';?>
1 change: 1 addition & 0 deletions module/user/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ html,body{background-color: #036}
#login-panel .panel-actions{float: right;position: absolute;right: 15px;top: 18px;padding: 0}
#login-panel .panel-actions .dropdown {display: inline-block; margin-right: 2px}
#mobile {font-size: 28px; padding: 1px 12px; line-height: 28px}
#mobile i {font-size: 28px;}
#login-panel .panel-content{padding-left: 150px;background:url('theme/default/images/main/zt-logo.png') 50px top no-repeat; min-height: 161px}
#login-panel .panel-content table{border: none;width: 300px;margin: 20px auto}
#login-panel .panel-content .button-s{width: 80px}
Expand Down
22 changes: 20 additions & 2 deletions www/js/my.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ function setRequiredFields()
requiredFields = config.requiredFields.split(',');
for(i = 0; i < requiredFields.length; i++)
{
$('#' + requiredFields[i]).after('<span class="star"> * </span>');
$('#' + requiredFields[i]).closest('td,th').prepend("<div class='required required-wrapper'></div>");
var colEle = $('#' + requiredFields[i]).closest('[class*="col-"]');
if(colEle.parent().hasClass('form-group')) colEle.addClass('required');
}
}

Expand Down Expand Up @@ -890,15 +892,31 @@ function setModal()
*/
function setTableBehavior()
{
$('#wrap .table tbody td').click(function(){$(this).closest('tr').toggleClass('active');});
$('#wrap .table:not(.table-data, .table-form) tbody td').click(function(){$(this).closest('tr').toggleClass('active');});
}

/**
* Make form condensed
*
* @access public
* @return void
*/
function condensedForm()
{
$('.form-condensed legend').click(function()
{
$(this).closest('fieldset').toggleClass('collapsed');
});
}


/* Ping the server every some minutes to keep the session. */
needPing = true;

/* When body's ready, execute these. */
$(document).ready(function()
{
condensedForm();
setModal();
setTableBehavior();
setForm();
Expand Down
44 changes: 29 additions & 15 deletions www/theme/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/* Width definitions */
.w-p5 {width: 5%} .w-p10 {width: 10%} .w-p15 {width: 15%} .w-p20 {width: 20%} .w-p25 {width: 25%} .w-p30 {width: 30%} .w-p35 {width: 35%} .w-p40 {width: 40%} .w-p45 {width: 45%} .w-p50 {width: 50%} .w-p55 {width: 55%} .w-p60 {width: 60%} .w-p65 {width: 65%} .w-p70 {width: 70%} .w-p75 {width: 75%} .w-p80 {width: 80%} .w-p85 {width: 85%} .w-p90 {width: 90%} .w-p94 {width: 94%} .w-p95 {width: 95%} .w-p98 {width: 98%} .w-p99 {width: 99%} .w-p100{width: 100%}

.w-20px {width:20px} .w-30px {width:30px} .w-35px {width:35px} .w-40px {width:40px} .w-45px {width:45px} .w-50px {width:50px} .w-60px {width:60px} .w-70px {width:70px} .w-80px {width:80px} .w-90px {width:90px} .w-100px {width:100px} .w-110px {width:110px} .w-120px {width:120px} .w-130px {width:130px} .w-140px {width:140px} .w-150px {width:150px} .w-160px {width:160px} .w-200px {width:200px} .w-400px {width:400px} .w-500px {width:500px} .w-600px {width:600px}
.w-20px {width:20px} .w-30px {width:30px} .w-35px {width:35px} .w-40px {width:40px} .w-45px {width:45px} .w-50px {width:50px} .w-60px {width:60px} .w-70px {width:70px} .w-80px {width:80px} .w-90px {width:90px} .w-100px {width:100px} .w-110px {width:110px} .w-120px {width:120px} .w-130px {width:130px} .w-140px {width:140px} .w-150px {width:150px} .w-160px {width:160px} .w-200px {width:200px} .w-400px {width:400px} .w-500px {width:500px} .w-600px {width:600px} .w-700px {width:700px} .w-800px {width:800px}

.w-id {width:60px;} .w-pri {width:30px;} .w-severity {width:50px;} .w-hour {width:48px;} .w-date {width:80px;} .w-user {width:60px;} .w-status {width:55px} .w-type {width:80px} .w-resolution {width:60px}

Expand Down Expand Up @@ -192,6 +192,30 @@ i[class^="icon-"].disabled,i[class*=" icon-"].disabled,i[class^="icon-"].disable
.table-data th, .table-data td {padding: 5px;}
.table-data th {text-align: right;}

/* Condensed form */
.form-condensed .table-form {margin-bottom: 0;}
.form-condensed .table-form td, .form-condensed .table-form th {padding: 5px; font-size: 12px;}
.form-condensed .table-form td + td, .form-condensed .table-form th + th {padding-left: 5%;}
.form-condensed fieldset {background-color: #eee; padding: 2px 15px 2px 5px; margin-bottom: 10px; margin-top: 35px; border-radius: 6px; position: relative;}
.form-condensed fieldset.fieldset-primary {background-color: transparent; padding: 0; margin-top: 0;}
.form-condensed fieldset .table-form {margin-bottom: 0;}
.form-condensed fieldset.collapsed {padding: 1px;}
.form-condensed fieldset.collapsed .table-form {display: none}
.form-condensed legend {font-size: 12px; font-weight: bold; border:0px solid red; padding: 5px; position: absolute; top: -25px; left: 0; cursor: pointer; line-height: 14px; vertical-align: top; color: #666}
.form-condensed legend:before {font-family: ZenIcon; content: '\e6b8'; font-size: 14px; color: #999; display: inline-block; margin-right: 4px; -webkit-font-smoothing: antialiased;}
.form-condensed legend:hover {color: #333;}
.form-condensed fieldset.collapsed legend:before {content: '\e6bb'}

/* Required field */
form .star {display: none;}/* hide star */
.required:after{font-family: arial;font-size: 24px}
[class*="col-"].required {position: relative;}
[class*="col-"].required:after {position: absolute; top: 6px; right: 2px}
.control-label.required:after{right: -10px}

.required-wrapper{position: relative;width: 100%; height: 0;overflow: visible;}
.required-wrapper.required:after{right: -13px;top: 4px}

/* Panel */
.panel > .table > thead > tr > th,.panel > form > .table > thead > tr > th {background-color: transparent;}
.panel > .panel-heading,.nav-stacked.nav-primary>li.nav-heading,.list > header, #navbar {background-color: #f1f1f1;}
Expand All @@ -211,20 +235,6 @@ i[class^="icon-"].disabled,i[class*=" icon-"].disabled,i[class^="icon-"].disable
.panel .table-bordered tr > td:first-child,.panel .table-bordered tr > th:first-child {border-left: 0;}
.panel .table-bordered tr > td:last-child,.panel .table-bordered tr > th:last-child {border-right: 0;}

/* Condensed form */
.form-condensed .table-form {margin-bottom: 0;}
.form-condensed .table-form td, .form-condensed .table-form th {padding: 5px; font-size: 12px;}
.form-condensed .table-form td + td, .form-condensed .table-form th + th {padding-left: 5%;}
.form-condensed fieldset {background-color: #eee; padding: 2px 15px 2px 5px; margin-bottom: 10px; margin-top: 35px; border-radius: 6px; position: relative;}
.form-condensed fieldset.fieldset-primary {background-color: transparent; padding: 0; margin-top: 0;}
.form-condensed fieldset .table-form {margin-bottom: 0;}
.form-condensed fieldset.collapsed {padding: 1px;}
.form-condensed fieldset.collapsed .table-form {display: none}
.form-condensed legend {font-size: 12px; font-weight: bold; border:0px solid red; padding: 5px; position: absolute; top: -25px; left: 0; cursor: pointer; line-height: 14px; vertical-align: top; color: #666}
.form-condensed legend:before {font-family: ZenIcon; content: '\f0d7'; font-size: 14px; color: #999; display: inline-block; margin-right: 4px; margin-bottom: -3px; -webkit-font-smoothing: antialiased;}
.form-condensed legend:hover {color: #333;}
.form-condensed fieldset.collapsed legend:before {content: '\f0da'}

/* === Layout === */
/* Background */
body {font-size: 12px; color:#141414;padding-bottom: 40px;}
Expand Down Expand Up @@ -335,9 +345,13 @@ body {font-size: 12px; color:#141414;padding-bottom: 40px;}
.table-actions {float: left;}
.table-actions > .btn-group, .table-actions > .btn, .table-actions > .input-group {float: left; margin-right: 10px}
.outer .table tfoot .pager {margin: 0;}

/* Container in outer */
.outer .container {padding: 20px;}
.outer .container .table-form, .outer .container .table-data {margin-top: 10px;}

/* Form in outer */
form > .btn {margin-right: 10px;}

/* Pager. */
.pager {margin-bottom:0;line-height: 30px; color: #999}
Expand Down

0 comments on commit 1c6aaba

Please sign in to comment.