Navigation between admin/upload and project page
This commit is contained in:
@@ -3908,7 +3908,7 @@
|
||||
<sym>Truck</sym>
|
||||
</wpt><wpt lat="32.607373" lon="-116.470798">
|
||||
<ele>784.5</ele>
|
||||
<name>PO0001</name>
|
||||
<name>Post Office - 1</name>
|
||||
<desc><![CDATA[Campo is a small town on the PCT with a small store, pay phone and a post office [619-478-5466].]]></desc>
|
||||
<sym>Post Office</sym>
|
||||
</wpt><wpt lat="32.608394" lon="-116.474383">
|
||||
@@ -4133,7 +4133,7 @@
|
||||
<sym>Campground</sym>
|
||||
</wpt><wpt lat="32.867127" lon="-116.419153">
|
||||
<ele>1803.2</ele>
|
||||
<name>PO0041</name>
|
||||
<name>Post Office - 41</name>
|
||||
<desc><![CDATA[Mount Laguna, 4/10 mile W of PCT. Nearby store, lodge [Lagunamountain.com, 619-473-8533], outfitter [Mount Laguna Sports, 619-473-0450], restaurant and a Post Office [619-473-8341].]]></desc>
|
||||
<sym>Post Office</sym>
|
||||
</wpt><wpt lat="32.864153" lon="-116.412530">
|
||||
|
||||
43
inc/Spot.php
43
inc/Spot.php
@@ -73,7 +73,16 @@ class Spot extends Main
|
||||
//Install DB
|
||||
$this->oDb->install();
|
||||
|
||||
$this->oUser->addUser('admin@admin.com', $this->oLang->getLanguage(), date_default_timezone_get());
|
||||
//Add first user
|
||||
$iUserId = $this->oDb->insertRow(User::USER_TABLE, array(
|
||||
'name' => 'Admin',
|
||||
'email' => 'admin@admin.com',
|
||||
'language' => self::DEFAULT_LANG,
|
||||
'timezone' => date_default_timezone_get(),
|
||||
'active' => User::USER_ACTIVE,
|
||||
'clearance' => User::CLEARANCE_ADMIN
|
||||
));
|
||||
$this->oUser->setUserId($iUserId);
|
||||
}
|
||||
|
||||
public function syncPics() {
|
||||
@@ -177,6 +186,7 @@ class Spot extends Main
|
||||
'server' => $this->asContext['serv_name'],
|
||||
'geo_server' => Settings::GEO_SERVER,
|
||||
'modes' => Project::MODES,
|
||||
'clearances' => User::CLEARANCES,
|
||||
'default_timezone' => Settings::TIMEZONE
|
||||
)
|
||||
),
|
||||
@@ -310,8 +320,8 @@ class Spot extends Main
|
||||
return $bInternal?$asResult:self::getJsonResult(true, '', $asResult);
|
||||
}
|
||||
|
||||
public function subscribe($sEmail) {
|
||||
$asResult = $this->oUser->addUser($sEmail, $this->oLang->getLanguage(), date_default_timezone_get());
|
||||
public function subscribe($sEmail, $sNickName) {
|
||||
$asResult = $this->oUser->addUser($sEmail, $this->oLang->getLanguage(), date_default_timezone_get(), $sNickName);
|
||||
$asUserInfo = $this->oUser->getUserInfo();
|
||||
|
||||
//Send Confirmation Email
|
||||
@@ -521,19 +531,24 @@ class Spot extends Main
|
||||
$this->oDb->cleanSql($sSort);
|
||||
|
||||
$sMediaRefField = 'posted_on';
|
||||
$sProjectIdField = Db::getId(Project::PROJ_TABLE);
|
||||
$sMsgIdField = Db::getId(Feed::MSG_TABLE);
|
||||
$sMediaIdField = Db::getId(Media::MEDIA_TABLE);
|
||||
$sPostIdField = Db::getId(self::POST_TABLE);
|
||||
$sFeedIdField = Db::getId(Feed::FEED_TABLE);
|
||||
$sQuery = implode(" ", array(
|
||||
"SELECT type, id, ref",
|
||||
"FROM (",
|
||||
"SELECT id_project, id_message AS id, 'message' AS type, CONCAT(UNIX_TIMESTAMP(site_time), '.0', id_message) AS ref",
|
||||
"SELECT {$sProjectIdField}, {$sMsgIdField} AS id, 'message' AS type, CONCAT(UNIX_TIMESTAMP(site_time), '.0', {$sMsgIdField}) AS ref",
|
||||
"FROM ".Feed::MSG_TABLE,
|
||||
"INNER JOIN feeds USING(id_feed)",
|
||||
"INNER JOIN ".Feed::FEED_TABLE." USING({$sFeedIdField})",
|
||||
$this->getFeedConstraints(Feed::MSG_TABLE, 'site_time', 'sql'),
|
||||
"UNION",
|
||||
"SELECT id_project, id_media AS id, 'media' AS type, CONCAT(UNIX_TIMESTAMP(".$sMediaRefField."), '.1', id_media) AS ref",
|
||||
"SELECT {$sProjectIdField}, {$sMediaIdField} AS id, 'media' AS type, CONCAT(UNIX_TIMESTAMP({$sMediaRefField}), '.1', {$sMediaIdField}) AS ref",
|
||||
"FROM ".Media::MEDIA_TABLE,
|
||||
$this->getFeedConstraints(Media::MEDIA_TABLE, $sMediaRefField, 'sql'),
|
||||
"UNION",
|
||||
"SELECT id_project, id_post AS id, 'post' AS type, CONCAT(UNIX_TIMESTAMP(site_time), '.2', id_post) AS ref",
|
||||
"SELECT {$sProjectIdField}, {$sPostIdField} AS id, 'post' AS type, CONCAT(UNIX_TIMESTAMP(site_time), '.2', {$sPostIdField}) AS ref",
|
||||
"FROM ".self::POST_TABLE,
|
||||
$this->getFeedConstraints(self::POST_TABLE, 'site_time', 'sql'),
|
||||
") AS items",
|
||||
@@ -633,8 +648,6 @@ class Spot extends Main
|
||||
$asProject['active_to'] = substr($asProject['active_to'], 0, 10);
|
||||
}
|
||||
|
||||
foreach($asData['user'] as &$asUser) $asUser['id'] = $asUser[Db::getId(User::USER_TABLE)];
|
||||
|
||||
return self::getJsonResult(true, '', $asData);
|
||||
}
|
||||
|
||||
@@ -683,6 +696,18 @@ class Spot extends Main
|
||||
}
|
||||
$asResult = $oFeed->getFeed();
|
||||
break;
|
||||
case 'user':
|
||||
switch($sField) {
|
||||
case 'clearance':
|
||||
$asReturnCode = $this->oUser->setUserClearance($iId, $sValue);
|
||||
$bSuccess = $asReturnCode['result'];
|
||||
$sDesc = $asReturnCode['desc'];
|
||||
break;
|
||||
default:
|
||||
$sDesc = $this->oLang->getTranslation('unknown_field', $sField);
|
||||
}
|
||||
$asResult = $this->oUser->getActiveUserInfo($iId);
|
||||
break;
|
||||
}
|
||||
if(!$bSuccess && $sDesc=='') $sDesc = Mask::LANG_PREFIX.'error_commit_db';
|
||||
|
||||
|
||||
64
inc/User.php
64
inc/User.php
@@ -15,6 +15,7 @@ class User extends PhpObject {
|
||||
const USER_INACTIVE = 0;
|
||||
const CLEARANCE_USER = 0;
|
||||
const CLEARANCE_ADMIN = 9;
|
||||
const CLEARANCES = array('user'=>self::CLEARANCE_USER, 'admin'=>self::CLEARANCE_ADMIN);
|
||||
|
||||
//Cookie
|
||||
const COOKIE_ID_USER = 'subscriber';
|
||||
@@ -34,6 +35,7 @@ class User extends PhpObject {
|
||||
$this->oDb = &$oDb;
|
||||
$this->iUserId = 0;
|
||||
$this->asUserInfo = array(
|
||||
'id' => 0,
|
||||
Db::getId(self::USER_TABLE) => 0,
|
||||
'name' => '',
|
||||
'email' => '',
|
||||
@@ -49,7 +51,7 @@ class User extends PhpObject {
|
||||
return $this->asUserInfo['language'];
|
||||
}
|
||||
|
||||
public function addUser($sEmail, $sLang, $sTimezone) {
|
||||
public function addUser($sEmail, $sLang, $sTimezone, $sNickName='') {
|
||||
$bSuccess = false;
|
||||
$sDesc = '';
|
||||
$sEmail = trim($sEmail);
|
||||
@@ -58,7 +60,7 @@ class User extends PhpObject {
|
||||
$iUserId = $this->oDb->selectValue(self::USER_TABLE, Db::getId(self::USER_TABLE), array('email'=>$sEmail, 'active'=>self::USER_ACTIVE));
|
||||
|
||||
if($iUserId > 0) {
|
||||
//Log user in
|
||||
//Just log user in
|
||||
$sDesc = 'lang:nl_email_exists';
|
||||
$bSuccess = true;
|
||||
}
|
||||
@@ -72,16 +74,23 @@ class User extends PhpObject {
|
||||
|
||||
if($iUserId==0) $sDesc = 'lang:error_commit_db';
|
||||
else {
|
||||
$this->updateGravatar($iUserId, $sEmail);
|
||||
$sDesc = 'lang:nl_subscribed';
|
||||
$bSuccess = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Set Cookie (valid 1 year)
|
||||
|
||||
if($bSuccess) {
|
||||
$this->setUserId($iUserId);
|
||||
|
||||
//Set Cookie (valid 1 year)
|
||||
$this->updateCookie(self::COOKIE_DURATION);
|
||||
|
||||
//Update Nickname if user has already posted
|
||||
$this->updateNickname($sNickName);
|
||||
|
||||
//Retrieve Gravatar image
|
||||
$this->updateGravatar($iUserId, $sEmail);
|
||||
}
|
||||
|
||||
return Spot::getResult($bSuccess, $sDesc);
|
||||
@@ -92,7 +101,7 @@ class User extends PhpObject {
|
||||
$sDesc = '';
|
||||
|
||||
if($this->iUserId > 0) {
|
||||
$iUserId = $this->oDb->updateRow(self::USER_TABLE, $this->iUserId, array('active'=>self::USER_INACTIVE));
|
||||
$iUserId = $this->oDb->updateRow(self::USER_TABLE, $this->getUserId(), array('active'=>self::USER_INACTIVE));
|
||||
if($iUserId==0) $sDesc = 'lang:error_commit_db';
|
||||
else {
|
||||
$sDesc = 'lang:nl_unsubscribed';
|
||||
@@ -106,7 +115,7 @@ class User extends PhpObject {
|
||||
}
|
||||
|
||||
public function updateNickname($sNickname) {
|
||||
if($this->iUserId > 0 && $sNickname!='') $this->oDb->updateRow(self::USER_TABLE, $this->iUserId, array('name'=>$sNickname));
|
||||
if($this->getUserId() > 0 && $sNickname!='') $this->oDb->updateRow(self::USER_TABLE, $this->getUserId(), array('name'=>$sNickname));
|
||||
}
|
||||
|
||||
private function updateGravatar($iUserId, $sEmail) {
|
||||
@@ -119,7 +128,7 @@ class User extends PhpObject {
|
||||
$this->setUserId($_COOKIE[self::COOKIE_ID_USER]);
|
||||
|
||||
//Extend cookie life
|
||||
if($this->iUserId > 0) $this->updateCookie(self::COOKIE_DURATION);
|
||||
if($this->getUserId() > 0) $this->updateCookie(self::COOKIE_DURATION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,10 +139,10 @@ class User extends PhpObject {
|
||||
public function setUserId($iUserId) {
|
||||
$this->iUserId = 0;
|
||||
|
||||
$asUser = $this->getActiveUsersInfo($iUserId);
|
||||
$asUser = $this->getActiveUserInfo($iUserId);
|
||||
if(!empty($asUser)) {
|
||||
$this->iUserId = $iUserId;
|
||||
$this->asUserInfo = array_shift($asUser);
|
||||
$this->asUserInfo = $asUser;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,16 +150,28 @@ class User extends PhpObject {
|
||||
return $this->asUserInfo;
|
||||
}
|
||||
|
||||
public function getActiveUserInfo($iUserId) {
|
||||
$asUsersInfo = array();
|
||||
if($iUserId > 0) $asUsersInfo = $this->getActiveUsersInfo($iUserId);
|
||||
return empty($asUsersInfo)?array():array_shift($asUsersInfo);
|
||||
}
|
||||
|
||||
public function getActiveUsersInfo($iUserId=-1) {
|
||||
|
||||
//Mapping between user fields and DB fields
|
||||
$asSelect = array_keys($this->asUserInfo);
|
||||
$asSelect[array_search('id', $asSelect)] = Db::getId(self::USER_TABLE)." AS id";
|
||||
|
||||
//Non-admin cannot access clearance info
|
||||
if(!$this->checkUserClearance(self::CLEARANCE_ADMIN)) unset($asSelect['clearance']);
|
||||
|
||||
$asInfo = array(
|
||||
'select' => array_keys($this->asUserInfo),
|
||||
'select' => $asSelect,
|
||||
'from' => self::USER_TABLE,
|
||||
'constraint'=> array('active'=>self::USER_ACTIVE)
|
||||
);
|
||||
if($iUserId != -1) $asInfo['constraint'][Db::getId(self::USER_TABLE)] = $iUserId;
|
||||
|
||||
if(!$this->checkUserClearance(self::CLEARANCE_ADMIN)) unset($asInfo['select']['clearance']);
|
||||
|
||||
return $this->oDb->selectRows($asInfo);
|
||||
}
|
||||
|
||||
@@ -159,7 +180,24 @@ class User extends PhpObject {
|
||||
return ($this->asUserInfo['clearance'] >= $iClearance);
|
||||
}
|
||||
|
||||
public function setUserClearance($iUserId, $iClearance) {
|
||||
$bSuccess = false;
|
||||
$sDesc = '';
|
||||
|
||||
if(!$this->checkUserClearance(self::CLEARANCE_ADMIN)) $sDesc = 'unauthorized';
|
||||
else {
|
||||
if(!in_array($iClearance, self::CLEARANCES)) $sDesc = 'Setting wrong clearance "'.$iClearance.'" to user ID "'.$iUserId.'"';
|
||||
else {
|
||||
$iUserId = $this->oDb->updateRow(self::USER_TABLE, $iUserId, array('clearance'=>$iClearance));
|
||||
if(!$iUserId) $sDesc = 'lang:error_commit_db';
|
||||
else $bSuccess = true;
|
||||
}
|
||||
}
|
||||
|
||||
return Spot::getResult($bSuccess, $sDesc);
|
||||
}
|
||||
|
||||
private function updateCookie($iDeltaTime) {
|
||||
setcookie(self::COOKIE_ID_USER, ($iDeltaTime < 0)?'':$this->iUserId, array('samesite' => 'Lax', 'expires' => time() + $iDeltaTime));
|
||||
setcookie(self::COOKIE_ID_USER, ($iDeltaTime < 0)?'':$this->getUserId(), array('samesite' => 'Lax', 'expires' => time() + $iDeltaTime));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ if($sAction!='')
|
||||
$sResult = $oSpot->addPost($sName, $sContent);
|
||||
break;
|
||||
case 'subscribe':
|
||||
$sResult = $oSpot->subscribe($sEmail);
|
||||
$sResult = $oSpot->subscribe($sEmail, $sName);
|
||||
break;
|
||||
case 'unsubscribe':
|
||||
$sResult = $oSpot->unsubscribe();
|
||||
|
||||
@@ -3,6 +3,11 @@ page_og_desc = Keep contact with François when he is off hiking
|
||||
error_commit_db = Issue committing to DB
|
||||
unknown_field = Field "$0" is unknown
|
||||
|
||||
nav_back = Back
|
||||
|
||||
admin = Admin Panel
|
||||
admin_config = Config
|
||||
admin_upload = Upload
|
||||
save = Save
|
||||
admin_save_success = Saved
|
||||
|
||||
@@ -27,9 +32,9 @@ map_satellite = Satellite
|
||||
map_otm = Open Topo Map
|
||||
map_ign_france = IGN (France)
|
||||
map_ign_spain = IGN (Spain)
|
||||
map_linz = LINZ (New Zealand)
|
||||
map_usgs = USGS (USA)
|
||||
map_natgeo = National Geographic (USA)
|
||||
map_linz = LINZ
|
||||
map_usgs = USGS
|
||||
map_natgeo = National Geographic
|
||||
|
||||
image = Picture
|
||||
images = Pictures
|
||||
@@ -55,6 +60,8 @@ time_zone = Time Zone
|
||||
id_project = Project ID
|
||||
project = Project
|
||||
projects = Projects
|
||||
new_project = New Project
|
||||
update_project = Update Project
|
||||
hikes = Hikes
|
||||
mode = Mode
|
||||
mode_previz = Project in preparation
|
||||
@@ -63,6 +70,7 @@ mode_histo = Archived Project
|
||||
code_name = Code name
|
||||
start = Start
|
||||
end = End
|
||||
feeds = Feeds
|
||||
id_feed = Feed ID
|
||||
ref_feed_id = Ref. Feed ID
|
||||
id_spot = Spot ID
|
||||
@@ -73,8 +81,11 @@ ref_spot_id = Ref. Spot ID
|
||||
model = Model
|
||||
delete = Delete
|
||||
id_user = User ID
|
||||
user_name = User Name
|
||||
active_users = Active Users
|
||||
language = Language
|
||||
clearance = Clearance
|
||||
toolbox = Toolbox
|
||||
|
||||
unit_day = day
|
||||
unit_days = days
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
locale = fr_FR
|
||||
locale = fr_CH
|
||||
page_og_desc = Gardez le contact avec François lorsqu'il part sur les chemins
|
||||
error_commit_db = Error lors de la requête SQL
|
||||
unknown_field = Champ "$0" inconnu
|
||||
|
||||
nav_back = Retour
|
||||
|
||||
admin = Administration
|
||||
admin_config = Paramètres
|
||||
admin_upload = Uploader
|
||||
save = Sauvegarder
|
||||
admin_save_success = Sauvegardé
|
||||
|
||||
@@ -27,9 +32,9 @@ map_satellite = Satellite
|
||||
map_otm = Open Topo Map
|
||||
map_ign_france = IGN (France)
|
||||
map_ign_spain = IGN (Espagne)
|
||||
map_linz = LINZ (Nouvelle-Zélande)
|
||||
map_usgs = USGS (États-Unis)
|
||||
map_natgeo = National Geographic (États-Unis)
|
||||
map_linz = LINZ
|
||||
map_usgs = USGS
|
||||
map_natgeo = National Geographic
|
||||
|
||||
image = Photo
|
||||
images = Photos
|
||||
@@ -55,6 +60,8 @@ time_zone = Fuseau horaire
|
||||
id_project = ID projet
|
||||
project = Projet
|
||||
projects = Projets
|
||||
new_project = Nouveau projet
|
||||
update_project = Mettre à jour le projet
|
||||
hikes = Randonnées
|
||||
mode = Mode
|
||||
mode_previz = Project en cours de préparation
|
||||
@@ -63,6 +70,7 @@ mode_histo = Project archivé
|
||||
code_name = Nom de code
|
||||
start = Départ
|
||||
end = Arrivée
|
||||
feeds = Feeds
|
||||
id_feed = ID Feed
|
||||
ref_feed_id = ID Feed ref.
|
||||
id_spot = ID Spot
|
||||
@@ -73,8 +81,11 @@ ref_spot_id = ID Spot ref.
|
||||
model = Modèle
|
||||
delete = Supprimer
|
||||
id_user = ID Utilisateur
|
||||
user_name = Nom
|
||||
active_users = Utilisateurs actifs
|
||||
language = Langue
|
||||
clearance = Niveau d'autorisation
|
||||
toolbox = Boite à outils
|
||||
|
||||
unit_day = jour
|
||||
unit_days = jours
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -34,9 +34,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<header></header>
|
||||
<div id="main"></div>
|
||||
<footer></footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -253,11 +253,15 @@ function Spot(asGlobals)
|
||||
iTimeMinutes = Math.floor(iHours * 4) * 15; //Round down to the closest 15 minutes
|
||||
}
|
||||
return '~ '
|
||||
+(iTimeDays>0?(iTimeDays+(iTimeDays%2==0?'':'½')+' '+oSpot.lang(iTimeDays>1?'unit_days':'unit_day')):'')//Days
|
||||
+((iTimeHours>0 || iTimeDays==0)?iTimeHours+oSpot.lang('unit_hour'):'') //Hours
|
||||
+(iTimeDays>0?(iTimeDays+(iTimeDays%2==0?'':'½')+' '+self.lang(iTimeDays>1?'unit_days':'unit_day')):'') //Days
|
||||
+((iTimeHours>0 || iTimeDays==0)?iTimeHours+self.lang('unit_hour'):'') //Hours
|
||||
+((iTimeDays>0 || iTimeMinutes==0)?'':iTimeMinutes) //Minutes
|
||||
|
||||
};
|
||||
|
||||
this.checkClearance = function(sClearance) {
|
||||
return (self.vars(['user', 'clearance']) >= sClearance);
|
||||
}
|
||||
}
|
||||
|
||||
/* Common Functions */
|
||||
|
||||
@@ -70,11 +70,7 @@ textarea:focus, input:focus {
|
||||
outline: 1px solid #CCC;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body, textarea, input, button {
|
||||
body, textarea, input, button, a.button {
|
||||
font-size: 14px;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
margin: 0;
|
||||
@@ -84,17 +80,35 @@ textarea {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
a.button {
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
input, textarea, button {
|
||||
button, a.button {
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
background: #eee;
|
||||
|
||||
&:hover {
|
||||
color: #eee;
|
||||
background: #000;
|
||||
}
|
||||
}
|
||||
|
||||
input, textarea, button, a.button {
|
||||
border: none;
|
||||
padding: 0.5em 1em;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
margin: 1em 0 0.5em;
|
||||
}
|
||||
|
||||
/* Feedback */
|
||||
|
||||
.feedback {
|
||||
|
||||
@@ -37,6 +37,20 @@ $fa-css-prefix: fa;
|
||||
}
|
||||
}
|
||||
|
||||
/* Navigation */
|
||||
.#{$fa-css-prefix}-menu:before { content: fa-content($fa-var-bars); }
|
||||
.#{$fa-css-prefix}-error:before { content: fa-content($fa-var-exclamation-square); }
|
||||
.#{$fa-css-prefix}-warning:before { content: fa-content($fa-var-exclamation-triangle); }
|
||||
.#{$fa-css-prefix}-success:before { content: fa-content($fa-var-check-circle); }
|
||||
.#{$fa-css-prefix}-new:before { content: fa-content($fa-var-plus); }
|
||||
.#{$fa-css-prefix}-refresh:before { content: fa-content($fa-var-sync); }
|
||||
.#{$fa-css-prefix}-refresh:before { content: fa-content($fa-var-sync); }
|
||||
.#{$fa-css-prefix}-cancel:before { content: fa-content($fa-var-image); }
|
||||
.#{$fa-css-prefix}-prev:before,
|
||||
.#{$fa-css-prefix}-back:before { content: fa-content($fa-var-chevron-left); }
|
||||
.#{$fa-css-prefix}-next:before { content: fa-content($fa-var-chevron-right); }
|
||||
.#{$fa-css-prefix}-close:before { content: fa-content($fa-var-times-circle); }
|
||||
|
||||
/* Map */
|
||||
.#{$fa-css-prefix}-map:before { content: fa-content($fa-var-map-marked); }
|
||||
.#{$fa-css-prefix}-track-off-track:before { content: fa-content($fa-var-hiking); }
|
||||
@@ -49,17 +63,16 @@ $fa-css-prefix: fa;
|
||||
.#{$fa-css-prefix}-distance:before { content: fa-content($fa-var-arrow-circle-right); }
|
||||
.#{$fa-css-prefix}-elev-drop:before { content: fa-content($fa-var-arrow-circle-down); }
|
||||
.#{$fa-css-prefix}-elev-gain:before { content: fa-content($fa-var-arrow-circle-up); }
|
||||
.#{$fa-css-prefix}-download:before { content: fa-content($fa-var-file-download); }
|
||||
.#{$fa-css-prefix}-download:before { content: fa-content($fa-var-file-download); }
|
||||
|
||||
/* Settings */
|
||||
.#{$fa-css-prefix}-menu:before { content: fa-content($fa-var-bars); }
|
||||
/* Admin */
|
||||
.#{$fa-css-prefix}-newsletter:before { content: fa-content($fa-var-wifi); }
|
||||
.#{$fa-css-prefix}-project:before { content: fa-content($fa-var-hiking); }
|
||||
.#{$fa-css-prefix}-error:before { content: fa-content($fa-var-exclamation-square); }
|
||||
.#{$fa-css-prefix}-warning:before { content: fa-content($fa-var-exclamation-triangle); }
|
||||
.#{$fa-css-prefix}-success:before { content: fa-content($fa-var-check-circle); }
|
||||
.#{$fa-css-prefix}-unsubscribe:before { content: fa-content($fa-var-times); }
|
||||
.#{$fa-css-prefix}-credits:before { content: fa-content($fa-var-paw); }
|
||||
.#{$fa-css-prefix}-admin:before { content: fa-content($fa-var-tools); }
|
||||
.#{$fa-css-prefix}-config:before { content: fa-content($fa-var-cogs); }
|
||||
.#{$fa-css-prefix}-upload:before { content: fa-content($fa-var-cloud-upload); }
|
||||
|
||||
/* Feed */
|
||||
.#{$fa-css-prefix}-post:before { content: fa-content($fa-var-comment); }
|
||||
@@ -83,16 +96,8 @@ $fa-css-prefix: fa;
|
||||
.#{$fa-css-prefix}-send:before { content: fa-content($fa-var-paper-plane); }
|
||||
|
||||
/* Lightbox */
|
||||
.#{$fa-css-prefix}-cancel:before { content: fa-content($fa-var-image); }
|
||||
.#{$fa-css-prefix}-prev:before { content: fa-content($fa-var-chevron-left); }
|
||||
.#{$fa-css-prefix}-next:before { content: fa-content($fa-var-chevron-right); }
|
||||
.#{$fa-css-prefix}-close:before { content: fa-content($fa-var-times-circle); }
|
||||
.#{$fa-css-prefix}-timezone:before { content: fa-content($fa-var-globe); }
|
||||
|
||||
/* Admin */
|
||||
.#{$fa-css-prefix}-new:before { content: fa-content($fa-var-plus); }
|
||||
.#{$fa-css-prefix}-refresh:before { content: fa-content($fa-var-sync); }
|
||||
|
||||
/* Weather */
|
||||
.#{$fa-css-prefix}-temperature:before { content: fa-content($fa-var-thermometer-three-quarters); }
|
||||
.#{$fa-css-prefix}-clear-day:before { content: fa-content($fa-var-sun); }
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
#admin {
|
||||
margin: 1em;
|
||||
|
||||
button.main-btn {
|
||||
color: #000;
|
||||
background: #eee;
|
||||
&:hover {
|
||||
color: #eee;
|
||||
background: #000;
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
margin-bottom: 1em;
|
||||
border-collapse: collapse;
|
||||
@@ -35,6 +26,7 @@
|
||||
|
||||
button {
|
||||
color: #AAA;
|
||||
background: none;
|
||||
&:hover {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,12 @@ $track-hitchhiking-color: #FF7814;
|
||||
$legend-color: $post-color;
|
||||
|
||||
#projects {
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
/* Panels movements */
|
||||
&.with-feed {
|
||||
@@ -374,14 +380,24 @@ $legend-color: $post-color;
|
||||
color: $post-color;
|
||||
}
|
||||
|
||||
button {
|
||||
button, a.button {
|
||||
background-color: $post-color;
|
||||
color: $post-bg;
|
||||
|
||||
&:hover {
|
||||
&:hover, &:hover a, &:hover a:visited {
|
||||
background-color: $post-input-bg;
|
||||
color: $post-color;
|
||||
}
|
||||
|
||||
a, a:visited {
|
||||
background-color: $post-color;
|
||||
color: $post-bg;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&+ button, &+ a.button {
|
||||
margin-left: $elem-spacing;
|
||||
}
|
||||
}
|
||||
|
||||
#feed-panel, #settings-panel {
|
||||
@@ -765,12 +781,19 @@ $legend-color: $post-color;
|
||||
h1 {
|
||||
margin: 0 0 $block-spacing;
|
||||
color: $title-color;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: .3em;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
|
||||
& > div {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
&.newsletter {
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
#upload {
|
||||
padding: 1em;
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
border-bottom: 2px solid black;
|
||||
margin: 0 0 1em 0;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.bar {
|
||||
height: 18px;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user