Refactor in preparation for Bootstrap 2.0
This commit is contained in:
parent
7dc7e2a4a3
commit
0d45efac05
5
Gemfile
5
Gemfile
|
@ -11,11 +11,6 @@ gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
|
|||
gem 'rack-contrib'
|
||||
gem 'validates_formatting_of'
|
||||
|
||||
platforms :jruby do
|
||||
gem 'jruby-openssl'
|
||||
gem 'therubyrhino'
|
||||
end
|
||||
|
||||
platforms :ruby_18 do
|
||||
gem 'fastercsv'
|
||||
end
|
||||
|
|
11
Gemfile.lock
11
Gemfile.lock
|
@ -48,10 +48,8 @@ GEM
|
|||
arel (3.0.0)
|
||||
bbenezech-nested_form (0.0.2)
|
||||
bcrypt-ruby (3.0.1)
|
||||
bcrypt-ruby (3.0.1-java)
|
||||
bootstrap-sass (1.4.3)
|
||||
sass-rails (~> 3.1)
|
||||
bouncy-castle-java (1.5.0146.1)
|
||||
builder (3.0.0)
|
||||
coffee-rails (3.2.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
|
@ -68,7 +66,6 @@ GEM
|
|||
warden (~> 1.1)
|
||||
erubis (2.7.0)
|
||||
eventmachine (0.12.10)
|
||||
eventmachine (0.12.10-java)
|
||||
execjs (1.2.13)
|
||||
multi_json (~> 1.0)
|
||||
fastercsv (1.5.4)
|
||||
|
@ -76,16 +73,12 @@ GEM
|
|||
haml (3.2.0.alpha.10)
|
||||
hike (1.2.1)
|
||||
hpricot (0.8.5)
|
||||
hpricot (0.8.5-java)
|
||||
i18n (0.6.0)
|
||||
journey (1.0.0)
|
||||
jquery-rails (2.0.0)
|
||||
railties (>= 3.2.0.beta, < 5.0)
|
||||
thor (~> 0.14)
|
||||
jruby-openssl (0.7.4)
|
||||
bouncy-castle-java
|
||||
json (1.6.5)
|
||||
json (1.6.5-java)
|
||||
kaminari (0.13.0)
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
|
@ -144,7 +137,6 @@ GEM
|
|||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
sqlite3 (1.3.5)
|
||||
therubyrhino (1.73.0)
|
||||
thin (1.3.1)
|
||||
daemons (>= 1.0.9)
|
||||
eventmachine (>= 0.12.6)
|
||||
|
@ -167,7 +159,6 @@ GEM
|
|||
crack (>= 0.1.7)
|
||||
|
||||
PLATFORMS
|
||||
java
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
|
@ -176,14 +167,12 @@ DEPENDENCIES
|
|||
fastercsv
|
||||
geokit
|
||||
haml (~> 3.2.0.alpha)
|
||||
jruby-openssl
|
||||
pg
|
||||
rack-contrib
|
||||
rails (~> 3.2.0.rc2)
|
||||
rails_admin!
|
||||
simplecov
|
||||
sqlite3
|
||||
therubyrhino
|
||||
thin
|
||||
uglifier
|
||||
validates_formatting_of
|
||||
|
|
|
@ -1,30 +1,37 @@
|
|||
$(function() {
|
||||
var center = new google.maps.LatLng(42.358431, -71.059773);
|
||||
var zoomLevel = 15;
|
||||
var mapOptions = {
|
||||
center: center,
|
||||
disableDoubleClickZoom: true,
|
||||
keyboardShortcuts: false,
|
||||
mapTypeControl: false,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
||||
panControl: false,
|
||||
rotateControl: false,
|
||||
scaleControl: false,
|
||||
scrollwheel: false,
|
||||
zoom: zoomLevel,
|
||||
streetViewControl: true,
|
||||
zoom: 15,
|
||||
zoomControl: false
|
||||
};
|
||||
};
|
||||
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
|
||||
var size = new google.maps.Size(27.0, 37.0);
|
||||
var origin = new google.maps.Point(0, 0);
|
||||
var anchor = new google.maps.Point(13.0, 18.0);
|
||||
var greenMarkerImage = new google.maps.MarkerImage('<%= image_path 'markers/green.png' %>',
|
||||
new google.maps.Size(27.0, 37.0),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(13.0, 18.0)
|
||||
size,
|
||||
origin,
|
||||
anchor
|
||||
);
|
||||
var redMarkerImage = new google.maps.MarkerImage('<%= image_path 'markers/red.png' %>',
|
||||
new google.maps.Size(27.0, 37.0),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(13.0, 18.0)
|
||||
size,
|
||||
origin,
|
||||
anchor
|
||||
);
|
||||
var markerShadowImage = new google.maps.MarkerImage('<%= image_path 'markers/shadow.png' %>',
|
||||
new google.maps.Size(46.0, 37.0),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(13.0, 18.0)
|
||||
origin,
|
||||
anchor
|
||||
);
|
||||
var activeThingId;
|
||||
var activeMarker;
|
||||
|
@ -49,7 +56,7 @@ $(function() {
|
|||
activeInfoWindow.close();
|
||||
}
|
||||
var infoWindow = new google.maps.InfoWindow({
|
||||
maxWidth: 232
|
||||
maxWidth: 210
|
||||
});
|
||||
google.maps.event.addListener(infoWindow, 'closeclick', function() {
|
||||
isWindowOpen = false;
|
||||
|
@ -93,8 +100,7 @@ $(function() {
|
|||
success: function(data) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
if(data.errors) {
|
||||
$('#address_label').addClass('error', 500);
|
||||
$('#address').addClass('error', 500);
|
||||
$('#address').parent().addClass('error');
|
||||
$('#address').focus();
|
||||
} else {
|
||||
$('#address_label').removeClass('error', 500);
|
||||
|
@ -117,7 +123,7 @@ $(function() {
|
|||
addMarker(thing.id, point, color);
|
||||
}, i * 100);
|
||||
});
|
||||
map.setZoom(18);
|
||||
map.setZoom(19);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -131,8 +137,7 @@ $(function() {
|
|||
$(submitButton).attr("disabled", true);
|
||||
if($('#address').val() === '') {
|
||||
$(submitButton).attr("disabled", false);
|
||||
$('#address_label').addClass('error', 500);
|
||||
$('#address').addClass('error', 500);
|
||||
$('#address').parent().addClass('error');
|
||||
$('#address').focus();
|
||||
} else {
|
||||
$.ajax({
|
||||
|
@ -146,15 +151,13 @@ $(function() {
|
|||
},
|
||||
error: function(jqXHR) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
$('#address_label').addClass('error', 500);
|
||||
$('#address').addClass('error', 500);
|
||||
$('#address').parent().addClass('error');
|
||||
$('#address').focus();
|
||||
},
|
||||
success: function(data) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
if(data.errors) {
|
||||
$('#address_label').addClass('error', 500);
|
||||
$('#address').addClass('error', 500);
|
||||
$('#address').parent().addClass('error');
|
||||
$('#address').focus();
|
||||
} else {
|
||||
$('#address_label').removeClass('error', 500);
|
||||
|
@ -214,28 +217,22 @@ $(function() {
|
|||
var errors = []
|
||||
if(!/[\w\.%\+\]+@[\w\]+\.+[\w]{2,}/.test($('#user_email').val())) {
|
||||
errors.push($('#user_email'));
|
||||
$('#user_email_label').addClass('error', 500);
|
||||
$('#user_email').addClass('error', 500);
|
||||
$('#user_email').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_email_label').removeClass('error');
|
||||
$('#user_email').removeClass('error');
|
||||
$('#user_email').parent().removeClass('error');
|
||||
}
|
||||
if(!$(this).data('state') || $(this).data('state') === 'user_sign_up') {
|
||||
if($('#user_name').val() === '') {
|
||||
errors.push($('#user_name'));
|
||||
$('#user_name_label').addClass('error', 500);
|
||||
$('#user_name').addClass('error', 500);
|
||||
$('#user_name').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_name_label').removeClass('error');
|
||||
$('#user_name').removeClass('error');
|
||||
$('#user_name').parent().removeClass('error');
|
||||
}
|
||||
if($('#user_password_confirmation').val().length < 6 || $('#user_password_confirmation').val().length > 20) {
|
||||
errors.push($('#user_password_confirmation'));
|
||||
$('#user_password_confirmation_label').addClass('error', 500);
|
||||
$('#user_password_confirmation').addClass('error', 500);
|
||||
$('#user_password_confirmation').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_password_confirmation_label').removeClass('error');
|
||||
$('#user_password_confirmation').removeClass('error');
|
||||
$('#user_password_confirmation').parent().removeClass('error');
|
||||
}
|
||||
if(errors.length > 0) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
|
@ -262,33 +259,27 @@ $(function() {
|
|||
$(submitButton).attr("disabled", false);
|
||||
if(data.errors.email) {
|
||||
errors.push($('#user_email'));
|
||||
$('#user_email_label').addClass('error', 500);
|
||||
$('#user_email').addClass('error', 500);
|
||||
$('#user_email').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.name) {
|
||||
errors.push($('#user_name'));
|
||||
$('#user_name_label').addClass('error', 500);
|
||||
$('#user_name').addClass('error', 500);
|
||||
$('#user_name').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.organization) {
|
||||
errors.push($('#user_organization'));
|
||||
$('#user_organization_label').addClass('error', 500);
|
||||
$('#user_organization').addClass('error', 500);
|
||||
$('#user_organization').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.voice_number) {
|
||||
errors.push($('#user_voice_number'));
|
||||
$('#user_voice_number_label').addClass('error', 500);
|
||||
$('#user_voice_number').addClass('error', 500);
|
||||
$('#user_voice_number').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.sms_number) {
|
||||
errors.push($('#user_sms_number'));
|
||||
$('#user_sms_number_label').addClass('error', 500);
|
||||
$('#user_sms_number').addClass('error', 500);
|
||||
$('#user_sms_number').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.password) {
|
||||
errors.push($('#user_password_confirmation'));
|
||||
$('#user_password_confirmation_label').addClass('error', 500);
|
||||
$('#user_password_confirmation').addClass('error', 500);
|
||||
$('#user_password_confirmation').parent().addClass('error');
|
||||
}
|
||||
errors[0].focus();
|
||||
},
|
||||
|
@ -311,11 +302,9 @@ $(function() {
|
|||
} else if($(this).data('state') === 'user_sign_in') {
|
||||
if($('#user_password').val().length < 6 || $('#user_password').val().length > 20) {
|
||||
errors.push($('#user_password'));
|
||||
$('#user_password_label').addClass('error', 500);
|
||||
$('#user_password').addClass('error', 500);
|
||||
$('#user_password').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_password_label').removeClass('error');
|
||||
$('#user_password').removeClass('error');
|
||||
$('#user_password').parent().removeClass('error');
|
||||
}
|
||||
if(errors.length > 0) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
|
@ -335,8 +324,7 @@ $(function() {
|
|||
},
|
||||
error: function(jqXHR) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
$('#user_password_label').addClass('error', 500);
|
||||
$('#user_password').addClass('error', 500);
|
||||
$('#user_password').parent().addClass('error');
|
||||
$('#user_password').focus();
|
||||
},
|
||||
success: function(data) {
|
||||
|
@ -372,8 +360,7 @@ $(function() {
|
|||
},
|
||||
error: function(jqXHR) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
$('#user_email_label').addClass('error', 500);
|
||||
$('#user_email').addClass('error', 500);
|
||||
$('#user_email').parent().addClass('error');
|
||||
$('#user_email').focus();
|
||||
},
|
||||
success: function() {
|
||||
|
@ -402,13 +389,7 @@ $(function() {
|
|||
'name': $('#thing_name').val()
|
||||
}
|
||||
},
|
||||
beforeSend: function() {
|
||||
$('#info_window').hide();
|
||||
$('#loader').show();
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
$('#loader').hide();
|
||||
$('#info_window').show();
|
||||
$(submitButton).attr("disabled", false);
|
||||
},
|
||||
success: function(data) {
|
||||
|
@ -422,7 +403,9 @@ $(function() {
|
|||
}
|
||||
},
|
||||
success: function(data) {
|
||||
activeInfoWindow.close();
|
||||
activeInfoWindow.setContent(data);
|
||||
activeInfoWindow.open(map, activeMarker);
|
||||
activeMarker.setIcon(greenMarkerImage);
|
||||
activeMarker.setAnimation(google.maps.Animation.BOUNCE);
|
||||
}
|
||||
|
@ -449,13 +432,7 @@ $(function() {
|
|||
'name': $('#thing_name').val()
|
||||
}
|
||||
},
|
||||
beforeSend: function() {
|
||||
$('#info_window').hide();
|
||||
$('#loader').show();
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
$('#loader').hide();
|
||||
$('#info_window').show();
|
||||
$(submitButton).attr("disabled", false);
|
||||
},
|
||||
success: function(data) {
|
||||
|
@ -469,7 +446,9 @@ $(function() {
|
|||
}
|
||||
},
|
||||
success: function(data) {
|
||||
activeInfoWindow.close();
|
||||
activeInfoWindow.setContent(data);
|
||||
activeInfoWindow.open(map, activeMarker);
|
||||
activeMarker.setIcon(redMarkerImage);
|
||||
activeMarker.setAnimation(null);
|
||||
}
|
||||
|
@ -479,18 +458,14 @@ $(function() {
|
|||
}
|
||||
return false;
|
||||
});
|
||||
$('#edit_profile_form').live('submit', function() {
|
||||
var submitButton = $("#edit_profile_form input[type='submit']");
|
||||
$(submitButton).attr("disabled", true);
|
||||
$('#edit_profile_link').live('click', function() {
|
||||
var link = $(this);
|
||||
$(link).addClass('disabled');
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/users/edit',
|
||||
data: {
|
||||
'utf8': '✓',
|
||||
'authenticity_token': $('#edit_profile_form input[name="authenticity_token"]').val()
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
$(link).removeClass('disabled');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#content').html(data);
|
||||
|
@ -504,43 +479,33 @@ $(function() {
|
|||
var errors = []
|
||||
if(!/[\w\.%\+\]+@[\w\]+\.+[\w]{2,}/.test($('#user_email').val())) {
|
||||
errors.push($('#user_email'));
|
||||
$('#user_email_label').addClass('error', 500);
|
||||
$('#user_email').addClass('error', 500);
|
||||
$('#user_email').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_email_label').removeClass('error');
|
||||
$('#user_email').removeClass('error');
|
||||
$('#user_email').parent().removeClass('error');
|
||||
}
|
||||
if($('#user_name').val() === '') {
|
||||
errors.push($('#user_name'));
|
||||
$('#user_name_label').addClass('error', 500);
|
||||
$('#user_name').addClass('error', 500);
|
||||
$('#user_name').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_name_label').removeClass('error');
|
||||
$('#user_name').removeClass('error');
|
||||
$('#user_name').parent().removeClass('error');
|
||||
}
|
||||
if($('#user_zip').val() != '' && !/^\d{5}(-\d{4})?$/.test($('#user_zip').val())) {
|
||||
errors.push($('#user_zip'));
|
||||
$('#user_zip_label').addClass('error', 500);
|
||||
$('#user_zip').addClass('error', 500);
|
||||
$('#user_zip').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_zip_label').removeClass('error');
|
||||
$('#user_zip').removeClass('error');
|
||||
$('#user_zip').parent().removeClass('error');
|
||||
}
|
||||
if($('#user_password').val() && ($('#user_password').val().length < 6 || $('#user_password').val().length > 20)) {
|
||||
errors.push($('#user_password'));
|
||||
$('#user_password_label').addClass('error', 500);
|
||||
$('#user_password').addClass('error', 500);
|
||||
$('#user_password').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_password_label').removeClass('error');
|
||||
$('#user_password').removeClass('error');
|
||||
$('#user_password').parent().removeClass('error');
|
||||
}
|
||||
if($('#user_current_password').val().length < 6 || $('#user_current_password').val().length > 20) {
|
||||
errors.push($('#user_current_password'));
|
||||
$('#user_current_password_label').addClass('error', 500);
|
||||
$('#user_current_password').addClass('error', 500);
|
||||
$('#user_current_password').parent().addClass('error');
|
||||
} else {
|
||||
$('#user_current_password_label').removeClass('error');
|
||||
$('#user_current_password').removeClass('error');
|
||||
$('#user_current_password').parent().removeClass('error');
|
||||
}
|
||||
if(errors.length > 0) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
|
@ -576,63 +541,51 @@ $(function() {
|
|||
$(submitButton).attr("disabled", false);
|
||||
if(data.errors.email) {
|
||||
errors.push($('#user_email'));
|
||||
$('#user_email_label').addClass('error', 500);
|
||||
$('#user_email').addClass('error', 500);
|
||||
$('#user_email').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.name) {
|
||||
errors.push($('#user_name'));
|
||||
$('#user_name_label').addClass('error', 500);
|
||||
$('#user_name').addClass('error', 500);
|
||||
$('#user_name').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.organization) {
|
||||
errors.push($('#user_organization'));
|
||||
$('#user_organization_label').addClass('error', 500);
|
||||
$('#user_organization').addClass('error', 500);
|
||||
$('#user_organization').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.voice_number) {
|
||||
errors.push($('#user_voice_number'));
|
||||
$('#user_voice_number_label').addClass('error', 500);
|
||||
$('#user_voice_number').addClass('error', 500);
|
||||
$('#user_voice_number').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.sms_number) {
|
||||
errors.push($('#user_sms_number'));
|
||||
$('#user_sms_number_label').addClass('error', 500);
|
||||
$('#user_sms_number').addClass('error', 500);
|
||||
$('#user_sms_number').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.address_1) {
|
||||
errors.push($('#user_address_1'));
|
||||
$('#user_address_1_label').addClass('error', 500);
|
||||
$('#user_address_1').addClass('error', 500);
|
||||
$('#user_address_1').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.address_2) {
|
||||
errors.push($('#user_address_2'));
|
||||
$('#user_address_2_label').addClass('error', 500);
|
||||
$('#user_address_2').addClass('error', 500);
|
||||
$('#user_address_2').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.city) {
|
||||
errors.push($('#user_city'));
|
||||
$('#user_city_label').addClass('error', 500);
|
||||
$('#user_city').addClass('error', 500);
|
||||
$('#user_city').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.state) {
|
||||
errors.push($('#user_state'));
|
||||
$('#user_state_label').addClass('error', 500);
|
||||
$('#user_state').addClass('error', 500);
|
||||
$('#user_state').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.zip) {
|
||||
errors.push($('#user_zip'));
|
||||
$('#user_zip_label').addClass('error', 500);
|
||||
$('#user_zip').addClass('error', 500);
|
||||
$('#user_zip').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.password) {
|
||||
errors.push($('#user_password'));
|
||||
$('#user_password_label').addClass('error', 500);
|
||||
$('#user_password').addClass('error', 500);
|
||||
$('#user_password').parent().addClass('error');
|
||||
}
|
||||
if(data.errors.current_password) {
|
||||
errors.push($('#user_current_password'));
|
||||
$('#user_current_password_label').addClass('error', 500);
|
||||
$('#user_current_password').addClass('error', 500);
|
||||
$('#user_current_password').parent().addClass('error');
|
||||
}
|
||||
errors[0].focus();
|
||||
},
|
||||
|
@ -643,18 +596,14 @@ $(function() {
|
|||
}
|
||||
return false;
|
||||
});
|
||||
$('#sign_out_form').live('submit', function() {
|
||||
var submitButton = $("#sign_out_form input[type='submit']");
|
||||
$(submitButton).attr("disabled", true);
|
||||
$('#sign_out_link').live('click', function() {
|
||||
var link = $(this);
|
||||
$(link).addClass('disabled');
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/users/sign_out.json',
|
||||
data: {
|
||||
'utf8': '✓',
|
||||
'authenticity_token': $('#sign_out_form input[name="authenticity_token"]').val()
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
$(link).removeClass('disabled');
|
||||
},
|
||||
success: function(data) {
|
||||
$.ajax({
|
||||
|
@ -679,33 +628,25 @@ $(function() {
|
|||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/users/sign_in',
|
||||
data: {
|
||||
'utf8': '✓',
|
||||
'authenticity_token': $('#sign_in_form input[name="authenticity_token"]').val(),
|
||||
},
|
||||
beforeSend: function() {
|
||||
$('#info_window').hide();
|
||||
$('#loader').show();
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
$('#loader').hide();
|
||||
$('#info_window').show();
|
||||
$(submitButton).attr("disabled", false);
|
||||
},
|
||||
success: function(data) {
|
||||
activeInfoWindow.close();
|
||||
activeInfoWindow.setContent(data);
|
||||
activeInfoWindow.open(map, activeMarker);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$('#back_form').live('submit', function() {
|
||||
var submitButton = $("#back_form input[type='submit']");
|
||||
$(submitButton).attr("disabled", true);
|
||||
$('#back_link').live('click', function() {
|
||||
var link = $(this);
|
||||
$(link).addClass('disabled');
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/sidebar/search',
|
||||
error: function(jqXHR) {
|
||||
$(submitButton).attr("disabled", false);
|
||||
$(link).removeClass('disabled');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#content').html(data);
|
||||
|
@ -728,13 +669,7 @@ $(function() {
|
|||
'thing_id': activeThingId
|
||||
}
|
||||
},
|
||||
beforeSend: function() {
|
||||
$('#info_window').hide();
|
||||
$('#loader').show();
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
$('#loader').hide();
|
||||
$('#info_window').show();
|
||||
$(submitButton).attr("disabled", false);
|
||||
},
|
||||
success: function(data) {
|
||||
|
@ -748,7 +683,9 @@ $(function() {
|
|||
}
|
||||
},
|
||||
success: function(data) {
|
||||
activeInfoWindow.close();
|
||||
activeInfoWindow.setContent(data);
|
||||
activeInfoWindow.open(map, activeMarker);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,12 +19,15 @@ h2 {
|
|||
}
|
||||
|
||||
form.form-stacked {
|
||||
padding-left: 10px;
|
||||
padding-left: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label, input {
|
||||
white-space: nowrap;
|
||||
form.form-stacked fieldset.control-group {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
@ -32,7 +35,7 @@ input {
|
|||
width: 200px;
|
||||
}
|
||||
|
||||
input, select, option, button, input[type="submit"] {
|
||||
.sidebar input, .sidebar select, .sidebar option, .sidebar button, .sidebar form.search-form input, .sidebar form.search-form select, .sidebar form.search-form option, .sidebar a.btn {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
@ -40,34 +43,110 @@ input, select, option, button, input[type="submit"] {
|
|||
input[type="radio"], input[type="checkbox"] {
|
||||
display: inline;
|
||||
width: auto;
|
||||
margin: 0 10px 10px 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
input#user_new {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
button.btn, input[type="submit"].btn {
|
||||
display: block;
|
||||
text-align: center;
|
||||
input#user_existing {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
form select, button.btn, input[type="submit"].btn {
|
||||
width: 210px;
|
||||
}
|
||||
|
||||
form label.error {
|
||||
/* Copied from Bootstrap 2.0-wip
|
||||
* Modifications:
|
||||
* width: 180px
|
||||
*/
|
||||
form input.search-query {
|
||||
-moz-border-radius: 14px;
|
||||
-webkit-border-radius: 14px;
|
||||
border-radius: 14px;
|
||||
margin-bottom: 0;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
p {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
a.btn {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
/* Copied from Bootstrap 2.0-wip */
|
||||
.control-group.error > label, .control-group.error .help-block, .control-group.error .help-inline {
|
||||
color: #b94a48;
|
||||
}
|
||||
|
||||
form input.error, form textarea.error {
|
||||
.control-group.error input, .control-group.error textarea {
|
||||
color: #b94a48;
|
||||
border-color: #ee5f5b;
|
||||
}
|
||||
|
||||
form input.error:focus, form textarea.error:focus {
|
||||
.control-group.error input:focus, .control-group.error textarea:focus {
|
||||
border-color: #e9322d;
|
||||
-webkit-box-shadow: 0 0 6px #f8b9b7;
|
||||
-moz-box-shadow: 0 0 6px #f8b9b7;
|
||||
box-shadow: 0 0 6px #f8b9b7;
|
||||
}
|
||||
|
||||
.control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on {
|
||||
color: #b94a48;
|
||||
background-color: #fce6e6;
|
||||
border-color: #b94a48;
|
||||
}
|
||||
|
||||
.control-group.warning > label, .control-group.warning .help-block, .control-group.warning .help-inline {
|
||||
color: #c09853;
|
||||
}
|
||||
|
||||
.control-group.warning input, .control-group.warning textarea {
|
||||
color: #c09853;
|
||||
border-color: #ccae64;
|
||||
}
|
||||
|
||||
.control-group.warning input:focus, .control-group.warning textarea:focus {
|
||||
border-color: #be9a3f;
|
||||
-webkit-box-shadow: 0 0 6px #e5d6b1;
|
||||
-moz-box-shadow: 0 0 6px #e5d6b1;
|
||||
box-shadow: 0 0 6px #e5d6b1;
|
||||
}
|
||||
|
||||
.control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on {
|
||||
color: #c09853;
|
||||
background-color: #d2b877;
|
||||
border-color: #c09853;
|
||||
}
|
||||
|
||||
.control-group.success > label, .control-group.success .help-block, .control-group.success .help-inline {
|
||||
color: #468847;
|
||||
}
|
||||
|
||||
.control-group.success input, .control-group.success textarea {
|
||||
color: #468847;
|
||||
border-color: #57a957;
|
||||
}
|
||||
|
||||
.control-group.success input:focus, .control-group.success textarea:focus {
|
||||
border-color: #458845;
|
||||
-webkit-box-shadow: 0 0 6px #9acc9a;
|
||||
-moz-box-shadow: 0 0 6px #9acc9a;
|
||||
box-shadow: 0 0 6px #9acc9a;
|
||||
}
|
||||
|
||||
.control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on {
|
||||
color: #468847;
|
||||
background-color: #bcddbc;
|
||||
border-color: #468847;
|
||||
}
|
||||
|
||||
.table {
|
||||
display: table;
|
||||
height: 100%;
|
||||
|
@ -84,32 +163,49 @@ form input.error:focus, form textarea.error:focus {
|
|||
vertical-align: top;
|
||||
}
|
||||
|
||||
.alert-message {
|
||||
.alert-message.block-message {
|
||||
padding: 8px 12px 8px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.sidebar .alert-message.block-message {
|
||||
-webkit-border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
border-radius: 0;
|
||||
text-align: left;
|
||||
margin-bottom: 10px;
|
||||
padding: 8px 20px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 252px;
|
||||
width: 250px;
|
||||
border-right: 1px solid #ccc;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sidebar form.form-stacked {
|
||||
padding-left: 20px;
|
||||
.sidebar fieldset.control-group {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.sidebar p {
|
||||
width: 210px;
|
||||
/* Copied from Bootstrap 2.0-wip
|
||||
* Modifications:
|
||||
* padding-bottom: 10px
|
||||
* margin-top: 10px
|
||||
* margin-bottom: 10px
|
||||
*/
|
||||
.sidebar fieldset.form-actions {
|
||||
padding: 17px 20px 10px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #f5f5f5;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.sidebar p#tagline {
|
||||
color: #ffffff;
|
||||
padding: 10px 20px;
|
||||
background-color: #c43c35;
|
||||
background-repeat: repeat-x;
|
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
|
||||
|
@ -119,11 +215,12 @@ form input.error:focus, form textarea.error:focus {
|
|||
background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
|
||||
background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
|
||||
background-image: linear-gradient(top, #ee5f5b, #c43c35);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
border-color: #c43c35 #c43c35 #882a25;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
|
||||
padding: 10px 20px;
|
||||
text-align: center;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.sidebar #logos img {
|
||||
|
|
|
@ -2,7 +2,7 @@ class ThingsController < ApplicationController
|
|||
respond_to :json
|
||||
|
||||
def show
|
||||
@things = Thing.find_closest(params[:lat], params[:lng], params[:limit] || 40)
|
||||
@things = Thing.find_closest(params[:lat], params[:lng], params[:limit] || 10)
|
||||
unless @things.blank?
|
||||
respond_with @things
|
||||
else
|
||||
|
|
|
@ -4,7 +4,7 @@ class Thing < ActiveRecord::Base
|
|||
belongs_to :user
|
||||
has_many :reminders
|
||||
|
||||
def self.find_closest(lat, lng, limit=40)
|
||||
def self.find_closest(lat, lng, limit=10)
|
||||
query = <<-SQL
|
||||
SELECT *, (3959 * ACOS(COS(RADIANS(?)) * COS(RADIANS(lat)) * COS(radians(lng) - RADIANS(?)) + SIN(RADIANS(?)) * SIN(RADIANS(lat)))) AS distance
|
||||
FROM things
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
- if flash[:notice]
|
||||
.alert-message.success{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
.alert-message.block-message.info.fade.in{:"data-alert" => true}
|
||||
%a{:class => "close", :"data-dismiss" => "alert", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:notice]
|
||||
- if flash[:warning]
|
||||
.alert-message.warning{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
.alert-message.block-message.warning.fade.in{:"data-alert" => true}
|
||||
%a{:class => "close", :"data-dismiss" => "alert", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:warning]
|
||||
- if flash[:error]
|
||||
.alert-message.error{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
.alert-message.block-message.error.fade.in{:"data-alert" => true}
|
||||
%a{:class => "close", :"data-dismiss" => "alert", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:error]
|
||||
|
|
|
@ -3,18 +3,21 @@
|
|||
%head
|
||||
%title
|
||||
= t("titles.main", :thing => t("defaults.thing").titleize)
|
||||
= stylesheet_link_tag "http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"
|
||||
= stylesheet_link_tag "screen"
|
||||
= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false"
|
||||
= csrf_meta_tag
|
||||
%meta{:name => "viewport", :content => "width=800, user-scalable=no"}
|
||||
/ HTML5 shim, for IE6-8 support of HTML5 elements
|
||||
/[if lt IE 9]
|
||||
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
|
||||
= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false&language=#{I18n.locale}"
|
||||
= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"
|
||||
= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"
|
||||
= javascript_include_tag "http://twitter.github.com/bootstrap/1.4.0/bootstrap-twipsy.min.js"
|
||||
= javascript_include_tag "http://twitter.github.com/bootstrap/1.4.0/bootstrap-alerts.min.js"
|
||||
= javascript_include_tag "http://twitter.github.com/bootstrap/1.4.0/bootstrap-modal.min.js"
|
||||
= javascript_include_tag "main"
|
||||
= csrf_meta_tag
|
||||
%meta{:name => "viewport", :content => "width=800, user-scalable=no"}
|
||||
%script{:type => "text/javascript"}
|
||||
var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-20825280-2"]),_gaq.push(["_setDomainName",".adoptahydrant.org"]),_gaq.push(["_trackPageview"]),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}();
|
||||
= stylesheet_link_tag "http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"
|
||||
= stylesheet_link_tag "screen"
|
||||
%body
|
||||
= yield
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#loader{:style => "display: none;"}
|
||||
= image_tag "ajax-loader.gif"
|
||||
#info_window
|
||||
= render :partial => "layouts/flash", :locals => {:flash => flash}
|
||||
= yield
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
.table-cell.sidebar
|
||||
%h1
|
||||
= image_tag "logos/adopt-a-hydrant.png", :alt => t("titles.main", :thing => t("defaults.thing").titleize), :title => t("titles.main", :thing => t("defaults.thing").titleize)
|
||||
%p.alert-message#tagline
|
||||
%p.alert-message.block-message#tagline
|
||||
= t("defaults.tagline")
|
||||
#content
|
||||
= render :partial => "layouts/flash", :locals => {:flash => flash}
|
||||
|
@ -17,8 +17,9 @@
|
|||
%a{:href => "http://bostonbuilt.org/"}
|
||||
= image_tag "logos/boston.png", :alt => t("sponsors.city"), :title => t("sponsors.city")
|
||||
#feedback
|
||||
%a{:href => URI.escape("mailto:adoptahydrant@cityofboston.gov?subject=#{t("titles.main", :thing => t("defaults.thing").titleize)} #{t("links.feedback").titleize}")}
|
||||
= t("links.feedback")
|
||||
%p
|
||||
%a{:href => URI.escape("mailto:adoptahydrant@cityofboston.gov?subject=#{t("titles.main", :thing => t("defaults.thing").titleize)} #{t("links.feedback").titleize}")}
|
||||
= t("links.feedback")
|
||||
.table-cell.map-container
|
||||
#map
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
.table-cell.sidebar
|
||||
%h1
|
||||
= image_tag "logos/adopt-a-hydrant.png", :alt => t("titles.main", :thing => t("defaults.thing").titleize), :title => t("titles.main", :thing => t("defaults.thing").titleize)
|
||||
%p.alert-message#tagline
|
||||
%p.alert-message.block-message#tagline
|
||||
= t("defaults.tagline")
|
||||
#content
|
||||
= render :partial => "sidebar/combo_form"
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
%h2
|
||||
= t("titles.edit_profile")
|
||||
= form_for resource, :as => resource_name, :url => password_path(resource_name), :html => {:id => "edit_form", :class => "form-stacked", :method => :put} do |f|
|
||||
%h2
|
||||
= t("titles.edit_profile")
|
||||
= f.hidden_field "reset_password_token"
|
||||
= f.label "password", t("labels.password_new"), :id => "user_password_label"
|
||||
= f.password_field "password"
|
||||
= f.submit t("buttons.change_password"), :class => "btn"
|
||||
%fieldset.control-group
|
||||
= f.label "password", t("labels.password_new"), :id => "user_password_label"
|
||||
= f.password_field "password"
|
||||
%fieldset.form-actions
|
||||
= f.submit t("buttons.change_password"), :class => "btn"
|
||||
|
|
|
@ -1,53 +1,65 @@
|
|||
= form_for :user, :html => {:id => "combo-form", :class => "form-stacked"} do |f|
|
||||
#common_fields
|
||||
%label{:for => "user_email", :id => "user_email_label"}
|
||||
= t("labels.email")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.email_field "email", :value => params[:user] ? params[:user][:email] : nil
|
||||
= f.label "new" , radio_button_tag("user", "new", true).html_safe + t("labels.user_new")
|
||||
= f.label "existing", radio_button_tag("user", "existing").html_safe + t("labels.user_existing")
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_email", :id => "user_email_label"}
|
||||
= t("labels.email")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.email_field "email", :value => params[:user] ? params[:user][:email] : nil
|
||||
%fieldset.control-group.radio
|
||||
= f.label "new" , radio_button_tag("user", "new", true).html_safe + t("labels.user_new")
|
||||
= f.label "existing", radio_button_tag("user", "existing").html_safe + t("labels.user_existing")
|
||||
#user_sign_up_fields
|
||||
%label{:for => "user_name", :id => "user_name_label"}
|
||||
= t("labels.name")
|
||||
%small
|
||||
= t("captions.public")
|
||||
= f.text_field "name"
|
||||
%label{:for => "user_organization", :id => "user_organization_label"}
|
||||
= t("labels.organization")
|
||||
%small
|
||||
= t("captions.public")
|
||||
= f.text_field "organization"
|
||||
%label{:for => "user_voice_number", :id => "user_voice_number_label"}
|
||||
= t("labels.voice_number")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.telephone_field "voice_number", :placeholder => t("defaults.voice_number")
|
||||
%label{:for => "user_sms_number", :id => "user_sms_number_label"}
|
||||
= t("labels.sms_number")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.telephone_field "sms_number", :placeholder => t("defaults.sms_number")
|
||||
%label{:for => "user_password_confirmation", :id => "user_password_confirmation_label"}
|
||||
= t("labels.password_choose")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.password_field "password_confirmation"
|
||||
= f.submit t("buttons.sign_up"), :class => "btn primary"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_name", :id => "user_name_label"}
|
||||
= t("labels.name")
|
||||
%small
|
||||
= t("captions.public")
|
||||
= f.text_field "name"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_organization", :id => "user_organization_label"}
|
||||
= t("labels.organization")
|
||||
%small
|
||||
= t("captions.public")
|
||||
= f.text_field "organization"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_voice_number", :id => "user_voice_number_label"}
|
||||
= t("labels.voice_number")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.telephone_field "voice_number", :placeholder => t("defaults.voice_number")
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_sms_number", :id => "user_sms_number_label"}
|
||||
= t("labels.sms_number")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.telephone_field "sms_number", :placeholder => t("defaults.sms_number")
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_password_confirmation", :id => "user_password_confirmation_label"}
|
||||
= t("labels.password_choose")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.password_field "password_confirmation"
|
||||
%fieldset.form-actions
|
||||
= f.submit t("buttons.sign_up"), :class => "btn primary"
|
||||
%p
|
||||
= t("defaults.tos", :tos => link_to(t("titles.tos"), "#", :id => "tos_link", :"data-controls-modal" => "tos")).html_safe
|
||||
#user_sign_in_fields{:style => "display: none;"}
|
||||
%label{:for => "user_password", :id => "user_password_label"}
|
||||
= t("labels.password")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.password_field "password"
|
||||
= f.label "remember_me" , f.check_box("remember_me", :checked => true).html_safe + t("labels.remember_me")
|
||||
= f.submit t("buttons.sign_in"), :class => "btn primary"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_password", :id => "user_password_label"}
|
||||
= t("labels.password")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.password_field "password"
|
||||
%fieldset.control-group
|
||||
= f.label "remember_me" , f.check_box("remember_me", :checked => true).html_safe + t("labels.remember_me")
|
||||
%fieldset.form-actions
|
||||
= f.submit t("buttons.sign_in"), :class => "btn primary"
|
||||
%p
|
||||
= link_to t("links.forgot_password"), "#", :id => "user_forgot_password_link"
|
||||
#user_forgot_password_fields{:style => "display: none;"}
|
||||
= f.submit t("buttons.email_password"), :class => "btn primary"
|
||||
%fieldset.form-actions
|
||||
= f.submit t("buttons.email_password"), :class => "btn primary"
|
||||
%p
|
||||
= link_to t("links.remembered_password"), "#", :id => "user_remembered_password_link"
|
||||
= render :partial => "sidebar/tos"
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
= form_tag "/address", :method => "get", :id => "address_form", :class => "form-stacked" do
|
||||
= label_tag "city_state", t("labels.city_state"), :id => "city_state_label"
|
||||
= select_tag "city_state", "<option value=\"#{t("defaults.city_state")}\" selected=\"selected\">#{t("defaults.city_state")}</option>".html_safe
|
||||
= label_tag "address", t("labels.address"), :id => "address_label"
|
||||
= search_field_tag "address", params[:address], :placeholder => [t("defaults.address_1"), t("defaults.neighborhood")].join(", ")
|
||||
= hidden_field_tag "limit", params[:limit] || 40
|
||||
= submit_tag t("buttons.find", :thing => t("defaults.thing").pluralize), :class => "btn primary"
|
||||
= form_for :user, :url => edit_user_registration_path, :html => {:id => "edit_profile_form", :class => "form-stacked", :method => "get"} do |f|
|
||||
= f.submit t("buttons.edit_profile"), :class => "btn"
|
||||
= form_for :sign_out, :html => {:id => "sign_out_form", :class => "form-stacked"} do |f|
|
||||
= f.submit t("buttons.sign_out"), :class => "btn danger"
|
||||
= form_tag "/address", :method => "get", :id => "address_form", :class => "search-form form-stacked" do
|
||||
= hidden_field_tag "limit", params[:limit] || 10
|
||||
%fieldset.control-group
|
||||
= label_tag "city_state", t("labels.city_state"), :id => "city_state_label"
|
||||
= select_tag "city_state", "<option value=\"#{t("defaults.city_state")}\" selected=\"selected\">#{t("defaults.city_state")}</option>".html_safe
|
||||
%fieldset.control-group
|
||||
= label_tag "address", t("labels.address"), :id => "address_label"
|
||||
= search_field_tag "address", params[:address], :placeholder => [t("defaults.address_1"), t("defaults.neighborhood")].join(", "), :class => "search-query"
|
||||
%fieldset.form-actions
|
||||
= submit_tag t("buttons.find", :thing => t("defaults.thing").pluralize), :class => "btn primary"
|
||||
%a{:href => edit_user_registration_path, :id => "edit_profile_link", :class => "btn"}
|
||||
= t("buttons.edit_profile")
|
||||
%a{:href => destroy_user_session_path, :id => "sign_out_link", :class => "btn danger"}
|
||||
= t("buttons.sign_out")
|
||||
:javascript
|
||||
$(function() {
|
||||
$('#address').focus();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.modal.hide.fade#tos
|
||||
.modal-header
|
||||
%a{:class => "close", :href => "#"}
|
||||
%a{:class => "close", :"data-dismiss" => "modal", :href => "#"}
|
||||
×
|
||||
%h2
|
||||
= t("titles.tos")
|
||||
|
|
|
@ -1,69 +1,81 @@
|
|||
= form_for resource, :as => resource_name, :url => registration_path(resource_name), :html => {:id => "edit_form", :class => "form-stacked", :method => :put} do |f|
|
||||
= f.hidden_field "id"
|
||||
%label{:for => "user_email", :id => "user_email_label"}
|
||||
= t("labels.email")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.email_field "email"
|
||||
%label{:for => "user_name", :id => "user_name_label"}
|
||||
= t("labels.name")
|
||||
%small
|
||||
= t("captions.public")
|
||||
= f.text_field "name"
|
||||
%label{:for => "user_organization", :id => "user_organization_label"}
|
||||
= t("labels.organization")
|
||||
%small
|
||||
= t("captions.public")
|
||||
= f.text_field "organization"
|
||||
%label{:for => "user_voice_number", :id => "user_voice_number_label"}
|
||||
= t("labels.voice_number")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.telephone_field "voice_number", :placeholder => t("defaults.voice_number"), :value => number_to_phone(f.object.voice_number)
|
||||
%label{:for => "user_sms_number", :id => "user_sms_number_label"}
|
||||
= t("labels.sms_number")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.telephone_field "sms_number", :placeholder => t("defaults.sms_number"), :value => number_to_phone(f.object.sms_number)
|
||||
%label{:for => "user_address_1", :id => "user_address_1_label"}
|
||||
= t("labels.address_1")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.text_field "address_1", :placeholder => t("defaults.address_1")
|
||||
%label{:for => "user_address_2", :id => "user_address_2_label"}
|
||||
= t("labels.address_2")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.text_field "address_2", :placeholder => t("defaults.address_2")
|
||||
%label{:for => "user_city", :id => "user_city_label"}
|
||||
= t("labels.city")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.text_field "city", :placeholder => t("defaults.city")
|
||||
%label{:for => "user_state", :id => "user_state_label"}
|
||||
= t("labels.state")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.select "state", us_states, :include_blank => true
|
||||
%label{:for => "user_zip", :id => "user_zip_label"}
|
||||
= t("labels.zip")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.text_field "zip", :placeholder => t("defaults.zip")
|
||||
%label{:for => "user_password", :id => "user_password_label"}
|
||||
= t("labels.password_new")
|
||||
%small
|
||||
= t("captions.optional")
|
||||
= f.password_field "password"
|
||||
%label{:for => "user_current_password", :id => "user_current_password_label"}
|
||||
= t("labels.current_password")
|
||||
%small
|
||||
= t("captions.required")
|
||||
= f.password_field "current_password"
|
||||
= f.submit t("buttons.update"), :class => "btn primary"
|
||||
= form_for :things, :url => root_path, :html => {:id => "back_form", :class => "form-stacked", :method => "get"} do |f|
|
||||
= f.hidden_field "id"
|
||||
= f.submit t("buttons.back"), :class => "btn"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_email", :id => "user_email_label"}
|
||||
= t("labels.email")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.email_field "email"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_name", :id => "user_name_label"}
|
||||
= t("labels.name")
|
||||
%small
|
||||
= t("captions.public")
|
||||
= f.text_field "name"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_organization", :id => "user_organization_label"}
|
||||
= t("labels.organization")
|
||||
%small
|
||||
= t("captions.public")
|
||||
= f.text_field "organization"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_voice_number", :id => "user_voice_number_label"}
|
||||
= t("labels.voice_number")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.telephone_field "voice_number", :placeholder => t("defaults.voice_number"), :value => number_to_phone(f.object.voice_number)
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_sms_number", :id => "user_sms_number_label"}
|
||||
= t("labels.sms_number")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.telephone_field "sms_number", :placeholder => t("defaults.sms_number"), :value => number_to_phone(f.object.sms_number)
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_address_1", :id => "user_address_1_label"}
|
||||
= t("labels.address_1")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.text_field "address_1", :placeholder => t("defaults.address_1")
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_address_2", :id => "user_address_2_label"}
|
||||
= t("labels.address_2")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.text_field "address_2", :placeholder => t("defaults.address_2")
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_city", :id => "user_city_label"}
|
||||
= t("labels.city")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.text_field "city", :placeholder => t("defaults.city")
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_state", :id => "user_state_label"}
|
||||
= t("labels.state")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.select "state", us_states, :include_blank => true
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_zip", :id => "user_zip_label"}
|
||||
= t("labels.zip")
|
||||
%small
|
||||
= image_tag "lock.png", :class => "lock", :alt => t("captions.private"), :title => t("captions.private")
|
||||
= f.text_field "zip", :placeholder => t("defaults.zip")
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_password", :id => "user_password_label"}
|
||||
= t("labels.password_new")
|
||||
%small
|
||||
= t("captions.optional")
|
||||
= f.password_field "password"
|
||||
%fieldset.control-group
|
||||
%label{:for => "user_current_password", :id => "user_current_password_label"}
|
||||
= t("labels.current_password")
|
||||
%small
|
||||
= t("captions.required")
|
||||
= f.password_field "current_password"
|
||||
%fieldset.form-actions
|
||||
= f.submit t("buttons.update"), :class => "btn primary"
|
||||
%a{:href => root_path, :id => "back_link", :class => "btn"}
|
||||
= t("buttons.back")
|
||||
:javascript
|
||||
$(function() {
|
||||
$('#user_email').focus();
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
= f.hidden_field "id"
|
||||
= f.hidden_field "user_id", :value => ""
|
||||
= f.hidden_field "name", :value => ""
|
||||
= f.submit t("buttons.abandon", :thing => t("defaults.thing")), :class => "btn danger"
|
||||
%fieldset.form-actions
|
||||
= f.submit t("buttons.abandon", :thing => t("defaults.thing")), :class => "btn danger"
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
%h2
|
||||
= t("titles.adopt", :thing => t("defaults.thing").titleize)
|
||||
= form_for :thing, :url => things_path, :method => :put, :html => {:id => "adoption_form", :class => "form-stacked"} do |f|
|
||||
%h2
|
||||
= t("titles.adopt", :thing => t("defaults.thing").titleize)
|
||||
= f.hidden_field "id"
|
||||
= f.hidden_field "user_id", :value => current_user.id
|
||||
= f.label "name", t("labels.name_thing", :thing => t("defaults.thing")), :id => "thing_name_label"
|
||||
= f.text_field "name"
|
||||
= f.submit t("buttons.adopt"), :class => "btn primary"
|
||||
%fieldset.control-group
|
||||
= f.label "name", t("labels.name_thing", :thing => t("defaults.thing")), :id => "thing_name_label"
|
||||
= f.text_field "name"
|
||||
%fieldset.form-actions
|
||||
= f.submit t("buttons.adopt"), :class => "btn primary"
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
= f.hidden_field "from_user_id", :value => current_user.id
|
||||
= f.hidden_field "to_user_id", :value => @thing.user.id
|
||||
= f.hidden_field "thing_id", :value => @thing.id
|
||||
= f.submit t("buttons.send_reminder"), :class => "btn"
|
||||
%fieldset.form-actions
|
||||
= f.submit t("buttons.send_reminder"), :class => "btn"
|
||||
|
|
|
@ -11,3 +11,6 @@ development: &DEVELOPMENT
|
|||
test:
|
||||
<<: *DEVELOPMENT
|
||||
database: adopt_a_thing_test
|
||||
|
||||
production:
|
||||
<<: *DEVELOPMENT
|
||||
|
|
|
@ -6,6 +6,7 @@ de:
|
|||
adopt: "Adopt!"
|
||||
back: "Zurück"
|
||||
change_password: "Mein Passwort ändern"
|
||||
close: "Schließen"
|
||||
edit_profile: "Profil bearbeiten"
|
||||
email_password: "Bitte schicken Sie mir mein Passwort"
|
||||
find: "Finden Sie %{thing}"
|
||||
|
|
|
@ -6,6 +6,7 @@ en:
|
|||
adopt: "Adopt!"
|
||||
back: "Back"
|
||||
change_password: "Change my password"
|
||||
close: "Close"
|
||||
edit_profile: "Edit profile"
|
||||
email_password: "Email me my password"
|
||||
find: "Find %{thing}"
|
||||
|
|
|
@ -6,6 +6,7 @@ es:
|
|||
adopt: "Adoptar!"
|
||||
back: "De nuevo"
|
||||
change_password: "Cambiar mi contraseña"
|
||||
close: "Cerca"
|
||||
edit_profile: "Editar perfil"
|
||||
email_password: "Correo electrónico mi contraseña"
|
||||
find: "Encontrar %{thing}"
|
||||
|
|
|
@ -6,6 +6,7 @@ fr:
|
|||
adopt: "Adopter!"
|
||||
back: "Retour"
|
||||
change_password: "Changer mon mot de passe"
|
||||
close: "Fermer"
|
||||
edit_profile: "Modifier le profil"
|
||||
email_password: "Envoyez-moi mon mot de passe"
|
||||
find: "Trouver %{thing}"
|
||||
|
|
|
@ -6,6 +6,7 @@ pt:
|
|||
adopt: "Adote!"
|
||||
back: "De volta"
|
||||
change_password: "Alterar a minha senha"
|
||||
close: "Fechar"
|
||||
edit_profile: "Editar perfil"
|
||||
email_password: "E-mail minha senha"
|
||||
find: "Encontrar %{thing}"
|
||||
|
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 219 KiB |
|
@ -20,8 +20,8 @@ class MainControllerTest < ActionController::TestCase
|
|||
get :index
|
||||
assert_response :success
|
||||
assert_select 'form' do
|
||||
assert_select '[action=?]', '/'
|
||||
assert_select '[method=?]', 'post'
|
||||
assert_select '[action=?]', '/address'
|
||||
assert_select '[method=?]', 'get'
|
||||
end
|
||||
assert_select 'label#city_state_label', 'City'
|
||||
assert_select 'select#city_state' do
|
||||
|
|
|
@ -15,20 +15,13 @@ class UsersControllerTest < ActionController::TestCase
|
|||
assert_select '[action=?]', '/users'
|
||||
assert_select '[method=?]', 'post'
|
||||
end
|
||||
assert_select 'input', :count => 18
|
||||
assert_select 'input', :count => 15
|
||||
assert_select 'label', :count => 12
|
||||
assert_select 'input[name="commit"]' do
|
||||
assert_select '[type=?]', 'submit'
|
||||
assert_select '[value=?]', 'Update'
|
||||
end
|
||||
assert_select 'form#back_form' do
|
||||
assert_select '[action=?]', '/'
|
||||
assert_select '[method=?]', 'get'
|
||||
end
|
||||
assert_select 'input[name="commit"]' do
|
||||
assert_select '[type=?]', 'submit'
|
||||
assert_select '[value=?]', 'Back'
|
||||
end
|
||||
assert_select 'a.btn', 'Back'
|
||||
end
|
||||
|
||||
test 'should update user if password is correct' do
|
||||
|
|
Loading…
Reference in New Issue