修改了评审页面的样式,表单样式、列表样式、增加了通用容器tbox。增加了ajax保存草稿的动作

This commit is contained in:
Li Jianxuan 2011-10-28 10:00:13 +00:00
parent 18ac03c6d6
commit ae5c70c4a6
2 changed files with 90 additions and 31 deletions

View File

@ -130,7 +130,9 @@ class ReviewController extends Zend_Controller_Action
$sql=$this->db->quoteInto("select m.id,m.uuid,m.title,m.description,m.title_en,r.status from metadata m
left join mdstatus r on r.uuid=m.uuid
where m.uuid=?",$uuid);
$this->view->metadata = $md = $this->db->fetchRow($sql);
$md = $this->db->fetchRow($sql);
$this->view->metadata = $md;
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
@ -311,11 +313,25 @@ class ReviewController extends Zend_Controller_Action
';
}
if(empty($list))
{
$list="<p style='text-align:center'>暂无评审数据</p>";
}
$stringbuffer = "<ul class='reviewlist'>$list</ul>";
echo $stringbuffer.'<div class="paginator">'.$paginator.'</div>';
}//allreviewAction()
}//allreviewAction() 所有评论 ajax
function saveAction(){
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
echo "保存成功!";
}// saveAction 存草稿 ajax
function searchAction()
{

View File

@ -5,6 +5,7 @@
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->headScript()->appendFile('/js/pubfunc.js');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">'.$this->config->title->review.'</a>');
$this->breadcrumb('评审元数据');
@ -29,7 +30,16 @@
<hr />
<div id="comments">
<h2>数据评审意见</h2>
<div class="tbox center slideabletbox" style="margin-top:10px;">
<div class="title"><img src="/images/listtitle.png" />所有评审意见<a href="javascript:void(0)" class="slidebtn"><img src="/images/slideup.png" /></a></div>
<div class="content">
<div id="allcomments"></div>
</div>
</div>
<div class="tbox center slideabletbox" style="margin-top:10px;">
<div class="title" id="commentsFormTitle"><img src="/images/formtitle.png" />发布评审意见<a href="javascript:void(0)" class="slidebtn"><img src="/images/slideup.png" /></a></div>
<div class="content" id="form">
<?php
if($auth->hasIdentity())
{
@ -40,8 +50,6 @@
echo "该数据已经通过评审";
}else{
?>
<a href="javascript:void(0)" onclick="$('.form').slideToggle(1000)">我要发布评审意见</a>
<div class="form" style="display:none;">
<form id="postcomment" action="/review/review/uuid/<?php echo $md['uuid'];?>" method="POST" enctype='multipart/form-data'>
<input type="hidden" name="submit" value="1" />
<p>
@ -53,28 +61,29 @@
</p>
<p>
元数据意见(必填)<br/>
<textarea id="mdcomment" class="medium half" name="mdcomment"><?php echo $this->keyword.$this->mdcomment;?></textarea>
<textarea id="mdcomment" class="medium full" name="mdcomment"><?php echo $this->keyword.$this->mdcomment;?></textarea>
</p>
<p>
对数据的意见:<br/>
<textarea id="datacomment" class="small half" name="datacomment"><?php echo $this->datacomment;?></textarea>
<textarea id="datacomment" class="small full" name="datacomment"><?php echo $this->datacomment;?></textarea>
</p>
<p>
给数据中心的意见:<br/>
<textarea id="editorcomment" class="small half" name="editorcomment"><?php echo $this->editorcomment;?></textarea>
<textarea id="editorcomment" class="small full" name="editorcomment"><?php echo $this->editorcomment;?></textarea>
</p>
<p>
评审附件:<br/>
<input type="file" name="Filedata" class="half" /><br />
<a href="javascript:void(0);" onclick="$('#showexts').toggle()">查看可上传的附件类型</a>
<div id='showexts' style="display:none;">'doc', 'docx', 'xls', 'xlsx', 'ppt', 'htm', 'html', 'txt', 'zip', 'rar', 'gz', 'bz2','gif', 'jpg', 'jpeg', 'png', 'bmp'</div>
<div id='showexts' style="display:none;">'doc', 'docx', 'xls', 'xlsx', 'ppt', 'htm', 'html', 'txt', 'zip', 'rar', 'gz', 'bz2','gif', 'jpg', 'jpeg', 'png', 'bmp', 'pdf'</div>
</p>
<p>
<input id="submit" type="submit" value="提交" class="btn" onclick="return confirm('是否确定提交评审意见?')" />
<button class="btn btn-green" type="submit" onclick="return confirm('是否确定提交评审意见?')">提交</button>
<button class="btn btn-small" type="button" id="save">存草稿</button>
<button class="btn btn-small" type="reset" id="reset" onclick="return confirm('是否确定重置已经填写的意见?')">重置</button>
</p>
</form>
</div>
<?php
<?php
}
}else
{
@ -85,6 +94,9 @@
}
?>
</div>
</div>
@ -99,7 +111,8 @@
</div>
<?php endif; ?>
<div id="allcomments"></div>
</div>
@ -109,6 +122,36 @@
loadmdcomment(1);
function loadmdcomment(page){var url="/review/allreview/uuid/<?php echo $md['uuid'];?>/";if(page!=''){url+='page/'+page;}
$.ajax({type:"POST",url:url,data:'',success:function(html){$('#allcomments').html(html);},beforeSend:function(){$('#allcomments').html('<img src="/images/loading.gif" />正在加载...');}});}
$('.slideabletbox .title').click(
function(){
$(this).next(".content").slideToggle(1000,function(){
if($(this).css('display')=='none')
$(this).prev('.title').find(".slidebtn").html('<img src="/images/slidedown.png" />');
else
$(this).prev('.title').find(".slidebtn").html('<img src="/images/slideup.png" />');
;})
});
$('#save').click(function(){
savereview();
});
function savereview(){
var url="/review/save/uuid/<?php echo $md['uuid'];?>/";
var date = $('#postcomment').serialize();
$.ajax({
type:"POST",
url:url,
data:date,
success:function(html){
$('#save').html(html);
setTimeout("$('#save').html('存草稿');$('#save').removeAttr('disabled');",2000)
},
beforeSend:function(){
$('#save').attr('disabled','disabled');
$('#save').html('<img src="/images/11887177066.gif" />正在保存...');
}
});
}
</script>
<?php else: ?>