Skip to content

Commit

Permalink
Merge 006a202 into 661d6f9
Browse files Browse the repository at this point in the history
  • Loading branch information
jfederico committed May 24, 2019
2 parents 661d6f9 + 006a202 commit befbbd1
Show file tree
Hide file tree
Showing 67 changed files with 2,045 additions and 171 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ env
# IDEs
.idea
.idea/**
.vscode
.vscode/**

config/terms.md
coverage*
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Style/MixinUsage:
Style/SymbolArray:
Enabled: false

# Don't use begin blocks when they are not needed.
Style/RedundantBegin:
Enabled: false

# Use `%`-literal delimiters consistently
Style/PercentLiteralDelimiters:
Enabled: false
Expand Down
76 changes: 62 additions & 14 deletions app/assets/javascripts/admins.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,58 @@ $(document).on('turbolinks:load', function(){
$("#delete-confirm").parent().attr("action", url)
})

$('.colorinput').ColorPicker({
onHide: function (colpkr) {
var colour = $("#user-colour").val();
//clear the role filter if user clicks on the x
$(".clear-role").click(function(data) {
search = new URL(location.href).searchParams.get('search')

// Update the color in the database and reload the page
$.post($("#coloring-path").val(), {color: colour}).done(function(data) {
url = window.location.pathname + "?page=1"

if (search) {
url += "&search=" + search
}

window.location.replace(url);
})

/* COLOR SELECTORS */

$('#colorinput-regular').ColorPicker({
onBeforeShow: function () {
var colour = rgb2hex($("#colorinput-regular").css("background-color"))

$(this).ColorPickerSetColor(colour);
},
onSubmit: function(_hsb, hex, _rgb, _el) {
$.post($("#coloring-path-regular").val(), {color: '#' + hex}).done(function(data) {
location.reload()
});
},
});

