wisemapping-open-source/wise-webapp/src/main/webapp/jsp/mindmapList.jsp

478 lines
20 KiB
Plaintext
Raw Normal View History

<!DOCTYPE HTML>
<%@ include file="/jsp/init.jsp" %>
<html>
<head>
<base href="${pageContext.request.contextPath}/"/>
2012-04-06 22:05:42 +02:00
<title><spring:message code="SITE.TITLE"/></title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
2012-04-06 22:05:42 +02:00
<link rel="stylesheet/less" type="text/css" href="css/mymaps.less"/>
<script type="text/javascript" language="javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" language="javascript" src="bootstrap/js/bootstrap.js"></script>
2012-05-20 17:28:10 +02:00
<script src="js/less.js" type="text/javascript"></script>
2012-04-06 22:05:42 +02:00
<!--jQuery DataTables-->
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.min.js"></script>
2012-05-20 07:25:54 +02:00
<script type="text/javascript" language="javascript" src="js/mymaps.js"></script>
<!-- Update timer plugging -->
<script type="text/javascript" language="javascript" src="js/jquery.timeago.js"></script>
2012-04-06 22:05:42 +02:00
<script type="text/javascript" charset="utf-8">
2012-05-21 02:46:55 +02:00
var principalEmail = '${principal.email}';
2012-04-06 22:05:42 +02:00
$(function() {
var jQueryDataTable = $('#mindmapListTable').dataTable({
bProcessing : true,
sAjaxSource : "../service/maps",
sAjaxDataProp: 'mindmapsInfo',
fnInitComplete: function() {
2012-05-21 02:46:55 +02:00
$('#mindmapListTable tbody').change(updateStatus);
},
2012-04-06 22:05:42 +02:00
aoColumns: [
{
sTitle : '<input type="checkbox" id="selectAll"/>',
sWidth : "15px",
2012-05-21 02:46:55 +02:00
sClass : "select",
2012-04-06 22:05:42 +02:00
bSortable : false,
bSearchable : false,
fnRender : function(obj) {
return '<input type="checkbox" id="' + obj.aData.id + '"/>';
}
},
{
sTitle : "Name",
bUseRendered : false,
2012-04-08 01:05:50 +02:00
mDataProp: "title",
fnRender : function(obj) {
2012-05-27 23:15:46 +02:00
return '<a href="c/maps/' + obj.aData.id + '/edit.htm">' + obj.aData.title + '</a>';
2012-04-08 01:05:50 +02:00
}
2012-04-06 22:05:42 +02:00
},
{
sTitle : "Owner",
2012-05-21 02:46:55 +02:00
mDataProp :"owner"
2012-04-06 22:05:42 +02:00
},
{
bSearchable : false,
sTitle : "Last Modified",
bUseRendered: false,
sType: "date",
mDataProp: "lastModificationTime",
2012-04-06 22:05:42 +02:00
fnRender : function(obj) {
var time = obj.aData.lastModificationTime;
return '<abbr class="timeago" title="' + time + '">' + jQuery.timeago(time) + '</abbr>' + ' ' + '<span style="color: #777;font-size: 75%;padding-left: 5px;">' + obj.aData.lastModifierUser + '</span>';
2012-04-06 22:05:42 +02:00
}
}
],
2012-05-20 17:28:10 +02:00
bAutoWidth : false,
2012-05-19 07:32:09 +02:00
oLanguage : {
2012-05-20 17:28:10 +02:00
"sSearch" : "",
2012-05-23 06:13:00 +02:00
"sInfo" : "_START_-_END_ of _TOTAL_",
2012-05-24 02:54:03 +02:00
"sEmptyTable": "No mindmap available for the selected filter criteria."
2012-04-06 22:05:42 +02:00
},
bStateSave:true
});
2012-05-20 17:28:10 +02:00
// Customize search action ...
$('#mindmapListTable_filter').appendTo("#tableActions");
$('#mindmapListTable_filter input').addClass('input-medium search-query');
$('#mindmapListTable_filter input').attr('placeholder', 'Search');
$("#mindmapListTable_info").appendTo("#pageInfo");
// Re-arrange pagination actions ...
$("#tableFooter").appendTo("#mindmapListTable_wrapper");
$("#mindmapListTable_length").appendTo("#tableFooter");
$('#mindmapListTable_length select').addClass('span1');
2012-04-06 22:05:42 +02:00
$('input:checkbox[id="selectAll"]').click(function() {
$("#mindmapListTable").dataTableExt.selectAllMaps();
});
2012-05-20 17:28:10 +02:00
// Hack for changing the lagination buttons ...
$('#nPageBtn').click(function() {
$('#mindmapListTable_next').click();
2012-04-06 22:05:42 +02:00
});
2012-05-21 02:46:55 +02:00
$('#pPageBtn').click(function() {
2012-05-20 17:28:10 +02:00
$('#mindmapListTable_previous').click();
});
2012-04-06 22:05:42 +02:00
});
</script>
2012-04-06 22:05:42 +02:00
<!--Buttons-->
<script type="text/javascript" charset="utf-8">
$(function() {
// Creation buttons actions ...
$("#newBtn").click(
function() {
2012-04-08 01:05:50 +02:00
$("#new-dialog-modal").dialogForm({
2012-05-27 23:15:46 +02:00
redirect: "c/maps/{header.resourceId}/edit.htm",
2012-04-08 01:05:50 +02:00
url : "../service/maps"
});
});
2012-04-06 22:05:42 +02:00
2012-05-19 04:43:22 +02:00
$("#importBtn").click(function() {
2012-05-27 23:15:46 +02:00
window.open('c/maps/import.htm');
});
$("#duplicateBtn").click(function() {
// Map to be cloned ...
var tableElem = $('#mindmapListTable');
var rows = tableElem.dataTableExt.getSelectedRows();
if (rows.length > 0) {
2012-04-08 01:05:50 +02:00
// Obtain map name ...
var rowData = tableElem.dataTable().fnGetData(rows[0]);
2012-05-19 04:43:22 +02:00
$('#dupDialogTitle').text("Duplicate '" + rowData.title + "'");
2012-04-08 01:05:50 +02:00
// Obtains map id ...
var mapId = rowData.id;
2012-04-08 01:05:50 +02:00
// Initialize dialog ...
$("#duplicate-dialog-modal").dialogForm({
2012-05-27 23:15:46 +02:00
redirect: "c/maps/{header.resourceId}/edit.htm",
url : "../service/maps/" + mapId
2012-04-08 01:05:50 +02:00
});
}
});
2012-04-08 01:05:50 +02:00
2012-05-19 04:43:22 +02:00
$("#renameBtn").click(function() {
2012-05-19 05:13:06 +02:00
// Map to be cloned ...
var tableElem = $('#mindmapListTable');
var rows = tableElem.dataTableExt.getSelectedRows();
if (rows.length > 0) {
// Obtain map name ...
var dataTable = tableElem.dataTable();
var rowData = dataTable.fnGetData(rows[0]);
2012-04-08 01:05:50 +02:00
2012-05-19 05:13:06 +02:00
// Fill dialog with default values ...
var mapId = rowData.id;
$("#rename-dialog-modal input[name='title']").attr('value', rowData.title);
$("#rename-dialog-modal input[name='description']").attr('value', rowData.description);
// Set title ...
$('#renameDialogTitle').text("Rename '" + rowData.title + "'");
// Initialize dialog ...
$("#rename-dialog-modal").dialogForm({
type: 'PUT',
2012-05-24 01:05:16 +02:00
clearForm: false,
2012-05-19 05:13:06 +02:00
postUpdate: function(reqBodyData) {
2012-05-24 01:05:16 +02:00
tableElem.dataTableExt.removeSelectedRows();
2012-05-19 05:13:06 +02:00
rowData.title = reqBodyData.title;
rowData.description = reqBodyData.description;
2012-05-24 01:05:16 +02:00
dataTable.fnAddData(JSON.parse(JSON.stringify(rowData)));
2012-05-19 05:13:06 +02:00
},
2012-05-24 01:05:16 +02:00
url : "../service/maps/" + mapId
2012-05-19 05:13:06 +02:00
});
}
});
2012-04-06 22:05:42 +02:00
2012-05-19 04:43:22 +02:00
$("#deleteBtn").click(function() {
2012-05-20 02:36:34 +02:00
var tableUI = $('#mindmapListTable');
var mapIds = tableUI.dataTableExt.getSelectedMapsIds();
2012-05-19 04:43:22 +02:00
if (mapIds.length > 0) {
2012-05-20 02:36:34 +02:00
// Initialize dialog ...
$("#delete-dialog-modal").dialogForm({
type: 'DELETE',
postUpdate: function(reqBodyData) {
// Remove old entry ...
tableUI.dataTableExt.removeSelectedRows();
},
2012-05-20 07:25:54 +02:00
url : "../service/maps/batch?ids=" + mapIds.join(',')
});
2012-05-19 04:43:22 +02:00
}
});
2012-04-08 01:05:50 +02:00
2012-05-19 05:13:06 +02:00
$("#printBtn").click(function() {
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
if (mapIds.length > 0) {
2012-05-27 23:15:46 +02:00
window.open('c/maps/' + mapIds[0] + '/print.htm');
2012-05-19 05:13:06 +02:00
}
});
2012-04-15 13:00:51 +02:00
2012-05-20 07:25:54 +02:00
$("#infoBtn").click(function() {
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
if (mapIds.length > 0) {
2012-05-27 23:15:46 +02:00
$('#info-dialog-modal .modal-body').load("c/maps/" + mapIds[0] + "/details.htm", function() {
2012-05-20 07:25:54 +02:00
$('#info-dialog-modal').modal();
});
}
});
2012-05-21 02:46:55 +02:00
$("#publishBtn").click(function() {
2012-05-20 07:25:54 +02:00
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
if (mapIds.length > 0) {
2012-05-27 23:15:46 +02:00
$('#publish-dialog-modal .modal-body').load("c/maps/" + mapIds[0] + "/publish.htm",
2012-05-21 02:46:55 +02:00
function() {
$('#publish-dialog-modal .btn-accept').click(function() {
$('#publish-dialog-modal #publishForm').submit();
});
$('#publish-dialog-modal').modal();
});
2012-05-20 07:25:54 +02:00
}
});
2012-04-15 13:00:51 +02:00
2012-05-19 05:13:06 +02:00
$("#actionButtons .shareMap").click(function() {
});
$("#actionButtons .tagMap").click(function() {
});
$("#actionButtons .tags").click(function() {
});
2012-04-15 13:00:51 +02:00
2012-05-24 02:54:03 +02:00
$('#foldersContainer li').click(function(event) {
// Deselect previous option ...
$('#foldersContainer li').removeClass('active');
$('#foldersContainer i').removeClass('icon-white');
// Select the new item ...
var dataTable = $('#mindmapListTable').dataTable();
2012-05-24 04:48:55 +02:00
$(this).addClass('active');
$('#foldersContainer .active i').addClass('icon-white');
2012-05-24 02:54:03 +02:00
// Reload the table data ...
dataTable.fnReloadAjax("../service/maps?q=" + $(this).attr('data-filter'));
event.preventDefault();
});
2012-04-08 01:05:50 +02:00
});
// Register time update functions ....
setTimeout(function() {
jQuery("abbr.timeago").timeago()
}, 50000);
</script>
2012-04-06 22:05:42 +02:00
</head>
<body>
2012-05-24 01:05:16 +02:00
<jsp:include page="header.jsp">
<jsp:param name="removeSignin" value="false"/>
<jsp:param name="showLogout" value="true"/>
</jsp:include>
2012-04-06 22:05:42 +02:00
2012-05-24 02:54:03 +02:00
<div style="min-height: 500px">
2012-05-24 01:05:16 +02:00
<div id="messagesPanel" class="alert alert-error alert-block fade in hide" style="margin-top: 10px">
<strong><spring:message code="UNEXPECTED_ERROR"/></strong>
2012-04-06 22:05:42 +02:00
2012-05-24 01:05:16 +02:00
<p><spring:message code="UNEXPECTED_ERROR_SERVER_ERROR"/></p>
2012-04-06 22:05:42 +02:00
2012-05-24 01:05:16 +02:00
<div></div>
</div>
2012-05-24 02:54:03 +02:00
<div id="mindmapListContainer">
2012-05-24 02:54:03 +02:00
<div id="foldersContainer">
2012-05-24 02:54:03 +02:00
<ul class="nav nav-list">
2012-05-24 05:58:42 +02:00
<li class="nav-header">Filters</li>
2012-05-24 04:48:55 +02:00
<li data-filter="all" class="active"><a href="#"><i class="icon-inbox icon-white"></i> All</a></li>
<li data-filter="my_maps"><a href="#"><i class="icon-user"></i> My Maps</a></li>
2012-05-24 02:54:03 +02:00
<li data-filter="shared_with_me"><a href="#"><i class="icon-share"></i> Shared With Me</a></li>
<li data-filter="public"><a href="#"><i class="icon-globe"></i> Public Maps</a></li>
2012-05-24 02:54:03 +02:00
</ul>
2012-04-15 13:00:51 +02:00
</div>
2012-05-24 02:54:03 +02:00
<div style="width: 78%;float: left;">
<div id="buttonsToolbar" class="btn-toolbar">
<div class="btn-group">
<button id="newBtn" class="btn btn-primary"><i class="icon-file icon-white"></i> New</button>
<button id="importBtn" class="btn btn-primary"><i class="icon-upload icon-white"></i> Import
</button>
</div>
<div class="btn-group act-multiple" id="deleteBtn" style="display:none">
<button class="btn btn-primary"><i class="icon-trash icon-white"></i> Delete</button>
</div>
<div id="infoBtn" class="btn-group act-single" style="display:none">
<button class="btn btn-primary"><i class="icon-exclamation-sign icon-white"></i> Info</button>
</div>
<div id="actionsBtn" class="btn-group act-single" style="display:none">
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="icon-asterisk icon-white"></i> More
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li id="duplicateBtn"><a href="#" onclick="return false"><i class="icon-plus-sign"></i>
Duplicate</a></li>
<li id="renameBtn"><a href="#" onclick="return false"><i class="icon-edit"></i> Rename</a></li>
<li id="printBtn"><a href="#" onclick="return false"><i class="icon-print"></i> Print</a></li>
2012-05-27 23:15:46 +02:00
<li id="publishBtn"><a href="#" onclick="return false"><i class="icon-globe"></i>Publish</a>
</li>
2012-05-24 02:54:03 +02:00
<li id="shareBtn"><a href="#" onclick="return false"><i class="icon-share"></i> Share</a></li>
2012-05-24 05:46:54 +02:00
<li id="tagBtn"><a href="#" onclick="return false"><i class="icon-tags"></i> Tag</a></li>
2012-05-27 23:15:46 +02:00
<li id="historyBtn"><a href="#" onclick="return false"><i class="icon-time"></i> History</a>
</li>
2012-05-24 02:54:03 +02:00
</ul>
</div>
<div id="tableActions" class="btn-toolbar">
<div class="btn-group" id="pageButtons">
<button class="btn" id="pPageBtn"><strong>&lt;</strong></button>
<button class="btn" id="nPageBtn"><strong>&gt;</strong></button>
</div>
<div id="pageInfo"></div>
</div>
</div>
<div id="map-table">
<table class="table" id="mindmapListTable"></table>
<div id="tableFooter" class="form-inline"></div>
</div>
2012-05-24 01:05:16 +02:00
</div>
2012-05-24 02:54:03 +02:00
</div>
</div>
<jsp:include page="footer.jsp"/>
2012-04-08 01:05:50 +02:00
2012-05-24 02:54:03 +02:00
<div id="dialogsContainer">
<!-- New map dialog -->
<div id="new-dialog-modal" title="Add new map" class="modal fade" style="display:none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Create a new map</h3>
2012-05-24 01:05:16 +02:00
</div>
2012-05-24 02:54:03 +02:00
<div class="modal-body">
<div class="errorMessage"></div>
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="newTitle"><spring:message code="NAME"/>:</label>
<input class="control" name="title" id="newTitle" type="text" required="true"
placeholder="Name of the new map to create" autofocus="autofocus"/>
</div>
<div class="control-group">
<label class="control-label" for="newDec"><spring:message code="DESCRIPTION"/>:</label>
<input class="control" name="description" id="newDec" type="text"
placeholder="Some description for your map"/>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-accept" data-loading-text="Saving ...">Create</button>
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
2012-04-06 22:05:42 +02:00
</div>
2012-05-24 01:05:16 +02:00
</div>
2012-04-06 22:05:42 +02:00
2012-05-24 02:54:03 +02:00
<!-- Duplicate map dialog -->
<div id="duplicate-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">X</button>
<h3 id="dupDialogTitle"></h3>
2012-05-20 07:25:54 +02:00
</div>
2012-05-24 02:54:03 +02:00
<div class="modal-body">
<div class="errorMessage"></div>
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label for="title" class="control-label"><spring:message code="NAME"/>: </label>
<input name="title" id="title" type="text" required="required"
placeholder="Name of the new map to create" autofocus="autofocus"
class="control"/>
</div>
<div class="control-group">
<label for="description" class="control-label"><spring:message
code="DESCRIPTION"/>: </label>
<input name="description" id="description" type="text"
placeholder="Some description for your map" class="control"/>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-accept" data-loading-text="Saving ...">Duplicate</button>
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
2012-05-20 07:25:54 +02:00
</div>
2012-05-24 02:54:03 +02:00
</div>
2012-05-20 07:25:54 +02:00
2012-05-24 02:54:03 +02:00
<!-- Rename map dialog -->
<div id="rename-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3 id="renameDialogTitle"></h3>
</div>
<div class="modal-body">
<div class="errorMessage"></div>
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label for="renTitle" class="control-label"><spring:message code="NAME"/>: </label>
<input name="title" id="renTitle" required="required" autofocus="autofocus"
class="control"/>
</div>
<div class="control-group">
<label for="renDescription" class="control-label"><spring:message
code="DESCRIPTION"/>:</label>
<input name="description" class="control" id="renDescription"/>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-accept" data-loading-text="Saving ...">Rename</button>
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
2012-05-20 02:36:34 +02:00
</div>
2012-05-24 01:05:16 +02:00
</div>
2012-05-20 02:36:34 +02:00
2012-05-24 01:05:16 +02:00
<!-- Delete map dialog -->
<div id="delete-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Delete MindMap</h3>
</div>
<div class="modal-body">
<div class="alert alert-block">
<h4 class="alert-heading">Warning!</h4>Deleted mindmap can not be recovered. Do you want to
continue ?.
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-accept" data-loading-text="Saving ...">Delete</button>
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
</div>
</div>
2012-05-20 17:28:10 +02:00
2012-05-24 01:05:16 +02:00
<!-- Info map dialog -->
<div id="info-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Info</h3>
2012-04-06 22:05:42 +02:00
</div>
2012-05-24 01:05:16 +02:00
<div class="modal-body">
2012-05-20 17:28:10 +02:00
2012-05-24 01:05:16 +02:00
</div>
<div class="modal-footer">
<button class="btn btn-cancel" data-dismiss="modal">Close</button>
</div>
2012-04-06 22:05:42 +02:00
</div>
2012-05-24 01:05:16 +02:00
<!-- Publish Dialog Config -->
<div id="publish-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Publish</h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-accept" data-loading-text="Saving...">Accept</button>
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
</div>
</div>
2012-05-27 23:15:46 +02:00
</div>
</body>
</html>