Navigation between admin/upload and project page

This commit is contained in:
2021-11-06 19:38:51 +01:00
parent cb8a609605
commit dd04e7ee17
18 changed files with 218 additions and 94 deletions

View File

@@ -1,6 +1,7 @@
<div id="admin">
<h1>Projects</h1>
<div id="projects">
<a name="back" class="button" href="[#]host_url[#]"><i class="fa fa-back push"></i>[#]lang:nav_back[#]</a>
<h1>[#]lang:projects[#]</h1>
<div id="project_section">
<table>
<thead>
<tr>
@@ -17,8 +18,8 @@
</table>
<div id="new"></div>
</div>
<h1>Feeds</h1>
<div id="feeds">
<h1>[#]lang:feeds[#]</h1>
<div id="feed_section">
<table>
<thead>
<tr>
@@ -36,7 +37,7 @@
</table>
</div>
<h1>Spots</h1>
<div id="spots">
<div id="spot_section">
<table>
<thead>
<tr>
@@ -49,13 +50,13 @@
<tbody></tbody>
</table>
</div>
<h1>Users</h1>
<div id="users">
<h1>[#]lang:active_users[#]</h1>
<div id="user_section">
<table>
<thead>
<tr>
<th>[#]lang:id_user[#]</th>
<th>[#]lang:name[#]</th>
<th>[#]lang:user_name[#]</th>
<th>[#]lang:language[#]</th>
<th>[#]lang:time_zone[#]</th>
<th>[#]lang:clearance[#]</th>
@@ -64,15 +65,15 @@
<tbody></tbody>
</table>
</div>
<h1>ToolBox</h1>
<h1>[#]lang:toolbox[#]</h1>
<div id="toolbox"></div>
<div id="feedback" class="feedback"></div>
</div>
<script type="text/javascript">
oSpot.pageInit = function(asHash) {
self.get('admin_get', setProjects);
$('#new').addButton('new', 'New Project', 'new', createProject, 'main-btn');
$('#toolbox').addButton('refresh', 'Update Project', 'refresh', updateProject, 'main-btn');
$('#new').addButton('new', self.lang('new_project'), 'new', createProject);
$('#toolbox').addButton('refresh', self.lang('update_project'), 'refresh', updateProject);
};
oSpot.onFeedback = function(sType, sMsg, asContext) {
@@ -139,11 +140,11 @@ function setProjects(asElemTypes) {
.append($('<td>').text(oElem.name))
.append($('<td>').text(oElem.language))
.append($('<td>').text(oElem.timezone))
.append($('<td>').text(oElem.clearance))
.append($('<td>').addInput('number', 'clearance', oElem.clearance, aoEvents))
break;
}
$Elem.appendTo($('#'+sElemType+'s').find('table tbody'));
$Elem.appendTo($('#'+sElemType+'_section').find('table tbody'));
}
});
});

View File

@@ -34,9 +34,7 @@
</head>
<body>
<div id="container">
<header></header>
<div id="main"></div>
<footer></footer>
</div>
</body>
</html>

View File

@@ -26,6 +26,11 @@
<div id="settings-feedback" class="feedback"></div>
<div id="nl_desc"></div>
</div>
<div class="settings-section admin" id="admin_link">
<h1><i class="fa fa-fw push fa-admin"></i>[#]lang:admin[#]</h1>
<a class="button" id="admin_config" name="admin_config" href="#admin"><i class="fa fa-config push"></i>[#]lang:admin_config[#]</a>
<a class="button" id="admin_upload" name="admin_upload" href="#upload"><i class="fa fa-upload push"></i>[#]lang:admin_upload[#]</a>
</div>
</div>
</div>
<div class="settings-footer"><a href="https://git.lutran.fr/franzz/spot" title="[#]lang:credits_git[#]" target="_blank"><i class="fa fa-credits push"></i>[#]lang:credits_project[#]</a> [#]lang:credits_license[#]</div>
@@ -311,7 +316,7 @@ function initSettings(){
oSpot.vars('user', asData);
setUserInterface();
},
{'email': sEmail},
{'email': sEmail, 'name': $('#name').val()},
function(sDesc) {settingsFeedback('error', sDesc);},
function(sState) {
var bLoading = (sState=='start');
@@ -323,6 +328,9 @@ function initSettings(){
}
});
//Admin Access
$('#admin_link').toggle(oSpot.checkClearance(self.consts.clearances.admin));
//Twink interface with user data
setUserInterface();
}

View File

@@ -1,4 +1,5 @@
<div id="upload">
<a name="back" class="button" href="[#]host_url[#]"><i class="fa fa-back push"></i>[#]lang:nav_back[#]</a>
<h1>[#]lang:upload_title[#]</h1>
<input id="fileupload" type="file" name="files[]" multiple>
<div id="progress">