<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!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">
<title><s:text name="edit_book.title"></s:text></title>
<link rel="stylesheet" type="text/css" href="../css/edit_book.css">
<link rel="stylesheet" type="text/css" href="../css/header.css">
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/ajaxfileupload.js"></script>
<script type="text/javascript" src="../js/edit_book.js"></script>
<s:set name="current_local" value="#request.locale.language"></s:set>
<s:if test="#current_local == 'zh'">
<script type="text/javascript" src="../js/bs_zh_CN.js"></script>
</s:if>
<s:elseif test="#current_local == 'en'">
<script type="text/javascript" src="../js/bs_en_US.js"></script>
</s:elseif>
</head>
<body>
<div id="header"><s:action name="user!showHeader" executeResult="true" namespace="/user"/></div>
<div id="word">
<div style="width: 38%">
<a href="../book/book!index" style="text-decoration: none"><s:text name="global.home"></s:text></a> >
<a href="../book/book!bookShareAction?pageIndex=1" style="text-decoration: none"><s:text name="global.bookShare"></s:text></a> >
<a href="../user/user!myBook?currentPage=1" style="text-decoration: none"><s:text name="global.myShelf"></s:text></a> >
<s:text name="edit_book.page.title"></s:text>
</div>
<div class="strong" ><s:text name="book_shelf.basicInfo"></s:text></div>
<form action="book!editBook" method="post" name="edit" id="edit" enctype="multipart/form-data">
<input type="hidden" id="id" name="book.id" value="<s:property value='#request.id' />"/>
<input type="hidden" id="status" name="book.status" value="<s:property value='#request.status' />"/>
<table>
<tr>
<td>
<s:text name="book_shelf.book.name"></s:text>
</td>
<td>
<input type="text" id="name" name="book.name" size="45%" onblur="return checkName();" value="<s:property value='#request.book.name' />"/>
</td>
<td>
<s:if test="#request.msg!=null">
<font color="red"><s:property value="#request.msg" /></font>
</s:if>
<font id="noBookName" color="red" style="display: none"><s:text name="book_shelf.noBookName"></s:text></font>
</td>
</tr>
<tr>
<td valign="top">
<s:text name="book_shelf.book.cover"></s:text>
</td>
<td>
<table>
<tr>
<td style="position: relative" width="98" height="119">
<img width="98" height="119" id="defaultPic" name="defaultPic" src="../bookImg/default/book_default.png" style="position: absolute; left: 0px; top: 0px; z-index:-1"></img>
<s:if test="#request.book.coverUrl=='../bookImg/default/book_default.png'">
<input type="checkbox" id="defaultUrl" name="defaultUrl" style="position: absolute; left: 70px; top: 10px; z-index:0" checked="checked" />
</s:if>
<s:else>
<input type="checkbox" id="defaultUrl" name="defaultUrl" style="position: absolute; left: 70px; top: 10px; z-index:0" />
</s:else>
</td>
<td style="position: relative" width="98" height="119">
<img width="98" height="119" id="uploadPic" name="uploadPic" src="<s:property value='#request.book.coverUrl' />" style="position: absolute; left: 0px; top: 0px; z-index:-1">
<s:if test="#request.book.coverUrl=='../bookImg/default/book_default.png'">
<input type="checkbox" id="selectedUrl" name="selectedUrl" style="position: absolute; left: 70px; top: 10px; z-index:0"/>
</s:if>
<s:else>
<input type="checkbox" id="selectedUrl" name="selectedUrl" style="position: absolute; left: 70px; top: 10px; z-index:0" checked="checked"/>
</s:else>
</td>
<td valign="bottom">
<center><img src="../img/book_shelf/loading.gif" id="loading" style="display: none;"></center>
<br>
<input type="button" value="<s:text name='book_shelf.book.sure'></s:text>" onclick="return sure();" class="button"/>
<br>
<input type="file" id="coverUrl" name="coverUrl" style="display:none;" onChange="return choosePic(this.value);">
<input id="bookCoverUrl" name="book.coverUrl" type="hidden" value="<s:property value='#request.book.coverUrl' />">
<input type="button" id="upload" name="upload" value="<s:text name='book_shelf.book.upload'></s:text>" class="button" onclick="clickUpload()"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<s:text name="book_shelf.book.translationName"></s:text>
</td>
<td>
<input type="text" name="book.translationName" size="45%" value="<s:property value='#request.book.translationName' />"/>
</td>
</tr>
<tr>
<td>
<s:text name="book_shelf.book.author"></s:text>
</td>
<td>
<input type="text" name="book.author" size="45%" value="<s:property value='#request.book.author' />"/>
</td>
</tr>
<tr>
<td>
<s:text name="book_shelf.book.version"></s:text>
</td>
<td>
<s:select list="{'第一版', '第二版', '第三版', '第四版', '第五版'}" theme="simple" name="book.version">
</s:select>
</td>
</tr>
<tr>
<td>
<s:text name="book_shelf.book.press"></s:text>
</td>
<td>
<input type="text" name="book.press" size="45%" value="<s:property value='#request.book.press' />"/>
</td>
</tr>
<tr>
<td>
<s:text name="book_shelf.book.ISBN"></s:text>
</td>
<td>
<input type="text" name="book.isbn" size="45%" value="<s:property value='#request.book.isbn' />"/>
</td>
</tr>
<tr>
<td>
<s:text name="book_shelf.book.category"></s:text>
</td>
<td>
<s:select list="#request.categorys" listValue="name" listKey="name" theme="simple" name="book.category.name">
</s:select>
</td>
</tr>
<tr>
<td valign="top">
<s:text name="book_shelf.book.summary"></s:text>
</td>
<td>
<textarea rows="5" name="book.summary"><s:property value="#request.book.summary" /></textarea>
</td>
</tr>
<tr>
<td valign="top">
<s:text name="book_shelf.book.personalReview"></s:text>
</td>
<td>
<textarea rows="5" name="book.personalReview"><s:property value="#request.book.personalReview" /></textarea>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="button" size="20%" value="<s:text name='edit_book.edit'></s:text>" onclick="return check();"/>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>