From 415dad29407362a76fde6d07d8b100285a84518d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 4 Sep 2014 17:52:48 -0400 Subject: media api --- public/assets/img/profile.png | Bin 0 -> 9320 bytes public/assets/javascripts/ui/site/StaffView.js | 33 ++++++++++++++----------- public/assets/stylesheets/staff.css | 4 +++ 3 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 public/assets/img/profile.png (limited to 'public') diff --git a/public/assets/img/profile.png b/public/assets/img/profile.png new file mode 100644 index 0000000..bde68e0 Binary files /dev/null and b/public/assets/img/profile.png differ diff --git a/public/assets/javascripts/ui/site/StaffView.js b/public/assets/javascripts/ui/site/StaffView.js index 8f677cb..fd173e5 100644 --- a/public/assets/javascripts/ui/site/StaffView.js +++ b/public/assets/javascripts/ui/site/StaffView.js @@ -7,7 +7,7 @@ var StaffView = View.extend({ initialize: function() { this.$toggleStaff = $("#toggle-staff") - if (this.$toggleStaff.data().isstaff) { + if (this.$toggleStaff.length && this.$toggleStaff.data().isstaff) { this.$toggleStaff.html("Is Staff") } }, @@ -22,20 +22,23 @@ var StaffView = View.extend({ toggleStaff: function(){ var state = ! this.$toggleStaff.data().isstaff - $.ajax({ - type: "put", - dataType: "json", - url: window.location.href + "/bless", - data: { - state: state, - _csrf: $("#_csrf").val(), - }, - success: function(data){ - this.$toggleStaff.data("isstaff", data.state) - this.$toggleStaff.html(data.state ? "Is Staff" : "Make Staff") - $("#is-staff").html(data.state ? "yes" : "no") - }.bind(this) - }) + var verb = state ? "promote this user to staff?" : "remove this user from staff?" + ConfirmModal.confirm("Are you sure you want to " + verb, function(){ + $.ajax({ + type: "put", + dataType: "json", + url: window.location.href + "/bless", + data: { + state: state, + _csrf: $("#_csrf").val(), + }, + success: function(data){ + this.$toggleStaff.data("isstaff", data.state) + this.$toggleStaff.html(data.state ? "Is Staff" : "Make Staff") + $("#is-staff").html(data.state ? "yes" : "no") + }.bind(this) + }) + }.bind(this)) }, }) diff --git a/public/assets/stylesheets/staff.css b/public/assets/stylesheets/staff.css index 9b9226f..02510a3 100644 --- a/public/assets/stylesheets/staff.css +++ b/public/assets/stylesheets/staff.css @@ -78,6 +78,10 @@ h2 { display: inline-block; background-size: cover; } +#actions button { + float: none; + width: auto; +} iframe.embed { position: static; width: 100%; -- cgit v1.2.3-70-g09d2