onSubmit: function(hsb, hex, rgb, el) {
$.post($("#coloring-path").val(), {color: '#' + hex}).done(function(data) {
$('#colorinput-lighten').ColorPicker({
onBeforeShow: function () {
var colour = rgb2hex($("#colorinput-lighten").css("background-color"))

$(this).ColorPickerSetColor(colour);
},
onSubmit: function(_hsb, hex, _rgb, _el) {
$.post($("#coloring-path-lighten").val(), {color: '#' + hex}).done(function(data) {
location.reload()
});
},

});

$('#colorinput-darken').ColorPicker({
onBeforeShow: function () {
var colour = $("#user-colour").val();
var colour = rgb2hex($("#colorinput-darken").css("background-color"))

$(this).ColorPickerSetColor(colour);
},

onChange: function (hsb, hex, rgb) {
$('.colorinput span').css('backgroundColor', '#' + hex);
$("#user-colour").val('#' + hex);
}
onSubmit: function(_hsb, hex, _rgb, _el) {
$.post($("#coloring-path-darken").val(), {color: '#' + hex}).done(function(data) {
location.reload()
});
},
});
}

Expand All @@ -79,3 +105,25 @@ function changeBrandingImage(path) {
var url = $("#branding-url").val()
$.post(path, {url: url})
}

// Filters by role
function filterRole(role) {
search = new URL(location.href).searchParams.get('search')

url = window.location.pathname + "?page=1" + "&role=" + role

if (search) {
url += "&search=" + search
}

window.location.replace(url);
}

function rgb2hex(rgb) {
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
function hex(x) {
return ("0" + parseInt(x).toString(16)).slice(-2);
}
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}

3 changes: 2 additions & 1 deletion app/assets/javascripts/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
$(document).on('turbolinks:load', function(){
// Stores the current url when the user clicks the sign in button
$(".sign-in-button").click(function(){
document.cookie ="return_to=" + window.location.href
var url = [location.protocol, '//', location.host, location.pathname].join('');
document.cookie ="return_to=" + url
})

// Checks to see if the user provided an image url and displays it if they did
Expand Down
25 changes: 21 additions & 4 deletions app/assets/javascripts/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,19 @@ function searchPage() {
var controller = $("body").data('controller');
var action = $("body").data('action');

// Check if the user filtered by role
role = new URL(location.href).searchParams.get('role')

url = window.location.pathname + "?page=1&search=" + search

if (role) {
url += "&role=" + role
}

if(controller === "rooms" && action === "show"){
window.location.replace(window.location.pathname + "?page=1&search=" + search + "#recordings-table");
window.location.replace(url + "#recordings-table");
} else{
window.location.replace(window.location.pathname + "?page=1&search=" + search);
window.location.replace(url);
}

}
Expand All @@ -90,9 +99,17 @@ function clearSearch() {
var controller = $("body").data('controller');
var action = $("body").data('action');

role = new URL(location.href).searchParams.get('role')

url = window.location.pathname + "?page=1"

if (role) {
url += "&role=" + role
}

if(controller === "rooms" && action === "show"){
window.location.replace(window.location.pathname + "?page=1" + "#recordings-table");
window.location.replace(url + "#recordings-table");
} else{
window.location.replace(window.location.pathname + "?page=1");
window.location.replace(url);
}
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/_tabler-custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
@import "tabler/stamp";
//@import "tabler/chat";
//@import "tabler/example";
//@import "tabler/tag";
@import "tabler/tag";
//@import "tabler/syntax";
//@import "tabler/infobox";
//@import "tabler/carousel";
Expand Down
12 changes: 10 additions & 2 deletions app/assets/stylesheets/admins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.

#users-table {
.user-role:hover {
cursor: default;
.user-role {
color: white !important;
}
}

Expand All @@ -31,6 +31,14 @@
}
}

.tag i {
color: white !important;
}

#branding-image{
z-index: auto;
}

.authentication-required{
padding-top: 2px;
}
41 changes: 39 additions & 2 deletions app/assets/stylesheets/utilities/_primary_themes.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.btn {
&:focus {
box-shadow: 0 0 0 2px $primary-color-lighten;
}
}

.btn-primary,
.btn-primary:visited,
.btn-primary i {
Expand All @@ -9,14 +15,26 @@
.btn-primary:active,
.btn-primary:active:focus,
.btn-primary:active:hover,
.btn-primary:focus,
.btn-primary:hover,
.btn-primary:hover i {
background-color: $primary-color-darken !important;
border-color: $primary-color-darken !important;
color: white !important;
}

.btn-primary:focus {
background-color: $primary-color-darken !important;
border-color: $primary-color-darken !important;
color: white !important;
box-shadow: 0 0 0 2px $primary-color-lighten !important;
}

.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before{
background-color: $primary-color !important;
border-color: $primary-color !important;
color: white !important;
}

a {
color: $primary-color !important;
}
Expand All @@ -39,7 +57,7 @@ a {
}

&:focus {
box-shadow: 0 0 0 2px $primary-color-lighten;
box-shadow: 0 0 0 2px $primary-color-lighten !important;
}
}

Expand Down Expand Up @@ -91,6 +109,7 @@ input:focus, select:focus {

.bg-primary {
background-color: $primary-color !important;
color: white !important;
}

.btn-danger {
Expand Down Expand Up @@ -123,3 +142,21 @@ input:focus, select:focus {
}
}
}

.primary-regular {
background-color: $primary-color !important;
border-color: $primary-color !important;
color: white !important;
}

.primary-lighten {
background-color: $primary-color-lighten !important;
border-color: $primary-color-lighten !important;
color: $primary-color !important;
}

.primary-darken {
background-color: $primary-color-darken !important;
border-color: $primary-color-darken !important;
color: white !important;
}
4 changes: 4 additions & 0 deletions app/controllers/account_activations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def edit
if @user && !@user.activated? && @user.authenticated?(:activation, params[:token])
@user.activate

# Redirect user to root with account pending flash if account is still pending
return redirect_to root_path,
flash: { success: I18n.t("registration.approval.signup") } if @user.has_role?(:pending)

flash[:success] = I18n.t("verify.activated") + " " + I18n.t("verify.signin")
redirect_to signin_path
else
Expand Down

0 comments on commit befbbd1

Please sign in to comment.