* VRFS-767, VRFS-781 - create account page updated, web layout will now expand black bar as needed
This commit is contained in:
parent
333d158fc6
commit
b918406edf
|
|
@ -652,7 +652,7 @@ module JamRuby
|
||||||
|
|
||||||
# throws ActiveRecord::RecordNotFound if instrument is invalid
|
# throws ActiveRecord::RecordNotFound if instrument is invalid
|
||||||
# throws an email delivery error if unable to connect out to SMTP
|
# throws an email delivery error if unable to connect out to SMTP
|
||||||
def self.signup(first_name, last_name, email, password, password_confirmation, terms_of_service, subscribe_email,
|
def self.signup(first_name, last_name, email, password, password_confirmation, terms_of_service,
|
||||||
location, instruments, birth_date, musician, photo_url, invited_user, signup_confirm_url)
|
location, instruments, birth_date, musician, photo_url, invited_user, signup_confirm_url)
|
||||||
user = User.new
|
user = User.new
|
||||||
|
|
||||||
|
|
@ -660,7 +660,7 @@ module JamRuby
|
||||||
user.first_name = first_name
|
user.first_name = first_name
|
||||||
user.last_name = last_name
|
user.last_name = last_name
|
||||||
user.email = email
|
user.email = email
|
||||||
user.subscribe_email = subscribe_email
|
user.subscribe_email = true
|
||||||
user.terms_of_service = terms_of_service
|
user.terms_of_service = terms_of_service
|
||||||
user.musician = musician
|
user.musician = musician
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,12 +91,12 @@
|
||||||
|
|
||||||
function navToEditIdentity() {
|
function navToEditIdentity() {
|
||||||
resetForm()
|
resetForm()
|
||||||
window.location = '#/account/identity'
|
window.location = '/client#/account/identity'
|
||||||
}
|
}
|
||||||
|
|
||||||
function navToEditProfile() {
|
function navToEditProfile() {
|
||||||
resetForm()
|
resetForm()
|
||||||
window.location = '#/account/profile'
|
window.location = '/client#/account/profile'
|
||||||
}
|
}
|
||||||
|
|
||||||
function navToEditSubscriptions() {
|
function navToEditSubscriptions() {
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
|
|
||||||
function navToEditAudio() {
|
function navToEditAudio() {
|
||||||
resetForm()
|
resetForm()
|
||||||
window.location = "#/account/audio"
|
window.location = "/client#/account/audio"
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle update avatar event
|
// handle update avatar event
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
function navToAccount() {
|
function navToAccount() {
|
||||||
resetForm();
|
resetForm();
|
||||||
window.location = '#/account';
|
window.location = '/client#/account';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleUpdateEmail() {
|
function handleUpdateEmail() {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@
|
||||||
last_name: userDetail.last_name,
|
last_name: userDetail.last_name,
|
||||||
user_instruments: userDetail.instruments,
|
user_instruments: userDetail.instruments,
|
||||||
birth_date : userDetail.birth_date,
|
birth_date : userDetail.birth_date,
|
||||||
gender: userDetail.gender
|
gender: userDetail.gender,
|
||||||
|
subscribe_email: userDetail.subscribe_email ? "checked=checked" : ""
|
||||||
});
|
});
|
||||||
|
|
||||||
var content_root = $('#account-profile-content-scroller')
|
var content_root = $('#account-profile-content-scroller')
|
||||||
|
|
@ -263,12 +264,12 @@
|
||||||
|
|
||||||
function navToAccount() {
|
function navToAccount() {
|
||||||
resetForm();
|
resetForm();
|
||||||
window.location = '#/account';
|
window.location = '/client#/account';
|
||||||
}
|
}
|
||||||
|
|
||||||
function navToAvatar() {
|
function navToAvatar() {
|
||||||
resetForm();
|
resetForm();
|
||||||
window.location = '#/account/profile/avatar';
|
window.location = '/client#/account/profile/avatar';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleUpdateProfile() {
|
function handleUpdateProfile() {
|
||||||
|
|
@ -280,11 +281,12 @@
|
||||||
var city = getCityElement().val();
|
var city = getCityElement().val();
|
||||||
var firstName = getFirstNameElement().val();
|
var firstName = getFirstNameElement().val();
|
||||||
var lastName = getLastNameElement().val();
|
var lastName = getLastNameElement().val();
|
||||||
var gender = getGenderElement().val()
|
var gender = getGenderElement().val();
|
||||||
|
var subscribeEmail = getSubscribeEmail().is(':checked');
|
||||||
var birthDate = getBirthDate();
|
var birthDate = getBirthDate();
|
||||||
var instruments = getInstrumentsValue();
|
var instruments = getInstrumentsValue();
|
||||||
|
|
||||||
postUpdateProfile({
|
api.updateUser({
|
||||||
country: country,
|
country: country,
|
||||||
state: region,
|
state: region,
|
||||||
city: city,
|
city: city,
|
||||||
|
|
@ -292,25 +294,13 @@
|
||||||
last_name: lastName,
|
last_name: lastName,
|
||||||
gender: gender,
|
gender: gender,
|
||||||
birth_date: birthDate,
|
birth_date: birthDate,
|
||||||
instruments: instruments
|
instruments: instruments,
|
||||||
|
subscribe_email: subscribeEmail
|
||||||
})
|
})
|
||||||
.done(postUpdateProfileSuccess)
|
.done(postUpdateProfileSuccess)
|
||||||
.fail(postUpdateProfileFailure)
|
.fail(postUpdateProfileFailure)
|
||||||
}
|
}
|
||||||
|
|
||||||
function postUpdateProfile(options) {
|
|
||||||
|
|
||||||
var url = "/api/users/" + context.JK.currentUserId;
|
|
||||||
return $.ajax({
|
|
||||||
type: "POST",
|
|
||||||
dataType: "json",
|
|
||||||
contentType: 'application/json',
|
|
||||||
url: url,
|
|
||||||
data: JSON.stringify(options),
|
|
||||||
processData: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function postUpdateProfileSuccess(response) {
|
function postUpdateProfileSuccess(response) {
|
||||||
app.notify(
|
app.notify(
|
||||||
{ title: "Profile Changed",
|
{ title: "Profile Changed",
|
||||||
|
|
@ -332,6 +322,7 @@
|
||||||
var city = context.JK.format_errors("city", errors);
|
var city = context.JK.format_errors("city", errors);
|
||||||
var birth_date = context.JK.format_errors("birth_date", errors);
|
var birth_date = context.JK.format_errors("birth_date", errors);
|
||||||
var gender = context.JK.format_errors("birth_date", errors);
|
var gender = context.JK.format_errors("birth_date", errors);
|
||||||
|
var subscribeEmail = context.JK.format_errors("subscribe_email", errors);
|
||||||
var instruments = context.JK.format_errors("musician_instruments", errors)
|
var instruments = context.JK.format_errors("musician_instruments", errors)
|
||||||
|
|
||||||
if(first_name != null) {
|
if(first_name != null) {
|
||||||
|
|
@ -358,6 +349,10 @@
|
||||||
getYearElement().closest('div.field').addClass('error').end().after(birth_date);
|
getYearElement().closest('div.field').addClass('error').end().after(birth_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(subscribeEmail != null) {
|
||||||
|
getSubscribeEmail().closest('div.field').addClass('error').end().after(subscribeEmail);
|
||||||
|
}
|
||||||
|
|
||||||
if(gender != null) {
|
if(gender != null) {
|
||||||
getGenderElement().closest('div.field').addClass('error').end().after(gender);
|
getGenderElement().closest('div.field').addClass('error').end().after(gender);
|
||||||
}
|
}
|
||||||
|
|
@ -480,6 +475,10 @@
|
||||||
return $('#account-profile-content-scroller select#user_birth_date_1i');
|
return $('#account-profile-content-scroller select#user_birth_date_1i');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSubscribeEmail() {
|
||||||
|
return $('#account-profile-content-scroller input[name=subscribe_email]');
|
||||||
|
}
|
||||||
|
|
||||||
function getInstrumentsElement() {
|
function getInstrumentsElement() {
|
||||||
return $('#account-profile-content-scroller .instrument_selector');
|
return $('#account-profile-content-scroller .instrument_selector');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@
|
||||||
|
|
||||||
function navToEditProfile() {
|
function navToEditProfile() {
|
||||||
resetForm();
|
resetForm();
|
||||||
window.location = '#/account/profile'
|
window.location = '/client#/account/profile'
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderAvatarSpinner() {
|
function renderAvatarSpinner() {
|
||||||
|
|
|
||||||
|
|
@ -41,12 +41,14 @@
|
||||||
min-width: 165px;
|
min-width: 165px;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-left h2 {
|
.account-left h2 {
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-size: 23px;
|
font-size: 23px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-mid {
|
.account-mid {
|
||||||
float: left;
|
float: left;
|
||||||
line-height: 150%;
|
line-height: 150%;
|
||||||
|
|
@ -54,6 +56,29 @@
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.account-profile {
|
||||||
|
padding-top:25px;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-bottom:15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.location {
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#account-change-avatar {
|
||||||
|
position:absolute;
|
||||||
|
top:-25px;
|
||||||
|
right:80px;
|
||||||
|
height:13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.birth_date {
|
||||||
|
margin-left:40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.audio .audio-profiles-short{
|
.audio .audio-profiles-short{
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,7 @@ ul.shortcuts {
|
||||||
|
|
||||||
.tagline {
|
.tagline {
|
||||||
font-size:30px;
|
font-size:30px;
|
||||||
margin-top:55px;
|
margin-top:35px;
|
||||||
color:#ed3718;
|
color:#ed3718;
|
||||||
font-weight:300;
|
font-weight:300;
|
||||||
width:345px;
|
width:345px;
|
||||||
|
|
|
||||||
|
|
@ -175,76 +175,3 @@ strong {
|
||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// all custom CSS for the register page goes here
|
|
||||||
.register-page {
|
|
||||||
.register-container {
|
|
||||||
padding:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input.register-musician {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.error {
|
|
||||||
padding: 5px 12px 5px 5px;
|
|
||||||
margin-left:-5px;
|
|
||||||
margin-right:-12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input.register-fan {
|
|
||||||
margin-left:20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type=text], input[type=password] {
|
|
||||||
margin-top:1px;
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.right-side {
|
|
||||||
margin-left:25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ftue-left {
|
|
||||||
margin-bottom:30px;
|
|
||||||
|
|
||||||
select {
|
|
||||||
width:104%;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.field {
|
|
||||||
margin-top:31px;
|
|
||||||
width:43%;
|
|
||||||
float:left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.ftue-right {
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse:separate;
|
|
||||||
border-spacing:6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
label.instruments {
|
|
||||||
margin-bottom:2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.field {
|
|
||||||
margin-top:15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.tos {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type=submit] {
|
|
||||||
margin-top:20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
#footer-container {
|
#footer-container {
|
||||||
position:relative;
|
position:relative;
|
||||||
width:1100px;
|
margin:0 6%;
|
||||||
top:20px;
|
top:100px;
|
||||||
height:13px;
|
height:13px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ html {
|
||||||
}
|
}
|
||||||
|
|
||||||
body.web {
|
body.web {
|
||||||
background-image: url(../web/bkg_home.gif);
|
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
margin:0 !important;
|
margin:0 !important;
|
||||||
padding:0 !important;
|
padding:0 !important;
|
||||||
|
|
@ -12,26 +11,12 @@ body.web {
|
||||||
width:auto !important;
|
width:auto !important;
|
||||||
|
|
||||||
#web-container {
|
#web-container {
|
||||||
padding:3% 6%;
|
padding:3% 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.wrapper {
|
div.wrapper {
|
||||||
width: 1100px;
|
|
||||||
margin: 0 auto;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
|
||||||
|
|
||||||
.logo-home {
|
|
||||||
width: 298px;
|
|
||||||
margin-top: 30px;
|
|
||||||
display: inline-block;
|
|
||||||
float:left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#profile {
|
|
||||||
margin-top: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#landing-inner {
|
|
||||||
p, ul {
|
p, ul {
|
||||||
color:#999;
|
color:#999;
|
||||||
line-height:160%;
|
line-height:160%;
|
||||||
|
|
@ -40,7 +25,153 @@ body.web {
|
||||||
white-space:normal;
|
white-space:normal;
|
||||||
font-size:16px;
|
font-size:16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-weight:300;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-wrapper {
|
||||||
|
border-bottom: medium none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.black-bar{
|
||||||
|
position:relative;
|
||||||
|
width:100%;
|
||||||
|
min-height: 366px;
|
||||||
|
background-color:black;
|
||||||
|
padding-top:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.black-bar-inner {
|
||||||
|
width:1100px;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
|
position:relative;
|
||||||
|
|
||||||
|
// all custom CSS for the register page goes here
|
||||||
|
.register-page {
|
||||||
|
|
||||||
|
.register-container {
|
||||||
|
padding:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.register-musician {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
margin-top:20px;
|
||||||
|
|
||||||
|
a.button-grey {
|
||||||
|
line-height:15px; // WHY is this not universal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.error {
|
||||||
|
padding: 5px 12px 5px 5px;
|
||||||
|
margin-left:-5px;
|
||||||
|
margin-right:-12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.register-fan {
|
||||||
|
margin-left:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=text], input[type=password] {
|
||||||
|
margin-top:1px;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.right-side {
|
||||||
|
margin-left:25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.register-left {
|
||||||
|
|
||||||
|
select {
|
||||||
|
width:104%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.field {
|
||||||
|
margin-top:31px;
|
||||||
|
width:43%;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.register-right {
|
||||||
|
|
||||||
|
margin-top:40px;
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse:separate;
|
||||||
|
border-spacing:6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
label.instruments {
|
||||||
|
margin-bottom:2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.field {
|
||||||
|
margin-top:15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.tos {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ftue-instrumentlist {
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.after-black-bar {
|
||||||
|
position:relative;
|
||||||
|
background-color:#262626;
|
||||||
|
width:1100px;
|
||||||
|
margin:0 auto;
|
||||||
|
|
||||||
|
.after-black-bar-inner {
|
||||||
|
background-color:#262626;
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
width:1100px;
|
||||||
|
margin:0 auto;
|
||||||
|
|
||||||
|
.logo-home {
|
||||||
|
width: 298px;
|
||||||
|
margin-top: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#profile {
|
||||||
|
position:absolute;
|
||||||
|
top:-80px;
|
||||||
|
right:0;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin-bottom:0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
list-style: none outside none;
|
list-style: none outside none;
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +193,7 @@ body.web {
|
||||||
}
|
}
|
||||||
|
|
||||||
.system-requirements {
|
.system-requirements {
|
||||||
margin-top:75px;
|
margin-top:35px;
|
||||||
display:none;
|
display:none;
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
|
|
@ -233,76 +364,3 @@ strong {
|
||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// all custom CSS for the register page goes here
|
|
||||||
.register-page {
|
|
||||||
.register-container {
|
|
||||||
padding:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input.register-musician {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.error {
|
|
||||||
padding: 5px 12px 5px 5px;
|
|
||||||
margin-left:-5px;
|
|
||||||
margin-right:-12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input.register-fan {
|
|
||||||
margin-left:20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type=text], input[type=password] {
|
|
||||||
margin-top:1px;
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.right-side {
|
|
||||||
margin-left:25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ftue-left {
|
|
||||||
margin-bottom:30px;
|
|
||||||
|
|
||||||
select {
|
|
||||||
width:104%;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.field {
|
|
||||||
margin-top:31px;
|
|
||||||
width:43%;
|
|
||||||
float:left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.ftue-right {
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse:separate;
|
|
||||||
border-spacing:6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
label.instruments {
|
|
||||||
margin-bottom:2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.field {
|
|
||||||
margin-top:15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.tos {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type=submit] {
|
|
||||||
margin-top:20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -66,6 +66,7 @@ class ApiUsersController < ApiController
|
||||||
@user.musician = params[:musician] if params.has_key?(:musician)
|
@user.musician = params[:musician] if params.has_key?(:musician)
|
||||||
@user.update_instruments(params[:instruments].nil? ? [] : params[:instruments]) if params.has_key?(:instruments)
|
@user.update_instruments(params[:instruments].nil? ? [] : params[:instruments]) if params.has_key?(:instruments)
|
||||||
@user.show_whats_next = params[:show_whats_next] if params.has_key?(:show_whats_next)
|
@user.show_whats_next = params[:show_whats_next] if params.has_key?(:show_whats_next)
|
||||||
|
@user.subscribe_email = params[:subscribe_email] if params.has_key?(:subscribe_email)
|
||||||
|
|
||||||
@user.save
|
@user.save
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,14 @@ class ClientsController < ApplicationController
|
||||||
include UsersHelper
|
include UsersHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
|
# we want to enforce that /client is always the client view prefix
|
||||||
|
# this is a side effect of setting root path to '/'; soon we can remove this when we implement the new home page
|
||||||
|
if request.path == '/'
|
||||||
|
redirect_to client_url
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
# use gon to pass variables into javascript
|
# use gon to pass variables into javascript
|
||||||
gon.websocket_gateway_uri = Rails.application.config.websocket_gateway_uri
|
gon.websocket_gateway_uri = Rails.application.config.websocket_gateway_uri
|
||||||
gon.check_for_client_updates = Rails.application.config.check_for_client_updates
|
gon.check_for_client_updates = Rails.application.config.check_for_client_updates
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,11 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
if current_user
|
||||||
|
redirect_to :root
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
@invited_user = load_invited_user(params)
|
@invited_user = load_invited_user(params)
|
||||||
|
|
||||||
if !@invited_user.nil? && @invited_user.accepted
|
if !@invited_user.nil? && @invited_user.accepted
|
||||||
|
|
@ -41,10 +46,14 @@ class UsersController < ApplicationController
|
||||||
@user.email = @invited_user.email
|
@user.email = @invited_user.email
|
||||||
end
|
end
|
||||||
|
|
||||||
render :layout => 'landing'
|
render :layout => 'web'
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
if current_user
|
||||||
|
redirect_to :root
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
@invited_user = load_invited_user(params)
|
@invited_user = load_invited_user(params)
|
||||||
@signup_postback = load_postback(@invited_user)
|
@signup_postback = load_postback(@invited_user)
|
||||||
|
|
@ -53,7 +62,7 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# check recaptcha; if any errors seen, contribute it to the model
|
# check recaptcha; if any errors seen, contribute it to the model
|
||||||
unless verify_recaptcha(:model => @user, :message => "recaptcha")
|
unless verify_recaptcha(:model => @user, :message => "recaptcha")
|
||||||
render 'new', :layout => 'landing'
|
render 'new', :layout => 'web'
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -73,7 +82,6 @@ class UsersController < ApplicationController
|
||||||
params[:jam_ruby_user][:password],
|
params[:jam_ruby_user][:password],
|
||||||
params[:jam_ruby_user][:password_confirmation],
|
params[:jam_ruby_user][:password_confirmation],
|
||||||
terms_of_service,
|
terms_of_service,
|
||||||
subscribe_email,
|
|
||||||
instruments,
|
instruments,
|
||||||
birth_date,
|
birth_date,
|
||||||
location,
|
location,
|
||||||
|
|
@ -88,7 +96,7 @@ class UsersController < ApplicationController
|
||||||
load_location(request.remote_ip, location)
|
load_location(request.remote_ip, location)
|
||||||
gon.signup_errors = true
|
gon.signup_errors = true
|
||||||
gon.musician_instruments = instruments
|
gon.musician_instruments = instruments
|
||||||
render 'new', :layout => 'landing'
|
render 'new', :layout => 'web'
|
||||||
else
|
else
|
||||||
sign_in @user
|
sign_in @user
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
object @user
|
object @user
|
||||||
|
|
||||||
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :band_like_count, :follower_count, :following_count, :band_following_count, :recording_count, :session_count, :show_whats_next
|
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :band_like_count, :follower_count, :following_count, :band_following_count, :recording_count, :session_count
|
||||||
|
|
||||||
# give back more info if the user being fetched is yourself
|
# give back more info if the user being fetched is yourself
|
||||||
if @user == current_user
|
if @user == current_user
|
||||||
attributes :email, :original_fpfile, :cropped_fpfile, :crop_selection, :session_settings
|
attributes :email, :original_fpfile, :cropped_fpfile, :crop_selection, :session_settings, :show_whats_next, :subscribe_email
|
||||||
end
|
end
|
||||||
|
|
||||||
unless @user.friends.nil? || @user.friends.size == 0
|
unless @user.friends.nil? || @user.friends.size == 0
|
||||||
|
|
|
||||||
|
|
@ -22,100 +22,86 @@
|
||||||
<script type="text/template" id="template-account-profile">
|
<script type="text/template" id="template-account-profile">
|
||||||
<!-- content wrapper -->
|
<!-- content wrapper -->
|
||||||
<div class="content-wrapper account-profile">
|
<div class="content-wrapper account-profile">
|
||||||
<br />
|
|
||||||
|
|
||||||
<form id="account-edit-profile-form">
|
<form id="account-edit-profile-form">
|
||||||
<table width="100%" cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td valign="top" width="33%"> <!-- TODO -->
|
<h2>profile:</h2>
|
||||||
<div class="right mr30"><!--<a href="#" class="avatar_large ml10"><img src="images/shared/avatar_jonathon.png" width="246" height="246" /></a>--><br clear="left" />
|
|
||||||
<a href="#" class="small" id="account-change-avatar">Change Avatar</a></div>
|
|
||||||
<h2>profile:</h2>
|
|
||||||
|
|
||||||
</td>
|
<div class="location w30 left">
|
||||||
|
<a href="#" class="small" id="account-change-avatar">Change Avatar</a>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<label>Country:</label>
|
||||||
|
<select name='country' class="w80">
|
||||||
|
<option value='{country}' selected="selected">{country}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<label>State/Province:</label>
|
||||||
|
<select name='region' class="w80" disabled='disabled'>
|
||||||
|
<option value="{region}" selected="selected">{region}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<label>City:</label>
|
||||||
|
<select name='city' class="w80" disabled='disabled'>
|
||||||
|
<option value="{city}" selected="selected">{city}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="right-side right w70">
|
||||||
|
<div class="field left w45">
|
||||||
|
<label>First Name:</label>
|
||||||
|
<input type="text" name="first_name" value="{first_name}" class="w80"><br/>
|
||||||
|
</div>
|
||||||
|
<div class="field right w45">
|
||||||
|
<label>Last Name:</label>
|
||||||
|
<input type="text" name="last_name" value="{last_name}" class="w80">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br class="clearall"/>
|
||||||
|
|
||||||
|
<div class="field left">
|
||||||
|
<label>Gender:</label>
|
||||||
|
<select name="gender" data-value="{gender}" class="w80">
|
||||||
|
<option value='M'>Male</option>
|
||||||
|
<option value='F'>Female</option>
|
||||||
|
<option>-</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field left birth_date">
|
||||||
|
<label>Birth Date:</label>
|
||||||
|
<%= date_select("user", "birth_date", :use_short_month => true, :start_year => 1900, :end_year => Time.now.year - 18, :order => [:month, :day, :year], :default => -25.years.from_now) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br class="clearall"/>
|
||||||
|
|
||||||
|
|
||||||
<td valign="top" width="33%">
|
<div class="field">
|
||||||
<div class="field">
|
What instruments can you play?
|
||||||
First Name:<br />
|
<div class="profile-instrumentlist w90">
|
||||||
<input type="text" name="first_name" value="{first_name}" class="w80"><br />
|
<table class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td valign="top" width="33%">
|
|
||||||
<div class="field">
|
|
||||||
Last Name:<br />
|
|
||||||
|
|
||||||
<input type="text" name="last_name" value="{last_name}" class="w80">
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td valign="top">
|
|
||||||
<div class="field">
|
|
||||||
Country:<br />
|
|
||||||
|
|
||||||
<select name='country' class="w80"><option value='{country}' selected="selected">{country}</option></select><br /><br />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td valign="top">
|
|
||||||
<div class="field">
|
|
||||||
Gender:<br />
|
|
||||||
<select name="gender" data-value="{gender}" class="w80"><option value='M'>Male</option><option value='F'>Female</option><option >-</option></select><br />
|
|
||||||
<br />
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td valign="top">
|
|
||||||
<div class="field">
|
|
||||||
Birth Date:<br />
|
|
||||||
<%= date_select("user", "birth_date", :use_short_month => true, :start_year => 1900, :end_year => Time.now.year - 18, :order => [:month, :day, :year], :default => -25.years.from_now ) %>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td valign="top">
|
|
||||||
<div class="field">
|
|
||||||
State/Province:<br />
|
|
||||||
<select name='region' class="w80" disabled='disabled'><option value="{region}" selected="selected">{region}</option></select><br /><br />
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td rowspan=3 colspan=2 valign="top">
|
|
||||||
<div class="field">
|
|
||||||
What instruments can you play?
|
|
||||||
|
|
||||||
<div class="profile-instrumentlist w90">
|
|
||||||
<table class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td valign="top">
|
|
||||||
<div class="field">
|
|
||||||
|
|
||||||
City:<br />
|
|
||||||
<select name='city' class="w80" disabled='disabled'><option value="{city}" selected="selected">{city}</option></select><br /><br />
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<input type="checkbox" name="subscribe_email" {subscribe_email} /> I will accept email from JamKazam about this service.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="right actions">
|
||||||
|
<a id="account-edit-profile-cancel" href="#" class="button-grey">CANCEL</a> <a id="account-edit-profile-submit" href="#" class="button-orange">UPDATE PROFILE</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<br clear="all" />
|
<br clear="all"/>
|
||||||
<div class="right"><a id="account-edit-profile-cancel" href="#" class="button-grey">CANCEL</a> <a id="account-edit-profile-submit" href="#" class="button-orange">UPDATE PROFILE</a></div>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- end content wrapper -->
|
<!-- end content wrapper -->
|
||||||
|
|
||||||
|
|
@ -125,6 +111,10 @@
|
||||||
<script type="text/template" id="account-profile-instrument">
|
<script type="text/template" id="account-profile-instrument">
|
||||||
<tr data-instrument-id='{id}'>
|
<tr data-instrument-id='{id}'>
|
||||||
<td><input type="checkbox" {checked} />{description}</td>
|
<td><input type="checkbox" {checked} />{description}</td>
|
||||||
<td align="right" width="50%"><select name="proficiency" class='proficiency_selector'><option value="1">Beginner</option><option value="2">Intermediate</option><option value="3">Expert</option></select></td>
|
<td align="right" width="50%"><select name="proficiency" class='proficiency_selector'>
|
||||||
|
<option value="1">Beginner</option>
|
||||||
|
<option value="2">Intermediate</option>
|
||||||
|
<option value="3">Expert</option>
|
||||||
|
</select></td>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -21,55 +21,59 @@
|
||||||
|
|
||||||
<div id="web-container">
|
<div id="web-container">
|
||||||
|
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
|
||||||
<div class="logo-home">
|
<div class="header">
|
||||||
<%= link_to root_path do %>
|
<div class="logo-home">
|
||||||
<%= image_tag("web/logo_home.png", :alt => "JamKazam logo", :size => "298x54") %>
|
<%= link_to root_path do %>
|
||||||
<% end %>
|
<%= image_tag("web/logo_home.png", :alt => "JamKazam logo", :size => "298x54") %>
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render "users/user_dropdown" %>
|
|
||||||
|
|
||||||
|
|
||||||
<br clear="all">
|
|
||||||
|
|
||||||
<div id="landing-inner">
|
|
||||||
<%= yield %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="footer-container">
|
|
||||||
<%= render "clients/footer" %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render "clients/invitationDialog" %>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function () {
|
|
||||||
|
|
||||||
JK = JK || {};
|
|
||||||
|
|
||||||
<% if current_user %>
|
|
||||||
JK.currentUserId = '<%= current_user.id %>';
|
|
||||||
<% else %>
|
|
||||||
JK.currentUserId = null;
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
if (JK.currentUserId) {
|
<br clear="all">
|
||||||
JK.app = JK.JamKazam();
|
|
||||||
JK.app.initialize({inClient: false, layoutOpts: {layoutFooter:false}});
|
|
||||||
|
|
||||||
var invitationDialog = new JK.InvitationDialog(JK.app);
|
<div class="black-bar">
|
||||||
invitationDialog.initialize();
|
<div class="black-bar-inner">
|
||||||
|
<%= render "users/user_dropdown" %>
|
||||||
|
<%= yield %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
var userDropdown = new JK.UserDropdown(JK.app);
|
<div class="after-black-bar">
|
||||||
userDropdown.initialize(invitationDialog);
|
<%= yield(:after_black_bar) %>
|
||||||
}
|
</div>
|
||||||
})
|
|
||||||
</script>
|
<div id="footer-container">
|
||||||
|
<%= render "clients/footer" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= render "clients/invitationDialog" %>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
JK = JK || {};
|
||||||
|
|
||||||
|
<% if current_user %>
|
||||||
|
JK.currentUserId = '<%= current_user.id %>';
|
||||||
|
<% else %>
|
||||||
|
JK.currentUserId = null;
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
if (JK.currentUserId) {
|
||||||
|
JK.app = JK.JamKazam();
|
||||||
|
JK.app.initialize({inClient: false, layoutOpts: {layoutFooter: false}});
|
||||||
|
|
||||||
|
var invitationDialog = new JK.InvitationDialog(JK.app);
|
||||||
|
invitationDialog.initialize();
|
||||||
|
|
||||||
|
var userDropdown = new JK.UserDropdown(JK.app);
|
||||||
|
userDropdown.initialize(invitationDialog);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="w100 ">
|
<div class="w100 ">
|
||||||
<div class="spinner-large"></div>
|
<div class="spinner-large"></div>
|
||||||
<div class="w70 left downloads-blurb">
|
<div class="w70 left downloads-blurb">
|
||||||
|
<
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br clear="all">
|
<br clear="all">
|
||||||
|
<% content_for :after_black_bar do %>
|
||||||
<div class="system-requirements w100">
|
<div class="system-requirements w100">
|
||||||
<h3>SYSTEM REQUIREMENTS:</h3><br>
|
<h3>SYSTEM REQUIREMENTS:</h3><br>
|
||||||
<p>A short summary of requirements follows. For a more detailed explanation of system requirements, please review our <a href="https://jamkazam.desk.com/customer/portal/articles/1288274-minimum-system-requirements">Minimum System Requirements</a> knowledgebase article.</p>
|
<p>A short summary of requirements follows. For a more detailed explanation of system requirements, please review our <a href="https://jamkazam.desk.com/customer/portal/articles/1288274-minimum-system-requirements">Minimum System Requirements</a> knowledgebase article.</p>
|
||||||
|
|
@ -22,14 +22,20 @@
|
||||||
<li>Ethernet port for Internet (we strongly advise that you not use Wi-Fi)</li>
|
<li>Ethernet port for Internet (we strongly advise that you not use Wi-Fi)</li>
|
||||||
<li>74MB hard disk space for app, plus any space needed for recordings</li>
|
<li>74MB hard disk space for app, plus any space needed for recordings</li>
|
||||||
<li>Audio interface (best to use an audio interface device that gets your music into your computer, else can use built-in mic & headphones on your computer to get started)</li>
|
<li>Audio interface (best to use an audio interface device that gets your music into your computer, else can use built-in mic & headphones on your computer to get started)</li>
|
||||||
<li>Broadband Internet services with 1Mbps uplink bandwidth</li>
|
<li>Broadband Internet service with 1Mbps uplink bandwidth</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="mac-requirements">
|
<ul class="mac-requirements">
|
||||||
<li>Mac</li>
|
<li>Mac OS X 64-bit operating system 10.7 or higher</li>
|
||||||
|
<li>Dual-core processor or higher</li>
|
||||||
|
<li>Ethernet port for Internet (we strongly advise that you not use Wi-Fi)</li>
|
||||||
|
<li>74MB hard disk space for app, plus any space needed for recordings</li>
|
||||||
|
<li>Audio interface (best to use an audio interface device that gets your music into your computer, else can use built-in mic & headphones on your computer to get started)</li>
|
||||||
|
<li>Broadband Internet service with 1Mbps uplink bandwidth</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="linux-requirements">
|
<ul class="linux-requirements">
|
||||||
<li>Linux is not yet supported</li>
|
<li>Linux is not yet supported</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<%end%>
|
||||||
|
|
||||||
<%= render "users/download_templates" %>
|
<%= render "users/download_templates" %>
|
||||||
|
|
@ -13,12 +13,12 @@
|
||||||
<div class="arrow-down"></div>
|
<div class="arrow-down"></div>
|
||||||
<ul class="shortcuts">
|
<ul class="shortcuts">
|
||||||
<!-- <li><a layout-link="account">Profile</a></li> -->
|
<!-- <li><a layout-link="account">Profile</a></li> -->
|
||||||
<li class="account-home"><%= link_to "Account Home", '/client/#/account' %></li>
|
<li class="account-home"><%= link_to "Account Home", '/client#/account' %></li>
|
||||||
<li class="identity"><%= link_to "Identity", '/client/#/account/identity' %></li>
|
<li class="identity"><%= link_to "Identity", '/client#/account/identity' %></li>
|
||||||
<li class="profile"><%= link_to "Profile", '/client/#/account/profile' %></li>
|
<li class="profile"><%= link_to "Profile", '/client#/account/profile' %></li>
|
||||||
<!--<li class="subscriptions"><%= link_to "Subscriptions", '/client/#/account/subscriptions' %></li> -->
|
<!--<li class="subscriptions"><%= link_to "Subscriptions", '/client#/account/subscriptions' %></li> -->
|
||||||
<!-- <li class="payments"><%= link_to "Payments", '/client/#/account/payments' %></li> -->
|
<!-- <li class="payments"><%= link_to "Payments", '/client#/account/payments' %></li> -->
|
||||||
<li class="audio"><%= link_to "Audio Gear", '/client/#/account/audio' %></li>
|
<li class="audio"><%= link_to "Audio Gear", '/client#/account/audio' %></li>
|
||||||
<li class="invite-friends"><span class='menuheader'><span class="arrow-right"></span><%= link_to "Invite Friends", '#' %></span>
|
<li class="invite-friends"><span class='menuheader'><span class="arrow-right"></span><%= link_to "Invite Friends", '#' %></span>
|
||||||
<ul class="shortcuts-submenu">
|
<ul class="shortcuts-submenu">
|
||||||
<li class="google-invite"><%= link_to "Google", '#' %></li>
|
<li class="google-invite"><%= link_to "Google", '#' %></li>
|
||||||
|
|
|
||||||
|
|
@ -1,152 +1,155 @@
|
||||||
<% provide(:title, 'Register') %>
|
<% provide(:title, 'Register') %>
|
||||||
|
|
||||||
<div class="signin-overlay register-page">
|
<div class="content-wrapper register-page">
|
||||||
<div class="content-head">
|
<h2>Create a JamKazam account</h2>
|
||||||
<h1>create a jamkazam account</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- inner wrapper -->
|
<%= form_for(@user, :url => @signup_postback) do |f| %>
|
||||||
<div class="ftue-inner">
|
|
||||||
<%= form_for(@user, :url => @signup_postback) do |f| %>
|
|
||||||
|
|
||||||
<!-- register left column -->
|
<!-- register left column -->
|
||||||
<div class="ftue-left">
|
<div class="register-left left w45">
|
||||||
<div class="register-container w100">
|
<div class="register-container">
|
||||||
Register as a:
|
<div class="register-as">
|
||||||
<%= f.radio_button :musician, true , :class=> "register-as register-musician"%>
|
Register as a:
|
||||||
Musician
|
<%= f.radio_button :musician, true, :class => "register-as register-musician" %>
|
||||||
|
Musician
|
||||||
|
|
||||||
<%= f.radio_button :musician, false, :class=> "register-as register-fan" %>
|
<%= f.radio_button :musician, false, :class => "register-as register-fan" %>
|
||||||
Fan
|
Fan
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="field first_name">
|
<div class="field first_name">
|
||||||
<%= f.label :first_name, "First Name:" %>
|
<%= f.label :first_name, "First Name:" %>
|
||||||
<%= f.text_field :first_name %>
|
<%= f.text_field :first_name %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field last_name right-side">
|
<div class="field last_name right-side">
|
||||||
<%= f.label :last_name, "Last Name:" %>
|
<%= f.label :last_name, "Last Name:" %>
|
||||||
<%= f.text_field :last_name %>
|
<%= f.text_field :last_name %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br clear="all"/>
|
<br clear="all"/>
|
||||||
|
|
||||||
<div class="field email">
|
<div class="field email">
|
||||||
<%= f.label :email, "Email Address:" %>
|
<%= f.label :email, "Email Address:" %>
|
||||||
<%= f.text_field :email %>
|
<%= f.text_field :email %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field country right-side">
|
<div class="field country right-side">
|
||||||
<%= f.label :country, "Country:" %>
|
<%= f.label :country, "Country:" %>
|
||||||
<select id="country_select" name="jam_ruby_user[country]" autocomplete="off">
|
<select id="country_select" name="jam_ruby_user[country]" autocomplete="off">
|
||||||
<option value="" <%= @location[:country].blank? ? "selected" : "" %>>Select Country</option>
|
<option value="" <%= @location[:country].blank? ? "selected" : "" %>>Select Country</option>
|
||||||
<% @countries.each do |country| %>
|
<% @countries.each do |country| %>
|
||||||
<% unless country.blank? %>
|
<% unless country.blank? %>
|
||||||
<option value="<%= country %>" <%= @location[:country] == country ? "selected" : "" %>><%= country %></option>
|
<option value="<%= country %>" <%= @location[:country] == country ? "selected" : "" %>><%= country %></option>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</select>
|
<% end %>
|
||||||
</div>
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<br clear="all"/>
|
<br clear="all"/>
|
||||||
|
|
||||||
<div class="field state">
|
<div class="field state">
|
||||||
<%= f.label :state, "State/Province:" %>
|
<%= f.label :state, "State/Province:" %>
|
||||||
<select id="region_select" name="jam_ruby_user[state]" autocomplete="off">
|
<select id="region_select" name="jam_ruby_user[state]" autocomplete="off">
|
||||||
<option value="" <%= @location[:state].blank? ? "selected" : "" %>>State/Province</option>
|
<option value="" <%= @location[:state].blank? ? "selected" : "" %>>State/Province</option>
|
||||||
<% @regions.each do |region| %>
|
<% @regions.each do |region| %>
|
||||||
<% unless region.blank? %>
|
<% unless region.blank? %>
|
||||||
<option value="<%= region %>" <%= @location[:state] == region ? "selected" : "" %>><%= region %></option>
|
<option value="<%= region %>" <%= @location[:state] == region ? "selected" : "" %>><%= region %></option>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field city right-side">
|
|
||||||
<%= f.label :state, "City:" %>
|
|
||||||
<select id="city_select" name="jam_ruby_user[city]" autocomplete="off">
|
|
||||||
<option value="" <%= @location[:city].blank? ? "selected" : "" %>>Select City</option>
|
|
||||||
<% @cities.each do |city| %>
|
|
||||||
<% unless city.blank? %>
|
|
||||||
<option value="<%= city %>" <%= @location[:city] == city ? "selected" : "" %>><%= city %></option>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br clear="all"/>
|
|
||||||
|
|
||||||
<div class="field password">
|
|
||||||
<%= f.label :password, "Choose a Password:" %>
|
|
||||||
<%= f.password_field :password%>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field password_confirmation right-side">
|
|
||||||
<%= f.label :password_confirmation, "Verify Password:" %>
|
|
||||||
<%= f.password_field :password_confirmation%>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br clear="all"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="field city right-side">
|
||||||
|
<%= f.label :state, "City:" %>
|
||||||
|
<select id="city_select" name="jam_ruby_user[city]" autocomplete="off">
|
||||||
|
<option value="" <%= @location[:city].blank? ? "selected" : "" %>>Select City</option>
|
||||||
|
<% @cities.each do |city| %>
|
||||||
|
<% unless city.blank? %>
|
||||||
|
<option value="<%= city %>" <%= @location[:city] == city ? "selected" : "" %>><%= city %></option>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br clear="all"/>
|
||||||
|
|
||||||
|
<div class="field password">
|
||||||
|
<%= f.label :password, "Choose a Password:" %>
|
||||||
|
<%= f.password_field :password %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field password_confirmation right-side">
|
||||||
|
<%= f.label :password_confirmation, "Verify Password:" %>
|
||||||
|
<%= f.password_field :password_confirmation %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br clear="all"/>
|
||||||
</div>
|
</div>
|
||||||
<!-- end left column -->
|
<!-- end left column -->
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- sign in right column -->
|
<!-- sign in right column -->
|
||||||
<div class="ftue-right"><br/>
|
<div class="register-right right w45"><br/>
|
||||||
|
|
||||||
<div class="ftue-instrumentlist-wrapper">
|
<div class="ftue-instrumentlist-wrapper">
|
||||||
<label class="instruments">What instruments can you play?</label>
|
<label class="instruments">What instruments can you play?</label>
|
||||||
<div class="ftue-instrumentlist">
|
|
||||||
<table id="instrument_selector" class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
|
<div class="ftue-instrumentlist">
|
||||||
<% Instrument.standard_list.each do |instrument| %>
|
<table id="instrument_selector" class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
|
||||||
<tr>
|
<% Instrument.standard_list.each do |instrument| %>
|
||||||
<td><input id="<%= instrument.id.gsub(" ", "") %>_checkbox" name="jam_ruby_user[instruments][<%= instrument.id %>][selected]" type="checkbox" /><%= instrument.description %></td>
|
<tr>
|
||||||
<td align="right" width="50%"><select id="<%= instrument.id.gsub(" ", "") %>_proficiency" name="jam_ruby_user[instruments][<%= instrument.id %>][proficiency]" class='proficiency_selector'><option value="1">Beginner</option><option value="2">Intermediate</option><option value="3">Expert</option></select></td>
|
<td>
|
||||||
</tr>
|
<input id="<%= instrument.id.gsub(" ", "") %>_checkbox" name="jam_ruby_user[instruments][<%= instrument.id %>][selected]" type="checkbox"/><%= instrument.description %>
|
||||||
<% end %>
|
</td>
|
||||||
</table>
|
<td align="right" width="50%">
|
||||||
</div>
|
<select id="<%= instrument.id.gsub(" ", "") %>_proficiency" name="jam_ruby_user[instruments][<%= instrument.id %>][proficiency]" class='proficiency_selector'>
|
||||||
|
<option value="1">Beginner</option>
|
||||||
|
<option value="2">Intermediate</option>
|
||||||
|
<option value="3">Expert</option>
|
||||||
|
</select></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="field subscribe_email">
|
<div class="field terms_of_service">
|
||||||
<small>
|
<small>
|
||||||
<input id="jam_ruby_user_subscribe_email" name="jam_ruby_user[subscribe_email]" type="checkbox"/>
|
<input id="jam_ruby_user_terms_of_service" name="jam_ruby_user[terms_of_service]" type="checkbox"/>
|
||||||
<span>I will accept email from JamKazam about this service.</span>
|
<span>I have read and agree to the JamKazam <%= link_to "terms of service", corp_terms_path, :rel => "external" %>
|
||||||
</small>
|
.</span>
|
||||||
</div>
|
</small>
|
||||||
<div class="field terms_of_service">
|
</div>
|
||||||
<small>
|
|
||||||
<input id="jam_ruby_user_terms_of_service" name="jam_ruby_user[terms_of_service]" type="checkbox"/>
|
|
||||||
<span>I have read and agree to the JamKazam <%= link_to "terms of service", corp_terms_path , :rel=>"external" %>.</span>
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if Rails.application.config.recaptcha_enable %>
|
<% if Rails.application.config.recaptcha_enable %>
|
||||||
<%= recaptcha_tags %>
|
<%= recaptcha_tags %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<img src="images/content/captcha.png" width="152" height="50" align="left" class="mr10" /><small>Enter the characters from the box to the left:<br />
|
<img src="images/content/captcha.png" width="152" height="50" align="left" class="mr10" /><small>Enter the characters from the box to the left:<br />
|
||||||
<input type="text" /> <br clear="all" /><br />
|
<input type="text" /> <br clear="all" /><br />
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<%= f.submit "CREATE ACCOUNT", class: "right button-orange" %>
|
<div class="actions">
|
||||||
<br/ style="clear:both;"><br/>
|
<%= link_to "CANCEL", root_path, :class=>'button-grey left' %>
|
||||||
<!--<a href="/auth/facebook" class="right"><img src="/fb-signup-button.png"></a> -->
|
<%= f.submit "CREATE ACCOUNT", class: "right button-orange" %>
|
||||||
|
</div>
|
||||||
|
<br style="clear:both;"/><br/>
|
||||||
|
<!--<a href="/auth/facebook" class="right"><img src="/fb-signup-button.png"></a> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<!-- end right column -->
|
||||||
<!-- end right column -->
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<br clear="all"/>
|
|
||||||
</div>
|
|
||||||
<!-- end inner -->
|
|
||||||
|
|
||||||
<!-- end overlay content -->
|
</div>
|
||||||
|
<!-- end inner -->
|
||||||
|
|
||||||
|
<!-- end overlay content -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -157,7 +160,7 @@
|
||||||
window.signup.handle_register_as_changes()
|
window.signup.handle_register_as_changes()
|
||||||
|
|
||||||
function get_first_error(field) {
|
function get_first_error(field) {
|
||||||
if(errors[field] && errors[field].length > 0) {
|
if (errors[field] && errors[field].length > 0) {
|
||||||
return errors[field][0]
|
return errors[field][0]
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -166,16 +169,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// populate musician instruments from previous submit, if applicable
|
// populate musician instruments from previous submit, if applicable
|
||||||
if(window.gon && gon.musician_instruments) {
|
if (window.gon && gon.musician_instruments) {
|
||||||
$(gon.musician_instruments).each(function(index, value) {
|
$(gon.musician_instruments).each(function (index, value) {
|
||||||
$('#' + value.instrument_id.replace(" ", "") + "_checkbox").attr("checked", true);
|
$('#' + value.instrument_id.replace(" ", "") + "_checkbox").attr("checked", true);
|
||||||
$('#' + value.instrument_id.replace(" ", "") + "_proficiency").val(value.proficiency_level.toString())
|
$('#' + value.instrument_id.replace(" ", "") + "_proficiency").val(value.proficiency_level.toString())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// show signup errors, if any
|
// show signup errors, if any
|
||||||
if(window.gon && gon.signup_errors) {
|
if (window.gon && gon.signup_errors) {
|
||||||
var errors = <%= @user.errors.to_json.html_safe %>
|
var errors =
|
||||||
|
<%= @user.errors.to_json.html_safe %>
|
||||||
|
|
||||||
var email = get_first_error("email")
|
var email = get_first_error("email")
|
||||||
var first_name = get_first_error("first_name")
|
var first_name = get_first_error("first_name")
|
||||||
|
|
@ -189,65 +193,65 @@
|
||||||
var city = get_first_error("city")
|
var city = get_first_error("city")
|
||||||
|
|
||||||
|
|
||||||
if(email) {
|
if (email) {
|
||||||
var emailInput = $('#jam_ruby_user_email');
|
var emailInput = $('#jam_ruby_user_email');
|
||||||
emailInput.closest('div.field').addClass('error')
|
emailInput.closest('div.field').addClass('error')
|
||||||
emailInput.after("<div class='error-text'>" + email + "</div>")
|
emailInput.after("<div class='error-text'>" + email + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(first_name) {
|
if (first_name) {
|
||||||
var firstNameInput = $('#jam_ruby_user_first_name');
|
var firstNameInput = $('#jam_ruby_user_first_name');
|
||||||
firstNameInput.closest('div.field').addClass('error')
|
firstNameInput.closest('div.field').addClass('error')
|
||||||
firstNameInput.after("<div class='error-text'>" + first_name + "</div>")
|
firstNameInput.after("<div class='error-text'>" + first_name + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(last_name) {
|
if (last_name) {
|
||||||
var lastNameInput = $('#jam_ruby_user_last_name');
|
var lastNameInput = $('#jam_ruby_user_last_name');
|
||||||
lastNameInput.closest('div.field').addClass('error')
|
lastNameInput.closest('div.field').addClass('error')
|
||||||
lastNameInput.after("<div class='error-text'>" + last_name + "</div>")
|
lastNameInput.after("<div class='error-text'>" + last_name + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(country) {
|
if (country) {
|
||||||
var countryInput = $('#country_select');
|
var countryInput = $('#country_select');
|
||||||
countryInput.closest('div.field').addClass('error')
|
countryInput.closest('div.field').addClass('error')
|
||||||
countryInput.after("<div class='error-text'>" + country + "</div>")
|
countryInput.after("<div class='error-text'>" + country + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state) {
|
if (state) {
|
||||||
var stateInput = $('#region_select');
|
var stateInput = $('#region_select');
|
||||||
stateInput.closest('div.field').addClass('error')
|
stateInput.closest('div.field').addClass('error')
|
||||||
stateInput.after("<div class='error-text'>" + state + "</div>")
|
stateInput.after("<div class='error-text'>" + state + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(city) {
|
if (city) {
|
||||||
var cityInput = $('#city_select');
|
var cityInput = $('#city_select');
|
||||||
cityInput.closest('div.field').addClass('error')
|
cityInput.closest('div.field').addClass('error')
|
||||||
cityInput.after("<div class='error-text'>" + city + "</div>")
|
cityInput.after("<div class='error-text'>" + city + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(musician_instruments) {
|
if (musician_instruments) {
|
||||||
var musicianInstrumentsInput = $('#instrument_selector');
|
var musicianInstrumentsInput = $('#instrument_selector');
|
||||||
musicianInstrumentsInput.closest('div.ftue-instrumentlist-wrapper').addClass('error')
|
musicianInstrumentsInput.closest('div.ftue-instrumentlist-wrapper').addClass('error')
|
||||||
musicianInstrumentsInput.closest('div.ftue-instrumentlist').after("<div class='error-text'>" + musician_instruments + "</div>")
|
musicianInstrumentsInput.closest('div.ftue-instrumentlist').after("<div class='error-text'>" + musician_instruments + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(password) {
|
if (password) {
|
||||||
var passwordInput = $('#jam_ruby_user_password');
|
var passwordInput = $('#jam_ruby_user_password');
|
||||||
passwordInput.closest('div.field').addClass('error')
|
passwordInput.closest('div.field').addClass('error')
|
||||||
passwordInput.after("<div class='error-text'>" + password+ "</div>")
|
passwordInput.after("<div class='error-text'>" + password + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(password_confirmation) {
|
if (password_confirmation) {
|
||||||
var passwordConfirmationInput = $('#jam_ruby_user_password_confirmation');
|
var passwordConfirmationInput = $('#jam_ruby_user_password_confirmation');
|
||||||
passwordConfirmationInput.closest('div.field').addClass('error')
|
passwordConfirmationInput.closest('div.field').addClass('error')
|
||||||
passwordConfirmationInput.after("<div class='error-text'>" + password_confirmation + "</div>")
|
passwordConfirmationInput.after("<div class='error-text'>" + password_confirmation + "</div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(terms_of_service) {
|
if (terms_of_service) {
|
||||||
var termsOfServiceInput = $('#jam_ruby_user_terms_of_service');
|
var termsOfServiceInput = $('#jam_ruby_user_terms_of_service');
|
||||||
termsOfServiceInput.closest('small').addClass('error')
|
termsOfServiceInput.closest('small').addClass('error')
|
||||||
// termsOfServiceInput.closest('small').after("<div class='error-text'>" + terms_of_service + "</div>")
|
// termsOfServiceInput.closest('small').after("<div class='error-text'>" + terms_of_service + "</div>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class UserManager < BaseManager
|
||||||
|
|
||||||
# Note that almost everything can be nil here. This is because when users sign up via social media,
|
# Note that almost everything can be nil here. This is because when users sign up via social media,
|
||||||
# we don't know much about them.
|
# we don't know much about them.
|
||||||
def signup(remote_ip, first_name, last_name, email, password = nil, password_confirmation = nil, terms_of_service = nil, subscribe_email = nil,
|
def signup(remote_ip, first_name, last_name, email, password = nil, password_confirmation = nil, terms_of_service = nil,
|
||||||
instruments = nil, birth_date = nil, location = nil, musician = nil, photo_url = nil, invited_user = nil, signup_confirm_url = nil)
|
instruments = nil, birth_date = nil, location = nil, musician = nil, photo_url = nil, invited_user = nil, signup_confirm_url = nil)
|
||||||
|
|
||||||
@user = User.new
|
@user = User.new
|
||||||
|
|
@ -33,7 +33,7 @@ class UserManager < BaseManager
|
||||||
# return @user # @user.errors.any? is true now
|
# return @user # @user.errors.any? is true now
|
||||||
#else
|
#else
|
||||||
# sends email to email account for confirmation
|
# sends email to email account for confirmation
|
||||||
@user = User.signup(first_name, last_name, email, password, password_confirmation, terms_of_service, subscribe_email,
|
@user = User.signup(first_name, last_name, email, password, password_confirmation, terms_of_service,
|
||||||
location, instruments, birth_date, musician, photo_url, invited_user, signup_confirm_url)
|
location, instruments, birth_date, musician, photo_url, invited_user, signup_confirm_url)
|
||||||
|
|
||||||
return @user
|
return @user
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ FactoryGirl.define do
|
||||||
state "NC"
|
state "NC"
|
||||||
country "USA"
|
country "USA"
|
||||||
terms_of_service true
|
terms_of_service true
|
||||||
|
subscribe_email true
|
||||||
|
|
||||||
|
|
||||||
factory :admin do
|
factory :admin do
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ describe "Account", :js => true, :type => :feature, :capybara_feature => true do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
UserMailer.deliveries.clear
|
UserMailer.deliveries.clear
|
||||||
sign_in_poltergeist user
|
sign_in_poltergeist user
|
||||||
visit "/#/account"
|
visit "/client#/account"
|
||||||
|
|
||||||
find('div.account-mid.identity')
|
find('div.account-mid.identity')
|
||||||
end
|
end
|
||||||
|
|
@ -92,12 +92,18 @@ describe "Account", :js => true, :type => :feature, :capybara_feature => true do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
fill_in "first_name", with: "Bobby"
|
fill_in "first_name", with: "Bobby"
|
||||||
fill_in "last_name", with: "Toes"
|
fill_in "last_name", with: "Toes"
|
||||||
|
find('input[name=subscribe_email]').set(false)
|
||||||
find("#account-edit-profile-submit").trigger(:click)
|
find("#account-edit-profile-submit").trigger(:click)
|
||||||
end
|
end
|
||||||
|
|
||||||
it {
|
it {
|
||||||
|
user.subscribe_email.should be_true
|
||||||
should have_selector('h1', text: 'my account')
|
should have_selector('h1', text: 'my account')
|
||||||
should have_selector('#notification h2', text: 'Profile Changed')
|
should have_selector('#notification h2', text: 'Profile Changed')
|
||||||
|
user.reload
|
||||||
|
user.subscribe_email.should be_false
|
||||||
|
user.first_name.should == "Bobby"
|
||||||
|
user.last_name.should == "Toes"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ describe "Find Session", :js => true, :type => :feature, :capybara_feature => tr
|
||||||
MusicSession.delete_all
|
MusicSession.delete_all
|
||||||
|
|
||||||
sign_in_poltergeist user
|
sign_in_poltergeist user
|
||||||
visit "/#/findSession"
|
visit "/client#/findSession"
|
||||||
|
|
||||||
# verify no sessions are found
|
# verify no sessions are found
|
||||||
expect(page).to have_selector('#sessions-none-found')
|
expect(page).to have_selector('#sessions-none-found')
|
||||||
|
|
@ -38,7 +38,7 @@ describe "Find Session", :js => true, :type => :feature, :capybara_feature => tr
|
||||||
in_client(:one) do
|
in_client(:one) do
|
||||||
page.driver.resize(1500, 600) # crude hack
|
page.driver.resize(1500, 600) # crude hack
|
||||||
sign_in_poltergeist user
|
sign_in_poltergeist user
|
||||||
visit "/#/createSession"
|
visit "/client#/createSession"
|
||||||
|
|
||||||
within('#create-session-form') do
|
within('#create-session-form') do
|
||||||
fill_in('description', :with => @unique_session_desc)
|
fill_in('description', :with => @unique_session_desc)
|
||||||
|
|
@ -54,7 +54,7 @@ describe "Find Session", :js => true, :type => :feature, :capybara_feature => tr
|
||||||
# find session in second client
|
# find session in second client
|
||||||
in_client(:two) do
|
in_client(:two) do
|
||||||
sign_in_poltergeist finder
|
sign_in_poltergeist finder
|
||||||
visit "/#/findSession"
|
visit "/client#/findSession"
|
||||||
|
|
||||||
# verify the session description is seen by second client
|
# verify the session description is seen by second client
|
||||||
expect(page).to have_text(@unique_session_desc)
|
expect(page).to have_text(@unique_session_desc)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
|
||||||
describe "signup page" do
|
describe "signup page" do
|
||||||
before { visit signup_path }
|
before { visit signup_path }
|
||||||
|
|
||||||
it { should have_selector('h1', text: 'create a jamkazam account') }
|
it { should have_selector('h2', text: 'Create a JamKazam account') }
|
||||||
|
|
||||||
describe "with valid musician information" do
|
describe "with valid musician information" do
|
||||||
before do
|
before do
|
||||||
|
|
@ -147,6 +147,7 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
|
||||||
click_button "CREATE ACCOUNT"
|
click_button "CREATE ACCOUNT"
|
||||||
page.should have_title("JamKazam")
|
page.should have_title("JamKazam")
|
||||||
should have_selector('div.tagline', text: "Congratulations!")
|
should have_selector('div.tagline', text: "Congratulations!")
|
||||||
|
sign_out
|
||||||
visit "#{signup_path}?invitation_code=#{@invited_user.invitation_code}"
|
visit "#{signup_path}?invitation_code=#{@invited_user.invitation_code}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -180,6 +181,7 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
|
||||||
UserMailer.deliveries.length.should == 1
|
UserMailer.deliveries.length.should == 1
|
||||||
uri = URI.parse(current_url)
|
uri = URI.parse(current_url)
|
||||||
"#{uri.path}?#{uri.query}".should == congratulations_musician_path(:type => 'Native')
|
"#{uri.path}?#{uri.query}".should == congratulations_musician_path(:type => 'Native')
|
||||||
|
sign_out
|
||||||
visit "#{signup_path}?invitation_code=#{@invited_user.invitation_code}"
|
visit "#{signup_path}?invitation_code=#{@invited_user.invitation_code}"
|
||||||
should have_selector('h1', text: "You have already signed up with this invitation")
|
should have_selector('h1', text: "You have already signed up with this invitation")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ describe "User Progression", :js => true, :type => :feature, :capybara_feature
|
||||||
describe "certified gear" do
|
describe "certified gear" do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
sign_in_poltergeist user
|
sign_in_poltergeist user
|
||||||
visit '/#/account/audio'
|
visit '/client#/account/audio'
|
||||||
find("div.account-audio a[data-purpose='add-profile']").trigger(:click)
|
find("div.account-audio a[data-purpose='add-profile']").trigger(:click)
|
||||||
find("a[layout-wizard-link='2']").trigger(:click) # NEXT
|
find("a[layout-wizard-link='2']").trigger(:click) # NEXT
|
||||||
find("a[layout-wizard-link='3']").trigger(:click) # NEXT
|
find("a[layout-wizard-link='3']").trigger(:click) # NEXT
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ describe UserManager do
|
||||||
MaxMindIsp.delete_all # prove that city/state/country will remain nil if no maxmind data
|
MaxMindIsp.delete_all # prove that city/state/country will remain nil if no maxmind data
|
||||||
MaxMindGeo.delete_all
|
MaxMindGeo.delete_all
|
||||||
|
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman1@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman1@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
@user.first_name.should == "bob"
|
@user.first_name.should == "bob"
|
||||||
|
|
@ -26,13 +26,14 @@ describe UserManager do
|
||||||
@user.state.should be_nil
|
@user.state.should be_nil
|
||||||
@user.country.should be_nil
|
@user.country.should be_nil
|
||||||
@user.instruments.length.should == 1
|
@user.instruments.length.should == 1
|
||||||
|
@user.subscribe_email.should be_true
|
||||||
@user.signup_token.should_not be_nil
|
@user.signup_token.should_not be_nil
|
||||||
|
|
||||||
UserMailer.deliveries.length.should == 1
|
UserMailer.deliveries.length.should == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
it "signup successfully with instruments" do
|
it "signup successfully with instruments" do
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman2@jamkazam.com", "foobar", "foobar", true, nil,
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman2@jamkazam.com", "foobar", "foobar", true,
|
||||||
@instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
|
@instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
|
|
@ -43,7 +44,7 @@ describe UserManager do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "doesnt fail if ip address is nil" do
|
it "doesnt fail if ip address is nil" do
|
||||||
@user = @user_manager.signup(nil, "bob", "smith", "userman3@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
@user = @user_manager.signup(nil, "bob", "smith", "userman3@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
@user.city.should be_nil
|
@user.city.should be_nil
|
||||||
|
|
@ -55,7 +56,7 @@ describe UserManager do
|
||||||
MaxMindManager.active_record_transaction do |manager|
|
MaxMindManager.active_record_transaction do |manager|
|
||||||
manager.create_phony_database()
|
manager.create_phony_database()
|
||||||
end
|
end
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman4@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman4@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
@user.city.should == 'City 127'
|
@user.city.should == 'City 127'
|
||||||
|
|
@ -67,7 +68,7 @@ describe UserManager do
|
||||||
MaxMindManager.active_record_transaction do |manager|
|
MaxMindManager.active_record_transaction do |manager|
|
||||||
manager.create_phony_database()
|
manager.create_phony_database()
|
||||||
end
|
end
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman5@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, @location, true, nil, nil, "http://localhost:3000/confirm" )
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman5@jamkazam.com", "foobar", "foobar", true, @instruments, nil, @location, true, nil, nil, "http://localhost:3000/confirm" )
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
@user.city.should == 'Little Rock'
|
@user.city.should == 'Little Rock'
|
||||||
|
|
@ -79,7 +80,7 @@ describe UserManager do
|
||||||
MaxMindManager.active_record_transaction do |manager|
|
MaxMindManager.active_record_transaction do |manager|
|
||||||
manager.create_phony_database()
|
manager.create_phony_database()
|
||||||
end
|
end
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman6@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, {}, true, nil, nil, "http://localhost:3000/confirm" )
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman6@jamkazam.com", "foobar", "foobar", true, @instruments, nil, {}, true, nil, nil, "http://localhost:3000/confirm" )
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
@user.city.should be_nil
|
@user.city.should be_nil
|
||||||
|
|
@ -92,7 +93,7 @@ describe UserManager do
|
||||||
MaxMindManager.active_record_transaction do |manager|
|
MaxMindManager.active_record_transaction do |manager|
|
||||||
manager.create_phony_database()
|
manager.create_phony_database()
|
||||||
end
|
end
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman7@jamkazam.com", "foobar", "foobar", true, nil, @instruments, Date.new(2001, 1, 1), nil, true, nil, nil, "http://localhost:3000/confirm" )
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman7@jamkazam.com", "foobar", "foobar", true, @instruments, Date.new(2001, 1, 1), nil, true, nil, nil, "http://localhost:3000/confirm" )
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
@user.birth_date.should == Date.new(2001, 1, 1)
|
@user.birth_date.should == Date.new(2001, 1, 1)
|
||||||
|
|
@ -100,26 +101,26 @@ describe UserManager do
|
||||||
|
|
||||||
|
|
||||||
it "duplicate signup failure" do
|
it "duplicate signup failure" do
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman8@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman8@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
|
||||||
UserMailer.deliveries.length.should == 1
|
UserMailer.deliveries.length.should == 1
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
|
|
||||||
# exactly the same parameters; should dup on email, and send no email
|
# exactly the same parameters; should dup on email, and send no email
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman8@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman8@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
|
||||||
UserMailer.deliveries.length.should == 1
|
UserMailer.deliveries.length.should == 1
|
||||||
@user.errors.any?.should be_true
|
@user.errors.any?.should be_true
|
||||||
@user.errors[:email][0].should == "has already been taken"
|
@user.errors[:email][0].should == "has already been taken"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "fail on no username" do
|
it "fail on no username" do
|
||||||
@user = @user_manager.signup("127.0.0.1", "", "", "userman10@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
|
@user = @user_manager.signup("127.0.0.1", "", "", "userman10@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
|
||||||
UserMailer.deliveries.length.should == 0
|
UserMailer.deliveries.length.should == 0
|
||||||
@user.errors.any?.should be_true
|
@user.errors.any?.should be_true
|
||||||
@user.errors[:first_name][0].should == "can't be blank"
|
@user.errors[:first_name][0].should == "can't be blank"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "fail on no email" do
|
it "fail on no email" do
|
||||||
@user = @user_manager.signup("127.0.0.1", "murp", "blurp", "", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
@user = @user_manager.signup("127.0.0.1", "murp", "blurp", "", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
||||||
UserMailer.deliveries.length.should == 0
|
UserMailer.deliveries.length.should == 0
|
||||||
@user.errors.any?.should be_true
|
@user.errors.any?.should be_true
|
||||||
@user.errors[:email][0].should == "can't be blank"
|
@user.errors[:email][0].should == "can't be blank"
|
||||||
|
|
@ -129,7 +130,7 @@ describe UserManager do
|
||||||
|
|
||||||
describe "signup_confirm" do
|
describe "signup_confirm" do
|
||||||
it "fail on no username" do
|
it "fail on no username" do
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman11@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman11@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
|
||||||
@user = @user_manager.signup_confirm(@user.signup_token)
|
@user = @user_manager.signup_confirm(@user.signup_token)
|
||||||
@user.email_confirmed.should be_true
|
@user.email_confirmed.should be_true
|
||||||
end
|
end
|
||||||
|
|
@ -155,7 +156,7 @@ describe UserManager do
|
||||||
|
|
||||||
@invitation.accepted.should be_false
|
@invitation.accepted.should be_false
|
||||||
|
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true, nil,
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true,
|
||||||
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
|
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
|
|
@ -175,7 +176,7 @@ describe UserManager do
|
||||||
UserMailer.deliveries.clear
|
UserMailer.deliveries.clear
|
||||||
|
|
||||||
|
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true, nil,
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true,
|
||||||
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
|
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
|
|
@ -195,7 +196,7 @@ describe UserManager do
|
||||||
UserMailer.deliveries.clear
|
UserMailer.deliveries.clear
|
||||||
|
|
||||||
|
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true, nil,
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true,
|
||||||
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
|
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
|
|
@ -217,7 +218,7 @@ describe UserManager do
|
||||||
UserMailer.deliveries.clear
|
UserMailer.deliveries.clear
|
||||||
|
|
||||||
|
|
||||||
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman12@jamkazam.com", "foobar", "foobar", true, nil,
|
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman12@jamkazam.com", "foobar", "foobar", true,
|
||||||
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
|
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
|
||||||
|
|
||||||
@user.errors.any?.should be_false
|
@user.errors.any?.should be_false
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,14 @@ def sign_in_poltergeist(user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sign_out()
|
||||||
|
if Capybara.javascript_driver == :poltergeist
|
||||||
|
page.driver.remove_cookie(:remember_token)
|
||||||
|
else
|
||||||
|
page.driver.browser.manage.remove_cookie :name => :remember_token
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def wait_for_ajax(wait=Capybara.default_wait_time)
|
def wait_for_ajax(wait=Capybara.default_wait_time)
|
||||||
wait = wait * 10 #(because we sleep .1)
|
wait = wait * 10 #(because we sleep .1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue