cockpit. la
-
- Invalid username or password
+
+
+ Invalid username or password
+
+
+
-
- Cockpit is Crunchbutton's tool of awesomeness. Looking for delivery food? Head over to
crunchbutton.com
+
+ Password:
+
+
+
+
+ Sign In
+
+
+
+
+
+ Cockpit is Crunchbutton's tool of awesomeness. Looking for delivery food? Head over to
crunchbutton.com
+
diff --git a/stackscript/cockpit.sh b/stackscript/cockpit.sh
new file mode 100644
index 000000000..e35dc3f85
--- /dev/null
+++ b/stackscript/cockpit.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+#
+#
+
+source
+source
+
+
+function install_cockpit {
+ apache_virtualhost $1
+
+ groupadd dev
+ useradd -m -s /bin/bash -G dev deploy
+ # echo "sup3rb4c0n" | passwd --stdin deploy
+
+ setup_github
+
+ chown deploy:dev /home
+ rm -Rf /home/${1}
+
+ sudo -u deploy git clone git@github.com:crunchbutton/crunchbutton.git /home/${1}
+ mkdir /home/${1}/logs /home/${1}/cache
+ mkdir /home/${1}/cache/min /home/${1}/cache/thumb /home/${1}/data
+ chmod -R 0777 /home/${1}/cache
+
+}
+
+# set basic shit
+set_hostname $MACHINENAME
+set_timezone
+
+# update and install shit
+system_update
+
+ssh_port $SSHPORT
+
+apache_install
+apache_virtualhost $MACHINENAME
+# mysql_install $MYSQLROOTPW
+php_install
+install_basics
+install_cockpit $MACHINENAME
+
+# restart it
+restart_services
diff --git a/stackscript/lamp.sh b/stackscript/lamp.sh
new file mode 100644
index 000000000..dd018eca6
--- /dev/null
+++ b/stackscript/lamp.sh
@@ -0,0 +1,211 @@
+#!/bin/bash
+
+# set the hostname
+function set_hostname {
+ echo setting hostname to $1
+ echo "HOSTNAME=$1" >> /etc/sysconfig/network
+ hostname "$1"
+
+ # update /etc/hosts
+ echo $(system_primary_ip) $(get_rdns_primary_ip) $(hostname) >> /etc/hosts
+}
+
+
+# set the timezone
+function set_timezone {
+ echo setting the timezone to LA
+ ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
+}
+
+
+# update from repos
+function system_update {
+ yum -yq update
+}
+
+
+# returns the primary IP assigned to eth0
+function system_primary_ip {
+ echo $(ifconfig eth0 | awk -F: '/inet addr:/ {print $2}' | awk '{ print $1 }')
+}
+
+
+# installs apache2 and set it to listen
+function apache_install {
+ yum -yq install httpd
+
+ mkdir /etc/httpd/sites-available
+ mkdir /etc/httpd/sites-enabled
+
+ # sed -i -e 's/^#NameVirtualHost \*:80$/NameVirtualHost *:80/' /etc/httpd/conf/httpd.conf
+
+ echo "Include sites-enabled/*" >> /etc/httpd/conf/httpd.conf
+ echo "NameVirtualHost *:80" >> /etc/httpd/conf/httpd.conf
+ echo "NameVirtualHost *:443" >> /etc/httpd/conf/httpd.conf
+ echo "NameVirtualHost [::]:80" >> /etc/httpd/conf/httpd.conf
+ echo "NameVirtualHost [::]:443" >> /etc/httpd/conf/httpd.conf
+
+ touch /tmp/restart-httpd
+}
+
+
+# adds a virtual host to sites avail/enabled
+function apache_virtualhost {
+ # Configures a VirtualHost
+ # $1 - required - the hostname of the virtualhost to create
+
+ if [ ! -n "$1" ]; then
+ echo "apache_virtualhost() requires the hostname as the first argument"
+ return 1;
+ fi
+
+ if [ -e "/etc/httpd/sites-available/${1}.conf" ]; then
+ echo /etc/httpd/sites-available/${1}.conf already exists
+ return;
+ fi
+
+ mkdir -p /home/$1/www /home/$1/logs
+
+ echo "" > /etc/httpd/sites-available/${1}.conf
+ echo " ServerName $1" >> /etc/httpd/sites-available/${1}.conf
+ echo " DocumentRoot /home/$1/www/" >> /etc/httpd/sites-available/${1}.conf
+ echo " " >> /etc/httpd/sites-available/${1}.conf
+ echo " AllowOverride All" >> /etc/httpd/sites-available/${1}.conf
+ echo " " >> /etc/httpd/sites-available/${1}.conf
+ echo " ErrorLog /home/$1/logs/error.log" >> /etc/httpd/sites-available/${1}.conf
+ echo " CustomLog /home/$1/logs/access.log combined" >> /etc/httpd/sites-available/${1}.conf
+ echo " " >> /etc/httpd/sites-available/${1}.conf
+
+ ln -s /etc/httpd/sites-available/${1}.conf /etc/httpd/sites-enabled/${1}.conf
+
+ touch /tmp/restart-httpd
+}
+
+
+# install and configure mysql
+function mysql_install {
+ # $1 - the mysql root password
+
+ if [ ! -n "$1" ]; then
+ echo "mysql_install() requires the root pass as its first argument"
+ return 1;
+ fi
+
+ yum -yq install mysql-server
+
+ service mysqld start
+
+ echo "Sleeping while MySQL starts up for the first time..."
+ sleep 20
+
+ # Remove anonymous users
+ echo "DELETE FROM mysql.user WHERE User='';" | mysql -u root
+ # Remove remote root
+ echo "DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';" | mysql -u root
+ # Remove test db
+ echo "DROP DATABASE test;" | mysql -u root
+ # Set root password
+ echo "UPDATE mysql.user SET Password=PASSWORD('$1') WHERE User='root';" | mysql -u root
+ # Flush privs
+ echo "FLUSH PRIVILEGES;" | mysql -u root
+
+ touch /tmp/restart-mysqld
+}
+
+
+# create a mysql db
+function mysql_create_database {
+ # $1 - the mysql root password
+ # $2 - the db name to create
+
+ if [ ! -n "$1" ]; then
+ echo "mysql_create_database() requires the root pass as its first argument"
+ return 1;
+ fi
+ if [ ! -n "$2" ]; then
+ echo "mysql_create_database() requires the name of the database as the second argument"
+ return 1;
+ fi
+
+ echo "CREATE DATABASE $2;" | mysql -u root -p"$1"
+}
+
+
+# add a mysql user
+function mysql_create_user {
+ # $1 - the mysql root password
+ # $2 - the user to create
+ # $3 - their password
+
+ if [ ! -n "$1" ]; then
+ echo "mysql_create_user() requires the root pass as its first argument"
+ return 1;
+ fi
+ if [ ! -n "$2" ]; then
+ echo "mysql_create_user() requires username as the second argument"
+ return 1;
+ fi
+ if [ ! -n "$3" ]; then
+ echo "mysql_create_user() requires a password as the third argument"
+ return 1;
+ fi
+
+ echo "CREATE USER '$2'@'localhost' IDENTIFIED BY '$3';" | mysql -u root -p"$1"
+}
+
+
+# add a mysql users permissions
+function mysql_grant_user {
+ # $1 - the mysql root password
+ # $2 - the user to bestow privileges
+ # $3 - the database
+
+ if [ ! -n "$1" ]; then
+ echo "mysql_create_user() requires the root pass as its first argument"
+ return 1;
+ fi
+ if [ ! -n "$2" ]; then
+ echo "mysql_create_user() requires username as the second argument"
+ return 1;
+ fi
+ if [ ! -n "$3" ]; then
+ echo "mysql_create_user() requires a database as the third argument"
+ return 1;
+ fi
+
+ echo "GRANT ALL PRIVILEGES ON $3.* TO '$2'@'localhost';" | mysql -u root -p"$1"
+ echo "FLUSH PRIVILEGES;" | mysql -u root -p"$1"
+
+}
+
+
+# install php from a 3rd party repo
+function php_install {
+ # yum -y remove php-common
+ rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
+ yum -y install php55w php55w-opcache php55w-xml php55w-mysql php55w-mbstring php55w-mcrypt php55w-pear
+
+ sed -i -e 's/^short_open_tag = Off$/short_open_tag = On/' /etc/php.ini
+}
+
+
+
+# restarts services that have a file in /tmp/needs-restart/
+function restart_services {
+ for service in $(ls /tmp/restart-* | cut -d- -f2); do
+ service $service restart
+ rm -f /tmp/restart-$service
+ done
+}
+
+
+# installs my shit
+function install_basics {
+ yum -yq install git wget
+}
+
+
+# changes sshs port
+function ssh_port {
+ sed -i -e 's/^#Port 22$/Port $1/' /etc/ssh/sshd_config
+}
\ No newline at end of file
diff --git a/stackscript/tune.sh b/stackscript/tune.sh
new file mode 100644
index 000000000..b08efe9b6
--- /dev/null
+++ b/stackscript/tune.sh
@@ -0,0 +1,68 @@
+
+
+
+
+function apache_tune {
+ # Tunes Apache's memory to use the percentage of RAM you specify, defaulting to 40%
+ # $1 - the percent of system memory to allocate towards Apache
+
+ if [ ! -n "$1" ];
+ then PERCENT=40
+ else PERCENT="$1"
+ fi
+
+ yum -yq install httpd
+ PERPROCMEM=10 # the amount of memory in MB each apache process is likely to utilize
+ MEM=$(get_physical_memory)
+ MAXCLIENTS=$((MEM*PERCENT/100/PERPROCMEM)) # calculate MaxClients
+ MAXCLIENTS=${MAXCLIENTS/.*} # cast to an integer
+ sed -i -e "s/\(^[ \t]*\(MaxClients\|ServerLimit\)[ \t]*\)[0-9]*/\1$MAXCLIENTS/" /etc/httpd/conf/httpd.conf
+
+ touch /tmp/restart-httpd
+}
+
+function php_tune {
+ # Tunes PHP to utilize up to nMB per process, 32 by default
+ if [ ! -n "$1" ];
+ then MEM="32"
+ else MEM="${1}"
+ fi
+
+ sed -i'-orig' "s/memory_limit = [0-9]\+M/memory_limit = ${MEM}M/" /etc/php.ini
+ touch /tmp/restart-httpd
+}
+
+function mysql_tune {
+ # Tunes MySQL's memory usage to utilize the percentage of memory you specify, defaulting to 40%
+
+ # $1 - the percent of system memory to allocate towards MySQL
+
+ if [ ! -n "$1" ];
+ then PERCENT=40
+ else PERCENT="$1"
+ fi
+
+ MEM=$(get_physical_memory)
+ MYMEM=$((MEM*PERCENT/100)) # how much memory we'd like to tune mysql with
+ MYMEMCHUNKS=$((MYMEM/4)) # how many 4MB chunks we have to play with
+
+ # mysql config options we want to set to the percentages in the second list, respectively
+ OPTLIST=(key_buffer sort_buffer_size read_buffer_size read_rnd_buffer_size myisam_sort_buffer_size query_cache_size)
+ DISTLIST=(75 1 1 1 5 15)
+
+ for opt in ${OPTLIST[@]}; do
+ sed -i -e "/\[mysqld\]/,/\[.*\]/s/^$opt/#$opt/" /etc/my.cnf
+ done
+
+ for i in ${!OPTLIST[*]}; do
+ val=$(echo | awk "{print int((${DISTLIST[$i]} * $MYMEMCHUNKS/100))*4}")
+ if [ $val -lt 4 ]
+ then val=4
+ fi
+ config="${config}\n${OPTLIST[$i]} = ${val}M"
+ done
+
+ sed -i -e "s/\(\[mysqld\]\)/\1\n$config\n/" /etc/my.cnf
+
+ touch /tmp/restart-mysqld
+}
\ No newline at end of file
diff --git a/www/assets/cockpit/js/cockpit.js b/www/assets/cockpit/js/cockpit.js
index 724d92ab8..dcf0880a1 100644
--- a/www/assets/cockpit/js/cockpit.js
+++ b/www/assets/cockpit/js/cockpit.js
@@ -41,6 +41,16 @@ NGApp.config(function($compileProvider){
NGApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider, RestaurantsService) {
$routeProvider
+ .when('/drivers/orders', {
+ action: 'drivers-orders',
+ controller: 'DriversOrdersCtrl',
+ templateUrl: 'assets/view/drivers-orders.html'
+ })
+ .when('/drivers/shifts', {
+ action: 'drivers-shifts',
+ controller: 'DriversShiftsCtrl',
+ templateUrl: 'assets/view/drivers-shifts.html'
+ })
.otherwise({
action: 'home',
controller: 'DefaultCtrl',
@@ -69,7 +79,7 @@ NGApp.controller('AppController', function ($scope, $route, $http, $routeParams,
$rootScope.$on('userAuth', function(e, data) {
$rootScope.$safeApply(function($scope) {
App.snap.close();
- $rootScope.reload();
+ $rootScope.reload();
});
});
@@ -113,10 +123,13 @@ NGApp.controller('AppController', function ($scope, $route, $http, $routeParams,
this.$apply(fn);
}
};
+
+ $rootScope.hasBack = false;
$scope.$on('$routeChangeSuccess', function ($currentRoute, $previousRoute) {
// Store the actual page
MainNavigationService.page = $route.current.action;
+ console.log($route.current.action);
App.rootScope.current = MainNavigationService.page;
App.track('page', $route.current.action);
@@ -190,11 +203,12 @@ App.go = function( url, transition ){
}
};
-App.toggleMenu = function() {
- if (App.snap.state().state == 'left') {
+App.toggleMenu = function(side) {
+ side = side || 'left';
+ if (App.snap.state().state == side) {
App.snap.close();
} else {
- App.snap.open('left');
+ App.snap.open(side);
}
};
@@ -312,13 +326,13 @@ App.init = function(config) {
App.snap = new Snap({
element: document.getElementById('snap-content'),
- menu: document.getElementById('side-menu'),
+ menu: $('#side-menu, #side-menu-right'),
menuDragDistance: 95,
- disable: 'right'
+ disable: ''
});
var snapperCheck = function() {
- if ($(window).width() <= 768) {
+ if ($(window).width() <= 1024) {
App.snap.enable();
} else {
App.snap.close();
diff --git a/www/assets/cockpit/js/controllers.js b/www/assets/cockpit/js/controllers.js
index a48878e31..e83a9b99e 100644
--- a/www/assets/cockpit/js/controllers.js
+++ b/www/assets/cockpit/js/controllers.js
@@ -1,13 +1,17 @@
-NGApp.controller('DefaultCtrl', function ($scope, $http, $location) {
+NGApp.controller('DefaultCtrl', function ($scope, $http, $location, MainNavigationService, AccountService) {
+ if (AccountService.user.id_admin) {
+ MainNavigationService.link('/drivers/orders');
+ }
+});
+
+NGApp.controller('MainHeaderCtrl', function ( $scope, $rootScope) {
});
-NGApp.controller( 'MainHeaderCtrl', function ( $scope, $rootScope) {
-
-});
-
-NGApp.controller( 'SideMenuCtrl', function () {
-
+NGApp.controller('SideMenuCtrl', function ($scope) {
+ $scope.setupPermissions = function() {
+
+ }
});
NGApp.controller('LoginCtrl', function($scope, AccountService) {
@@ -18,4 +22,45 @@ NGApp.controller('LoginCtrl', function($scope, AccountService) {
// })
});
}
+});
+
+NGApp.controller('DriversOrderCtrl', function ($http, $scope, $rootScope) {
+
+});
+
+
+NGApp.controller('DriversOrdersCtrl', function ($http, $scope, $rootScope, DriverOrdersService) {
+
+ DriverOrdersService.loadOrders();
+
+ $scope.accept = function(id_order) {
+ $rootScope.makebusy();
+ $http.post(App.service + 'order/' + id_order + '/delivery-accept').success(function(json) {
+ if (json.status) {
+ $scope.loadOrders();
+ } else {
+ var name = json['delivery-status'].accepted.name ? ' by ' + json[ 'delivery-status' ].accepted.name : '';
+ App.alert('Ops, error!\n It seems this order was already accepted' + name + '!' );
+ $scope.loadOrders();
+ }
+ });
+ };
+
+ $scope.pickedup = function(id_order) {
+ $rootScope.makebusy();
+ $http.post(App.service + 'order/' + id_order + '/delivery-pickedup').success(function() {
+ $scope.loadOrders();
+ });
+ };
+
+ $scope.delivered = function(id_order) {
+ $rootScope.makebusy();
+ $http.post(App.service + 'order/' + id_order + '/delivery-delivered').success(function() {
+ $scope.loadOrders();
+ });
+ };
+});
+
+NGApp.controller('DriversShiftsCtrl', function ($http, $scope, $rootScope) {
+
});
\ No newline at end of file
diff --git a/www/assets/cockpit/js/service.account.js b/www/assets/cockpit/js/service.account.js
index 4dcadb986..cba242e72 100644
--- a/www/assets/cockpit/js/service.account.js
+++ b/www/assets/cockpit/js/service.account.js
@@ -1,5 +1,8 @@
NGApp.factory('AccountService', function($http, $rootScope) {
- var service = {};
+ var service = {
+ permissions: {},
+ user: null
+ };
service.checkUser = function() {
service.user = App.config.user;
@@ -29,6 +32,14 @@ NGApp.factory('AccountService', function($http, $rootScope) {
$rootScope.$broadcast('userAuth');
})
};
+
+ $rootScope.$on('userAuth', function(e, data) {
+ if (service.user.id_admin) {
+
+ } else {
+
+ }
+ });
return service;
});
\ No newline at end of file
diff --git a/www/assets/cockpit/js/service.driverorders.js b/www/assets/cockpit/js/service.driverorders.js
new file mode 100644
index 000000000..e8049d697
--- /dev/null
+++ b/www/assets/cockpit/js/service.driverorders.js
@@ -0,0 +1,58 @@
+NGApp.factory('DriverOrdersService', function($http, $rootScope) {
+ var service = {
+
+ };
+
+ service.loadOrders = function() {
+ $http.get(App.service + 'driverorders').success(function(orders) {
+ $rootScope.driverorders = orders;
+ var newDriverOrders = 0;
+ for (var x in orders) {
+ if (orders[x].lastStatus.status = 'new') {
+ newDriverOrders++;
+ }
+ }
+ console.log(newDriverOrders);
+ $rootScope.newDriverOrders = newDriverOrders;
+ });
+ };
+
+ service.checkUser = function() {
+ service.user = App.config.user;
+ App.config.user = null;
+ };
+
+ service.login = function(user, pass, callback) {
+ $http({
+ method: 'POST',
+ url: App.service + 'login',
+ data: $.param({'username': user, 'password': pass}),
+ headers: {'Content-Type': 'application/x-www-form-urlencoded'}
+ }).success(function(data) {
+ if (data && data.id_admin) {
+ service.user = data;
+ $rootScope.$broadcast('userAuth', service.user);
+ callback(true);
+ } else {
+ callback(false);
+ }
+ });
+ };
+
+ service.logout = function() {
+ $http.get(App.service + 'logout').success(function() {
+ service.user = {};
+ $rootScope.$broadcast('userAuth');
+ })
+ };
+
+ $rootScope.$on('userAuth', function(e, data) {
+ if (service.user.id_admin) {
+
+ } else {
+
+ }
+ });
+
+ return service;
+});
\ No newline at end of file
diff --git a/www/assets/cockpit/scss/cockpit.scss b/www/assets/cockpit/scss/cockpit.scss
index d88d1291f..52b6070ae 100644
--- a/www/assets/cockpit/scss/cockpit.scss
+++ b/www/assets/cockpit/scss/cockpit.scss
@@ -101,7 +101,6 @@ html {
.nav .content,
.content-padding {
/*max-width: 767px;*/
- max-width: 1024px;
margin: 0 auto;
}
}
@@ -135,11 +134,6 @@ html {
font-weight: bold;
}
-@media screen and (min-width: 769px) {
- .logo {
- text-align: left;
- }
-}
@media screen and (min-width: 1025px) {
.nav-back {
display: none;
@@ -235,7 +229,7 @@ p {
font-size: 12px;
}
.top-pad {
- height: 90px;
+ height: 67px;
}
}
@media(max-width:499px) {
@@ -249,11 +243,8 @@ p {
.nav-back {
margin: 3px 0 0 6px;
}
- .nav-cart {
- margin: 3px 10px 0 0;
- }
.top-pad {
- height: 71px;
+ height: 58px;
}
}
.divider {
@@ -266,18 +257,16 @@ p {
-
-
-
-
-/* SNAPS */
-@media(min-width:769px) {
- .snap-drawers {
- display:none;
- }
+.nav-top {
+ background: $navColor;
+ background: rgba($navColor, .97);
+ padding-top: 15px;
+ border-bottom: 1px solid rgba(darken($navColor, 50%), .97);
+ height: 4em;
}
-@media(max-width:768px) {
+
+@media(max-width:1024px) {
body {
position: fixed;
top: 0;
@@ -286,9 +275,6 @@ p {
left: 0;
overflow: hidden;
}
- .footer {
- display: none;
- }
.snap-content-inner {
position:absolute;
top:0;
@@ -339,11 +325,9 @@ p {
-ms-transition: width 0.3s ease;
-o-transition: width 0.3s ease;
transition: width 0.3s ease;
-
+
}
.snap-drawers {
- background: $sideBg;
- color:#eee;
position:absolute;
top:0;
right:0;
@@ -353,70 +337,121 @@ p {
height:auto;
overflow:hidden;
}
- .snap-drawer-left, .snap-drawer-right {
- left:0;
- z-index:1;
+}
+
+
+.snap-drawers {
+ background: $sideBg;
+ color:#eee;
+}
+
+.snap-drawer-left {
+ left:0;
+ z-index:1;
+}
+.snap-drawer-right {
+ right: 0;
+ z-index:1;
+}
+.snapjs-left .snap-drawer-right,
+.snapjs-right .snap-drawer-left {
+ display: none;
+}
+.snapjs-expand-left .snap-drawer-left,
+.snapjs-expand-right .snap-drawer-right {
+ width: 100%;
+}
+.snap-drawer ul {
+ padding:0;
+ margin:0;
+ list-style-type:none;
+}
+.snap-drawer li.nav-active .side-menu-wrap {
+ background: $green;
+ color: #fff;
+}
+.snap-drawer li {
+ display:block;
+ padding:8px 0 2px 0;
+ text-decoration:none;
+ color:$navLinkColor;
+ text-indent:10px;
+ cursor: pointer;
+}
+@-moz-document url-prefix() {
+ .snap-content {
+ transform:none;
}
- .snapjs-left .snap-drawer-right,
- .snapjs-right .snap-drawer-left {
+}
+.snap-drawer .fa {
+ font-size: 15px;
+}
+.side-menu-wrap {
+ height: 28px;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ width: 249px;
+ margin-left: 8px;
+}
+.side-menu-label {
+ vertical-align: top;
+ line-height: 1.6em;
+ font-size: 14px;
+ font-family: Ruda, Open Sans, Helvetica, Arial, sans-serif;
+}
+
+.side-menu-icon {
+ line-height: 2.2em;
+ width: 40px;
+ margin-left: -20px;
+}
+
+.side-menu-label, .side-menu-icon {
+ padding: 12px 0 10px 0;
+}
+
+
+
+/* SNAPS */
+@media(min-width:1025px) {
+ .wrapper {
+ float: left;
+ }
+ #side-menu-right {
display: none;
}
- .snapjs-expand-left .snap-drawer-left,
- .snapjs-expand-right .snap-drawer-right {
- width: 100%;
- }
- .snap-drawer ul {
- padding:0;
- margin:0;
- list-style-type:none;
- }
- .snap-drawer li:first-child {
- border-top:1px solid rgba(0,0,0,0.1);
- }
- .snap-drawer li {
- display:block;
- border-bottom:1px solid rgba(0,0,0,0.1);
- padding:8px 0 2px 0;
- text-decoration:none;
- color:$navLinkColor;
- text-indent:20px;
- cursor: pointer;
- }
- .snap-drawer li.nav-active:before {
- display: block;
- height: 38px;
+ .snap-drawers {
+ width: 225px;
float: left;
- margin-top: -8px;
- width: 4px;
- content: " ";
- background: #f78155;
+ height: 100%;
+ bottom: 0;
+ top: 0;
position: absolute;
}
- .snap-drawer p {
- opacity:0.5;
- padding:15px;
- font-size:12px;
+ .snap-content-inner {
+ margin-left: 235px;
+ margin-right: 10px;
}
- @-moz-document url-prefix() {
- .snap-content {
- transform:none;
- }
+ .snap-drawer-left {
+ margin-top: 65px;
+ -webkit-transform: translateX(0) !important;
}
- .snap-drawer .fa {
- font-size:25px;
+ .nav-top {
+ background: #22242a;
+ border-bottom: none;
}
.side-menu-wrap {
- height: 28px;
+ width: 208px;
}
- .side-menu-wrap {
- margin-left: -20px;
+ .menu {
+ display: none;
}
- .side-menu-label {
- margin-top: -10px;
- vertical-align: top;
- line-height: 1.6em;
- margin-bottom: 20px;
- font-size: 14px;
+ .nav-top .logo {
+ margin-left: 10px;
+ }
+ .logo {
+ text-align: left;
}
}
@@ -443,22 +478,11 @@ p {
height: 1px;
}
-.side-menu-icon {
- width: 70px;
-}
.no-init .hide-before-init {
display: none !important;
}
-.nav-top {
- background: $navColor;
- background: rgba($navColor, .97);
- padding-top: 15px;
- border-bottom: 1px solid rgba(darken($navColor, 50%), .97);
- height: 4em;
-}
-
.login-wrap {
background: $navColor;
position: fixed;
@@ -619,7 +643,7 @@ input {
margin-bottom: 1em;
border-radius: 4px;
font-size: 1.2em;
- line-height: 1.4em;
+ line-height: 1.45em;
padding: .7em .9em .5em .9em;
}
@@ -630,3 +654,44 @@ input {
.dialog-message-success {
background: #77c675;
}
+
+
+.notifications {
+ float: right;
+ margin: 2px 10px 0 0;
+}
+
+.notifications .notification {
+ border: 1px solid #666666;
+ border-radius: 4px;
+ height: 27px;
+ width: 27px;
+ color: #666666;
+ font-size: 16px;
+ overflow: hidden;
+ line-height: 1.7em;
+ text-align: center;
+ float: left;
+ margin-right: 9px;
+ cursor: pointer;
+}
+
+.notifications .notification:last-child {
+ margin-right: 1px;
+}
+
+.notification .badge {
+ background: #fe4e7f;
+ border-radius: 14px;
+ height: 16px;
+ width: 16px;
+ font-size: 10px;
+ position: absolute;
+ margin-top: -6px;
+ margin-left: 17px;
+ color: #fff;
+ line-height: 17px;
+ font-family: Ruda, Helvetica, Arial, sans-serif;
+ font-weight: 900;
+ overflow: hidden;
+}
\ No newline at end of file
diff --git a/www/assets/js/app.js b/www/assets/js/app.js
index bcbdcd64b..59524e6bc 100644
--- a/www/assets/js/app.js
+++ b/www/assets/js/app.js
@@ -736,7 +736,7 @@ App.init = function(config) {
App.snap = new Snap({
element: document.getElementById('snap-content'),
- menu: document.getElementById('side-menu'),
+ menu: $('#side-menu'),
menuDragDistance: 95,
disable: 'right'
});
diff --git a/www/assets/js/snap.js b/www/assets/js/snap.js
index 2958b3c09..6c922e6d6 100644
--- a/www/assets/js/snap.js
+++ b/www/assets/js/snap.js
@@ -186,7 +186,9 @@
settings.element.style[cache.vendor+'Transition'] = '';
// paralax menu
if (settings.menu) {
- settings.menu.style[cache.vendor+'Transition'] = '';
+ settings.menu.each(function() {
+ this.style[cache.vendor+'Transition'] = '';
+ });
}
cache.translation = action.translate.get.matrix(4);
@@ -214,7 +216,9 @@
// paralax menu
if (settings.menu) {
- settings.menu.style[cache.vendor+'Transition'] = 'all ' + settings.transitionSpeed + 's ' + settings.easing;
+ settings.menu.each(function() {
+ this.style[cache.vendor+'Transition'] = 'all ' + settings.transitionSpeed + 's ' + settings.easing;
+ });
}
cache.animatingInterval = setInterval(function() {
@@ -262,10 +266,24 @@
// paralax menu
if (settings.menu) {
- var hideDistance = settings.menuDragDistance;
- var nn = ((n / settings.maxPosition) * hideDistance) - hideDistance;
- var theSideTranslate = 'translate3d(' + nn + 'px, 0,0)';
- settings.menu.style[cache.vendor+'Transform'] = theSideTranslate;
+ var getTranslate = function(dir) {
+ var hideDistance = settings.menuDragDistance;
+ if (dir == 'left') {
+ var dirDistance = -hideDistance;
+ } else {
+ var dirDistance = hideDistance;
+ }
+ var nn = ((n / settings.maxPosition) * hideDistance) + dirDistance;
+ var theSideTranslate = 'translate3d(' + nn + 'px, 0,0)';
+ return theSideTranslate;
+ };
+ if (settings.menu.get(0)) {
+ settings.menu.get(0).style[cache.vendor+'Transform'] = getTranslate('left');
+ }
+ if (settings.menu.get(1)) {
+ settings.menu.get(1).style[cache.vendor+'Transform'] = getTranslate('right');
+ }
+
}
} else {
@@ -321,7 +339,9 @@
utils.dispatchEvent('start');
settings.element.style[cache.vendor+'Transition'] = '';
if (settings.menu) {
- settings.menu.style[cache.vendor+'Transition'] = '';
+ settings.menu.each(function() {
+ this.style[cache.vendor+'Transition'] = '';
+ });
}
cache.isDragging = true;
cache.hasIntent = null;