diff --git a/api.php b/api.php
index 6769ca87..fe387709 100644
--- a/api.php
+++ b/api.php
@@ -81,9 +81,6 @@
Utils::validateAPIKey();
checkRemovableProjects();
break;
- case 'setFavorite':
- setFavorite();
- break;
case 'getBonusHistory':
getBonusHistory();
break;
@@ -625,58 +622,6 @@ function dump_row_values($row) {
return $dump;
}
-function setFavorite() {
- if ( !isset($_REQUEST['favorite_user_id']) ||
- !isset($_REQUEST['newVal']) ) {
- echo json_encode(array( 'error' => "Invalid parameters!"));
- }
- $userId = Session::uid();
- if ($userId > 0) {
- Utils::initUserById($userId);
- $user = new User();
- $user->findUserById( $userId );
-
- $favorite_user_id = (int) $_REQUEST['favorite_user_id'];
- $newVal = (int) $_REQUEST['newVal'];
- $users_favorites = new Users_Favorite();
- $res = $users_favorites->setMyFavoriteForUser($userId, $favorite_user_id, $newVal);
- if ($res == "") {
- // send chat if user has been marked a favorite
- $favorite_user = new User();
- $favorite_user->findUserById($favorite_user_id);
- if ($newVal == 1) {
-
- $resetUrl = SECURE_SERVER_URL . 'user/' . $favorite_user_id ;
- $resetUrl = '' . $resetUrl . '';
- $data = array();
- $data['link'] = $resetUrl;
- $nick = $favorite_user->getNickname();
- if (! Utils::sendTemplateEmail($favorite_user->getUsername(), 'trusted', $data)) {
- error_log("setFavorite: Utils::send_email failed on favorite notification");
- }
-
- // get favourite count
- $count = $users_favorites->getUserFavoriteCount($favorite_user_id);
- if ($count > 0) {
- if ($count == 1) {
- $message = "**{$count}** person";
- } else {
- $message = "**{$count}** people";
- }
- $journal_message = '@' . $nick . ' is now trusted by ' . $message . '!';
- //sending journal notification
- Utils::systemNotification(stripslashes($journal_message));
- }
- }
- echo json_encode(array( 'return' => "Trusted saved."));
- } else {
- echo json_encode(array( 'error' => $res));
- }
- } else {
- echo json_encode(array( 'error' => "You must be logged in!"));
- }
-}
-
function getBonusHistory() {
checkLogin();
@@ -820,7 +765,7 @@ function getUserList() {
$limit = 30;
$page = isset($_REQUEST["page"])?intval($_REQUEST["page"]) : 1;
$letter = isset($_REQUEST["letter"]) ? mysql_real_escape_string(trim($_REQUEST["letter"])) : "";
- $order = !empty($_REQUEST["order"]) ? mysql_real_escape_string(trim($_REQUEST["order"])) : "earnings30";
+ $order = !empty($_REQUEST["order"]) ? mysql_real_escape_string(trim($_REQUEST["order"])) : "jobs_count";
$order_dir = isset($_REQUEST["order_dir"]) ? mysql_real_escape_string(trim($_REQUEST["order_dir"])) : "DESC";
$active = isset( $_REQUEST['active'] ) && $_REQUEST['active'] == 'TRUE' ? 'TRUE' : 'FALSE';
$myfavorite = isset( $_REQUEST['myfavorite'] ) && $_REQUEST['myfavorite'] == 'TRUE' ? 'TRUE' : 'FALSE';
@@ -861,32 +806,20 @@ function getUserList() {
if( $active == 'FALSE' ) {
$query = "
SELECT `id`, `nickname`,`added` AS `joined`, `budget`,
- IFNULL(`creators`.`count`,0) + IFNULL(`mechanics`.`count`,0) AS `jobs_count`,
- IFNULL(`earnings`.`sum`,0) AS `earnings`,
- IFNULL(`earnings30`.`sum`,0) AS `earnings30`,
- IFNULL(`rewarder`.`sum`,0)AS `rewarder`
+ IFNULL(`creators`.`count`,0) + IFNULL(`mechanics`.`count`,0) AS `jobs_count`
FROM `".USERS."`
LEFT JOIN (SELECT `mechanic_id`, COUNT(`mechanic_id`) AS `count` FROM `" . WORKLIST . "` WHERE (`status` IN ('In Progress', 'QA Ready', 'Review', 'Merged', 'Done')) GROUP BY `mechanic_id`) AS `mechanics` ON `".USERS."`.`id` = `mechanics`.`mechanic_id`
LEFT JOIN (SELECT `creator_id`, COUNT(`creator_id`) AS `count` FROM `" . WORKLIST . "` WHERE (`status` IN ('In Progress', 'QA Ready', 'Review', 'Merged', 'Done')) AND `creator_id` != `mechanic_id` GROUP BY `creator_id`) AS `creators` ON `".USERS."`.`id` = `creators`.`creator_id`
- LEFT JOIN (SELECT `user_id`, SUM(amount) AS `sum` FROM `".FEES."` WHERE $sfilter AND `paid` = 1 AND `withdrawn`=0 AND (`rewarder`=1 OR `bonus`=1) GROUP BY `user_id`) AS `rewarder` ON `".USERS."`.`id` = `rewarder`.`user_id`
- LEFT JOIN (SELECT `user_id`, SUM(amount) AS `sum` FROM `".FEES."` WHERE $sfilter AND `withdrawn`=0 AND `expense`=0 AND `paid` = 1 AND `paid_date` IS NOT NULL GROUP BY `user_id`) AS `earnings` ON `".USERS."`.`id` = `earnings`.`user_id`
- LEFT JOIN (SELECT `user_id`, SUM(amount) AS `sum` FROM `".FEES."` WHERE `withdrawn`=0 AND `paid` = 1 AND `paid_date` IS NOT NULL AND `paid_date` > DATE_SUB(NOW(), INTERVAL 30 DAY) AND `expense`=0 GROUP BY `user_id`) AS `earnings30` ON `".USERS."`.`id` = `earnings30`.`user_id`
LEFT JOIN (SELECT `user_id`, SUM(amount) AS `sum` FROM `".FEES."` WHERE ($sfilter AND `withdrawn`=0 AND `paid` = 1) AND `expense`=1 GROUP BY `user_id`) AS `expenses_billed` ON `".USERS."`.`id` = `expenses_billed`.`user_id`
WHERE `nickname` REGEXP '^$letter' AND `is_active` = 1 $myfavorite_cond ORDER BY `$order` $order_dir LIMIT " . ($page-1)*$limit . ",$limit";
} else if( $active == 'TRUE' ) {
$query = "
SELECT `id`, `nickname`,`added` AS `joined`, `budget`,
- IFNULL(`creators`.`count`,0) + IFNULL(`mechanics`.`count`,0) AS `jobs_count`,
- IFNULL(`earnings`.`sum`,0) AS `earnings`,
- IFNULL(`earnings30`.`sum`,0) AS `earnings30`,
- IFNULL(`rewarder`.`sum`,0)AS `rewarder`
+ IFNULL(`creators`.`count`,0) + IFNULL(`mechanics`.`count`,0) AS `jobs_count`
FROM `".USERS."`
LEFT JOIN (SELECT `user_id`,MAX(`date`) AS `date` FROM `".FEES."` WHERE `paid` = 1 AND `amount` != 0 AND `withdrawn` = 0 AND `expense` = 0 GROUP BY `user_id`) AS `dates` ON `".USERS."`.id = `dates`.user_id
LEFT JOIN (SELECT `mechanic_id`, COUNT(`mechanic_id`) AS `count` FROM `" . WORKLIST . "` WHERE (`status` IN ('In Progress', 'QA Ready', 'Review', 'Merged', 'Done')) GROUP BY `mechanic_id`) AS `mechanics` ON `".USERS."`.`id` = `mechanics`.`mechanic_id`
LEFT JOIN (SELECT `creator_id`, COUNT(`creator_id`) AS `count` FROM `" . WORKLIST . "` WHERE (`status` IN ('In Progress', 'QA Ready', 'Review', 'Merged', 'Done')) AND `creator_id` != `mechanic_id` GROUP BY `creator_id`) AS `creators` ON `".USERS."`.`id` = `creators`.`creator_id`
- LEFT JOIN (SELECT `user_id`, SUM(amount) AS `sum` FROM `".FEES."` WHERE $sfilter AND `paid` = 1 AND `withdrawn`=0 AND (`rewarder`=1 OR `bonus`= 1) GROUP BY `user_id`) AS `rewarder` ON `".USERS."`.`id` = `rewarder`.`user_id`
- LEFT JOIN (SELECT `user_id`, SUM(amount) AS `sum` FROM `".FEES."` WHERE $sfilter AND `withdrawn`=0 AND `expense`=0 AND `paid` = 1 AND `paid_date` IS NOT NULL GROUP BY `user_id`) AS `earnings` ON `".USERS."`.`id` = `earnings`.`user_id`
- LEFT JOIN (SELECT `user_id`, SUM(amount) AS `sum` FROM `".FEES."` WHERE `withdrawn`=0 AND `paid` = 1 AND `paid_date` IS NOT NULL AND `paid_date` > DATE_SUB(NOW(), INTERVAL 30 DAY) AND `expense`=0 GROUP BY `user_id`) AS `earnings30` ON `".USERS."`.`id` = `earnings30`.`user_id`
LEFT JOIN (SELECT `user_id`, SUM(amount) AS `sum` FROM `".FEES."` WHERE ($sfilter AND `withdrawn`=0 AND `paid` = 1) AND `expense`=1 GROUP BY `user_id`) AS `expenses_billed` ON `".USERS."`.`id` = `expenses_billed`.`user_id`
WHERE `date` > DATE_SUB(NOW(), INTERVAL $sfilter DAY) AND `nickname` REGEXP '^$letter' AND `is_active` = 1 $myfavorite_cond ORDER BY `$order` $order_dir LIMIT " . ($page-1)*$limit . ",$limit";
}
diff --git a/controllers/User.php b/controllers/User.php
index ec67fc21..ca8780cf 100644
--- a/controllers/User.php
+++ b/controllers/User.php
@@ -567,55 +567,6 @@ public function budgetHistory($id, $page = 1, $itemsPerPage = 10) {
echo json_encode($user->budgetHistory($giver_id, $page, $itemsPerPage));
}
- public function loves($id, $page = 1, $itemsPerPage = 5) {
- $this->view = null;
- $user = User::find($id);
- $page = (is_numeric($page) ? $page : 1);
- $itemsPerPage = (is_numeric($itemsPerPage) ? $itemsPerPage : 5);
- echo json_encode($user->loves($page, $itemsPerPage));
- }
-
- public function sendLove($to) {
- $this->view = null;
- try {
- if (!Session::uid()) {
- throw new Exception('Must be logged in to Send Love!');
- }
- $from = User::find(Session::uid());
-
- $to = User::find($to);
- if (!$to->getId()) {
- throw new Exception('Not a valid user');
- }
-
- $love_message = $_POST['love_message'];
- if (empty($love_message)) {
- throw new Exception('Message field is mandatory');
- }
-
- if (!$from->sendLove($to, $love_message)) {
- throw new Exception('Could not send love');
- }
-
- $from_nickname = $from->getNickname();
- $message = $_POST['love_message'];
- Utils::sendTemplateEmail($to->getUsername(), 'love-received', array(
- 'from_nickname'=> $from_nickname,
- 'message' => $message
- ));
-
- echo json_encode(array(
- 'success' => true,
- 'message' => 'Love sent'
- ));
- } catch (Exception $e) {
- echo json_encode(array(
- 'success' => false,
- 'message' => $e->getMessage()
- ));
- }
- }
-
public function isUSCitizen($id) {
$this->view = null;
try {
diff --git a/css/favorites.css b/css/favorites.css
deleted file mode 100644
index fa7d19f4..00000000
--- a/css/favorites.css
+++ /dev/null
@@ -1,72 +0,0 @@
-.favoriteIcon.favorite0 {
- display: none;
-}
-
-/**
- * Favorite star inside the mission list
- */
-.table-missions .favoriteIcon {
- height: 12px;
- width: 12px;
- vertical-align: middle;
-}
-
-.favorite_count.favorited {
- background-position: 132px 0 !important;
-}
-
-.favorite_count.favorited:hover {
- background-position: 0 0 !important;
-}
-
-.favorite_count.notfavorited:hover {
- background-position: 88px 0 !important;
-}
-
-.favorite_user.favorited {
- background-image: url('../images/wl-icons/star-dark.png');
- background-image: url('../images/wl-icons/star-dark.svg');
- background-repeat: no-repeat;
-}
-
-.favorite_user.myfavorite {
- background-image: url('../images/wl-icons/star-dark.png');
- background-image: url('../images/wl-icons/star-dark.svg');
- background-repeat: no-repeat;
-}
-
-.favorite_user.favorited:hover {
- background-image: url('../images/wl-icons/star-remove.png');
- background-image: url('../images/wl-icons/star-remove.svg');
- background-repeat: no-repeat;
-}
-
-.favorite_user.myfavorite:hover {
- background-image: url('../images/wl-icons/star-remove.png');
- background-image: url('../images/wl-icons/star-remove.svg');
- background-repeat: no-repeat;
-}
-
-.favorite_user.notfavorited:hover {
- background-image: url('../images/wl-icons/star-add.png');
- background-image: url('../images/wl-icons/star-add.svg');
- background-repeat: no-repeat;
-}
-
-.favorite_user.notmyfavorite:hover {
- background-image: url('../images/wl-icons/star-add.png');
- background-image: url('../images/wl-icons/star-add.svg');
- background-repeat: no-repeat;
-}
-
-.favorite_user.notmyfavorite {
- background-image: url('../images/wl-icons/star.png');
- background-image: url('../images/wl-icons/star.svg');
- background-repeat: no-repeat;
-}
-
-.favorite_user.notfavorited {
- background-image: url('../images/wl-icons/star.png');
- background-image: url('../images/wl-icons/star.svg');
- background-repeat: no-repeat;
-}
\ No newline at end of file
diff --git a/css/userinfo.css b/css/userinfo.css
index 0de1d0e1..f80c74c8 100644
--- a/css/userinfo.css
+++ b/css/userinfo.css
@@ -179,7 +179,7 @@ body > .container-fluid h3 {
font-size: 14px;
margin-top: 21px;
line-height: 17px;
- padding-bottom: 12px;
+ padding-bottom: 12px;
}
#globalinfo > div > .info-label:first-child a,
@@ -267,84 +267,6 @@ p.bottom {
top: 6em;
}
-#love input {
- background: none;
- padding-left: 160px;
- padding-right: 0;
- width: auto;
- font-size: 12px !important;
- font-weight: normal !important;
- color: #88AAB0 !important;
- border: 0 none;
- position: relative;
- top: 2px;
-}
-
-.loveTitle {
- border-bottom: 2px solid #E1E8EA;
- padding-bottom: 6px;
- width: 415px !important;
-}
-
-.loveTitle a {
- padding-left: 26px;
-}
-
-#user-loves {
- padding: .5em 0 .5em;
- color: #6E6E6E;
-}
-
-#user-loves > * {
- display: inline;
- line-height: 110%;
- font-size: 1em;
-}
-
-#user-loves cite:before {
- content: '\201c';
-}
-
-#user-loves cite:after {
- content: '\201d';
-}
-
-#user-loves h6 {
- margin-top: .4em;
- margin-bottom: .2em;
-}
-
-#user-loves h6,
-#user-loves h6 a {
- color: #8B8B8B;
-}
-
-#user-loves h6 span {
- color: #999;
-}
-
-#user-loves h6 a {
- text-decoration: underline;
-}
-
-#user-loves h6:after {
- content: '';
- display: block;
- padding-bottom: 10px;
-}
-
-#user-loves h6:before {
- padding-right: 60px;
-}
-#user-loves + a {
- font-size: 12px;
- font-weight: normal;
- top: 10px;
- padding-bottom: 20px;
- position: relative;
- color: #8B8B8B;
-}
-
.reviewTitle {
font-weight: normal !important;
padding-left: 0 !important;
@@ -477,14 +399,14 @@ p.bottom {
.userName {
color: #007F7C;
font-size: 28px;
- line-height: 60px;
+ line-height: 30px;
vertical-align: top;
padding: 6px 11px;
width: 293px;
font-family:Helvetica Neue, Helvetica, Arial, sans-serif;
font-weight: bold;
display: inline-block;
- margin-bottom: 45px;
+ margin-top: 58px;
white-space: nowrap;
}
@@ -511,41 +433,15 @@ p.bottom {
line-height: 22px;
vertical-align: top;
padding: 6px 0;
- border-bottom: 2px solid #E1E8EA;
- border-top: 2px solid #e1e8ea;
width: 100%;
font-weight: bold;
+ margin-top: 69px;
}
.profileContactFavorite span{
font-weight: normal;
}
-.profileContactFavorite,
-.profileInfoFavorite {
- margin-top: 61px;
-}
-
-.profileInfoFavorite {
- color: #666;
- font-size: 12px;
- line-height: 22px;
- vertical-align: top;
- padding: 6px 11px;
- border-bottom: 2px solid #E1E8EA;
- border-top: 2px solid #e1e8ea;
- width: 310px;
- font-weight: bold;
- display: inline-block;
- position: absolute;
- top: 0px;
- right: 0px;
-}
-
-.profileInfoFavorite>img {
- vertical-align: middle;
-}
-
.favorite_user,
.favorite_curr_user {
height: 20px;
@@ -729,11 +625,11 @@ form#roles ul li {
margin: 0;
}
- #jobs-table tr > td:first-child, #loves-table tr > td:first-child {
+ #jobs-table tr > td:first-child {
max-width: 125px;
}
form#roles ul li {
display: block;
}
-}
\ No newline at end of file
+}
diff --git a/js/favorites.js b/js/favorites.js
deleted file mode 100644
index 949daf46..00000000
--- a/js/favorites.js
+++ /dev/null
@@ -1,118 +0,0 @@
-var WLFavorites = {
- favMissionText: null,
- init: function(containerID, favorite_user_id, fav_user_nickname) {
- $('.favorite_user, .favorite_count', $("#" + containerID)).click(function(){
- var newVal = ($(this).hasClass("myfavorite")) ? 0 : 1;
- WLFavorites.setFavorite(favorite_user_id, newVal, containerID, null, fav_user_nickname);
- });
-
- var favCount = $('.profileFavoriteText').attr('data-favorite-count');
- var isMyFav = false;
- if ($('.favorite_user').hasClass('myfavorite')) {
- isMyFav = true;
- }
-
- var favText = WLFavorites.getFavoriteText(favCount, isMyFav, 'Trusted ');
-
- $('.profileFavoriteText').html(favText);
- },
- setFavorite: function( favorite_user_id, newVal, containerID, fAfter, fav_user_nickname ) {
- /*
- * remove the .favorite_count
- */
- $.ajax({
- type: 'POST',
- url: 'api.php',
- data: {
- action: 'setFavorite',
- favorite_user_id: favorite_user_id,
- newVal: newVal
- },
- dataType: 'json',
- success: function(json) {
- if ((json === null) || (json.error)) {
- var message="Error returned - f1. ";
- if (json !== null) {
- message = message + json.error;
- }
- alert(message);
- return;
- }
- var fav = parseInt($('.profileFavoriteText').attr('data-favorite-count'));
- if (newVal == 1) {
- $('.profileFavoriteText').attr('data-favorite-count', fav + 1);
- var favText = WLFavorites.getFavoriteText(fav + 1, true, 'Trusted ');
- $('.profileFavoriteText').html(favText);
- $(".favorite_user, .favorite_count")
- .removeClass("notmyfavorite")
- .addClass("myfavorite")
- .attr("title", "Remove " + fav_user_nickname + " from your trusted by. (don't worry it's anonymous)");
- } else {
- $('.profileFavoriteText').attr('data-favorite-count', fav - 1);
- var favText = WLFavorites.getFavoriteText(fav - 1, false, 'Trusted ');
- $('.profileFavoriteText').html(favText);
- $(".favorite_user, .favorite_count")
- .removeClass("myfavorite")
- .addClass("notmyfavorite")
- .attr("title", "Add " + fav_user_nickname + " as one of your trusted people.");
-
- }
- if (fAfter) {
- fAfter(true);
- }
- }
-
- });
- },
- getFavoriteIcon: function(favoriteEnabled, objectId, type) {
- if (type == 'mission') {
- toggleClass = 'favoriteMissionIconFor' + objectId;
- } else {
- toggleClass = 'favoriteIconFor' + objectId;
- }
- var imageFavorite = '',
- imageFavoriteClass = 'favorite0',
- imageFavoritePath = 'images/white_star.png';
- if (favoriteEnabled == 1) {
- imageFavoriteClass = 'favorite1';
- if (type == 'userlist') {
- imageFavoritePath = 'images/peopleFavorite.png';
- } else {
- imageFavoritePath = 'images/yellow_star.png';
- }
- }
- imageFavorite = '';
- return imageFavorite;
- },
- // function that returns the appropriate favorite text for users
- // and for missions. Takes the number of favorites and a boolean for
- // that a true if the user/mission is a favorite of the currently
- // logged in user.
- getFavoriteText: function(favCount, isMyFav, favText) {
- favText = typeof(favText) != 'undefined' ? favText : '';
-
- var pluralize = 'people';
- if (favCount == 1) {
- pluralize = 'person';
- }
-
- // if there are no favorites
- if (favCount == 0) {
- favText += 'by no one... for now!';
- } else if (isMyFav) {
- if (favCount == 1) {
- favText += 'by you';
- } else /* if the user is not the only user to favorite */ {
- if (favCount == 2) {
- pluralize = 'person';
- }
- favText += 'by ' + favCount
- + ' ' + pluralize + ' (including you)';
- }
- } else /*if the user has not favorited the mission */ {
- favText += 'by ' + favCount + ' ' + pluralize;
- }
-
- return favText;
- }
-};
diff --git a/js/newworklist.js b/js/newworklist.js
index f464c348..95a3fd17 100644
--- a/js/newworklist.js
+++ b/js/newworklist.js
@@ -21,7 +21,6 @@ var NewWorklist = {
});
$('a[href^="./github/login"]').click(NewWorklist.loginClick);
- $('.send_love').click(NewWorklist.sendLoveClick);
/**
* Initialize js objects used by worklist
@@ -76,37 +75,6 @@ var NewWorklist = {
}
},
- sendLoveClick: function() {
- var to_user = $(this).attr('user') ? $(this).attr('user') : 0;
- Utils.modal('send-love', {
- open: function(modal) {
- $('input[name="to"]', modal).autocomplete({source: autocompleteUserSource});
- if (to_user) {
- $('input[name="to"]', modal).val(to_user);
- }
- //$('input[name="to"]', modal).autocomplete({source: autocompleteUserSource});
- $('form', modal).submit(function() {
- $.ajax({
- url: './user/sendLove/' + $('input[name="to"]', modal).val(),
- data: {
- love_message: $('textarea[name="love_message"]', modal).val()
- },
- dataType: 'json',
- type: "POST",
- cache: false,
- success: function(json) {
- if (json.success) {
- $(modal).modal('hide');
- }
- }
- });
- return false;
- });
- }
- });
- return false;
- },
-
initJobSearch: function() {
$('#search-query input[type="text"]').keypress(function(event) {
if ($.trim($(this).val()).length > 0 && event.keyCode == '13' && typeof jobs == 'undefined') {
diff --git a/js/team.js b/js/team.js
index 0d9e8341..0cc2300c 100644
--- a/js/team.js
+++ b/js/team.js
@@ -1,5 +1,5 @@
var current_letter = 'all';
-var current_sortkey = 'earnings30';
+var current_sortkey = 'jobs_count';
var current_order = false;
var sfilter = '30'; // Default value for the filter
var show_actives = "FALSE";
@@ -224,9 +224,6 @@ function AppendUserRow(json, odd) {
row += '
Your message has been sent.
"; - + Utils.emptyModal({ content: success_msg, buttons: [ @@ -169,14 +156,14 @@ var UserInfo = { } $('#ping-msg').val(""); $('#send-ping-btn').removeAttr("disabled"); - }, + }, error: function() { $('#send-ping-btn').removeAttr("disabled"); } }); return false; }); - + $('.reviewAddLink').click(UserInfo.reviewDialog); $('#give').click(function(){ @@ -263,7 +250,7 @@ var UserInfo = { }); return false; }); - + $('#budgetHistory').click(function(){ Budget.showBudgetHistory(1, userInfo.user_id); return false; @@ -271,19 +258,19 @@ var UserInfo = { $('#create_sandbox').click(function(){ var projects = ''; - + // get project ids that are newly checked - setup to allow adding // projects to sandbox that is already created, sandbox bash // script needs updating to support this $('#sandboxForm input[type=checkbox]:checked').not(':disabled').each(function() { if ($(this).prop('checked') && !$(this).prop('disabled')) { projects += $(this).next('.repo').val() + ','; - } + } }); - + if (projects != '') { // remove the last comma - projects = projects.slice(0, -1) + projects = projects.slice(0, -1) $.ajax({ type: "POST", url: './user/' + userInfo.user_id, @@ -305,13 +292,13 @@ var UserInfo = { } else { alert('You did not choose any projects to check out.'); } - + return false; }); $('#budget-source-combo-bonus').chosen({width: 'auto'}); var bonus_amount; - + $('#pay_bonus').click(function(e) { Utils.modal('paybonus', { open: function(modal) { @@ -394,7 +381,7 @@ var UserInfo = { clearStyle: true, collapsible: true, active: true, - create: function(event, ui) { + create: function(event, ui) { var workersIntervalId = setInterval(function() { if($("#runner-workers tr").length) { $('#runner-workers').paginate(limitPerPage, 500); @@ -408,8 +395,8 @@ var UserInfo = { } }, 2000); } - }); - + }); + if (! is_payer) { $('#ispaypalverified').prop('disabled', true); $('#isw9approved').prop('disabled', true); @@ -471,7 +458,6 @@ var UserInfo = { $('#profile-nav a[href="#' + tab + '"]').click(); } - $('#user-loves + a').click(UserInfo.displayAllLove); }, setW9Status: function(status, reason, fAfter) { @@ -492,7 +478,7 @@ var UserInfo = { appendPagination: function(page, cPages, table) { var cspan = '4' - var pagination = '