Skip to content

Commit

Permalink
Fixes #16
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed May 10, 2017
1 parent ed4c9e5 commit 9c2662d
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 40 deletions.
2 changes: 1 addition & 1 deletion public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -6185,7 +6185,7 @@ a.waves-effect .waves-ripple {
right: 0;
height: 100%;
width: 100%;
z-index: 999; }
z-index: 99; }
.card-spinner .spinner {
width: 40px;
height: 40px;
Expand Down
2 changes: 1 addition & 1 deletion public/css/app.min.css

Large diffs are not rendered by default.

35 changes: 22 additions & 13 deletions src/public/js/angularjs/controllers/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,28 @@ define(['angular', 'underscore', 'jquery', 'modules/helpers', 'uikit', 'history'
var groupID = self.attr('data-group-id');
var card = self.parents('.tru-card-wrapper');
if (groupID) {
$http.delete(
'/api/v1/groups/' + groupID
)
.success(function(data) {
helpers.UI.showSnackbar('Group Successfully Deleted', false);

card.remove();
UIkit.$html.trigger('changed.uk.dom');
})
.error(function(err) {
$log.log('[trudesk:groups:deleteGroup] - Error: ' + err.error);
helpers.UI.showSnackbar(err.error, true);
});
UIkit.modal.confirm(
'Are you sure you want to delete group: <strong>' + card.find('h3').attr('data-group-name') + '</strong>'
, function() {
helpers.showLoader(0.8);
$http.delete(
'/api/v1/groups/' + groupID
)
.success(function() {
helpers.hideLoader();
helpers.UI.showSnackbar('Group Successfully Deleted', false);

card.remove();
UIkit.$html.trigger('changed.uk.dom');
})
.error(function(err) {
helpers.hideLoader();
$log.log('[trudesk:groups:deleteGroup] - Error: ' + err.error);
helpers.UI.showSnackbar(err.error, true);
});
}, {
labels: {'Ok': 'Yes', 'Cancel': 'No'}, confirmButtonClass: 'md-btn-danger'
});
}
};

Expand Down
9 changes: 9 additions & 0 deletions src/public/js/modules/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,15 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, Snackbar, ROLES) {
});
};

helpers.showLoader = function(opacity) {
if (_.isUndefined(opacity) || _.isNull(opacity))
opacity = 1;

var $loader = $('#loader-wrapper');
$loader.css({opacity: 0, display: 'block'});
$loader.animate({'opacity': opacity}, 500);
};

helpers.ajaxFormSubmit = function() {
// Bind to forms
$('form.ajaxSubmit').each(function() {
Expand Down
12 changes: 6 additions & 6 deletions src/public/js/modules/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ define('modules/tour', [
});


tour.addStep('profileButton', {
title: 'Profile',
text: 'Clicking your profile picture will open up your profile dropdown.',
attachTo: 'img#profileImage bottom'
});
// tour.addStep('profileButton', {
// title: 'Profile',
// text: 'Clicking your profile picture will open up your profile dropdown.',
// attachTo: 'img#profileImage bottom'
// });

tour.addStep('sidebar_tickets', {
title: 'Tickets',
Expand Down Expand Up @@ -258,7 +258,7 @@ define('modules/tour', [


tour.on('complete', function() {
console.log('Tour Done!');

});


Expand Down
7 changes: 4 additions & 3 deletions src/public/js/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ define('pages/dashboard', [
};

var showOverdue = $('#__showOverdueTickets').text().toLowerCase() === 'true';
console.log(showOverdue);
if (showOverdue) {
var overdueCard = $('#overdue_tickets');
var $overdue_table_body = overdueCard.find('table.uk-table > tbody');
$overdue_table_body.empty(); // Clear
$.ajax({
url: '/api/v1/tickets/overdue',
method: 'GET',
success: function(_data) {
var overdueCard = $('#overdue_tickets');
var overdueSpinner = overdueCard.find('.card-spinner');
var html = '';
_.each(_data.tickets, function(ticket) {
Expand All @@ -71,7 +72,7 @@ define('pages/dashboard', [
html += '</tr>';
});

overdueCard.find('table.uk-table > tbody').append(html);
$overdue_table_body.append(html);

overdueSpinner.animate({opacity: 0}, 600, function() {
$(this).hide();
Expand Down
2 changes: 1 addition & 1 deletion src/public/js/pages/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ define('pages/messages', [
labels: {
'Ok': 'YES'
},
confirmButtonClass: 'confirm-delete-button'
confirmButtonClass: 'md-btn-danger'
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/sass/partials/loader.sass
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
right: 0
height: 100%
width: 100%
z-index: 999
z-index: 99
.spinner
width: 40px
height: 40px
Expand Down
26 changes: 13 additions & 13 deletions src/views/dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,19 @@
</thead>
<tbody>

{{#each data.tickets.overdue}}
<tr class="uk-table-middle">
<td class="uk-width-1-10 uk-text-nowrap"><a href="/tickets/{{uid}}">T#{{uid}}</a></td>
<td class="uk-width-1-10 uk-text-nowrap"><span
class="uk-badge ticket-status-open uk-width-1-1">Open</span></td>
<td class="uk-width-6-10">
{{subject}}
</td>
<td class="uk-width-2-10 uk-text-right uk-text-muted uk-text-small">
{{{formatDate updated "MM.DD.YYYY"}}}
</td>
</tr>
{{/each}}
<!--{{#each data.tickets.overdue}}-->
<!--<tr class="uk-table-middle">-->
<!--<td class="uk-width-1-10 uk-text-nowrap"><a href="/tickets/{{uid}}">T#{{uid}}</a></td>-->
<!--<td class="uk-width-1-10 uk-text-nowrap"><span-->
<!--class="uk-badge ticket-status-open uk-width-1-1">Open</span></td>-->
<!--<td class="uk-width-6-10">-->
<!--{{subject}}-->
<!--</td>-->
<!--<td class="uk-width-2-10 uk-text-right uk-text-muted uk-text-small">-->
<!--{{{formatDate updated "MM.DD.YYYY"}}}-->
<!--</td>-->
<!--</tr>-->
<!--{{/each}}-->
</tbody>
</table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/groups.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</ul>
</div>
</div>
<h3 class="tru-card-head-text uk-text-center" style="padding-top: 60px;">
<h3 class="tru-card-head-text uk-text-center" style="padding-top: 60px;" data-group-name="{{name}}">
{{name}}
<span class="uk-text-truncate">{{size members}} member{{#compare (size members) '>' 1}}s {{/compare}}</span>
</h3>
Expand Down

0 comments on commit 9c2662d

Please sign in to comment.