From 4d48e482fe6d37ba993af5cab842e5562f7eaa6b Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Mon, 10 Oct 2011 14:09:51 -0700 Subject: [PATCH] Remove stealing feature --- app/assets/javascripts/main.js.erb | 54 ------------------------------ app/views/things/_steal.html.haml | 5 --- app/views/users/profile.html.haml | 1 - config/locales/de.yml | 1 - config/locales/en.yml | 1 - config/locales/es.yml | 1 - config/locales/fr.yml | 1 - config/locales/pt.yml | 1 - 8 files changed, 65 deletions(-) delete mode 100644 app/views/things/_steal.html.haml diff --git a/app/assets/javascripts/main.js.erb b/app/assets/javascripts/main.js.erb index 3d227c1..d782c60 100644 --- a/app/assets/javascripts/main.js.erb +++ b/app/assets/javascripts/main.js.erb @@ -496,60 +496,6 @@ $(function() { } return false; }); - $('#steal_form').live('submit', function() { - var answer = window.confirm("Are you sure you want to steal this <%= I18n.t("defaults.thing") %>?") - if(answer) { - var submitButton = $("#steal_form input[type='submit']"); - $(submitButton).attr("disabled", true); - $.ajax({ - type: 'POST', - url: '/things.json', - data: { - 'id': $('#thing_id').val(), - 'commit': submitButton.val(), - 'utf8': '✓', - 'authenticity_token': $('#steal_form input[name="authenticity_token"]').val(), - '_method': 'put', - 'thing': { - 'user_id': $('#thing_user_id').val(), - '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) { - $.ajax({ - type: 'GET', - url: '/info_window', - data: { - 'thing_id': activeThingId, - 'flash': { - 'notice': "<%= I18n.t("notices.stolen", :thing => I18n.t("defaults.thing").capitalize) %>" - } - }, - success: function(data) { - activeInfoWindow.setContent(data); - image = 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) - ); - activeMarker.setIcon(image); - activeMarker.setAnimation(null); - } - }); - } - }); - } - return false; - }); $('#edit_profile_form').live('submit', function() { var submitButton = $("#edit_profile_form input[type='submit']"); $(submitButton).attr("disabled", true); diff --git a/app/views/things/_steal.html.haml b/app/views/things/_steal.html.haml deleted file mode 100644 index b8689dc..0000000 --- a/app/views/things/_steal.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -= form_for :thing, :url => things_path, :method => :put, :html => {:id => "steal_form"} do |f| - = f.hidden_field "id" - = f.hidden_field "user_id", :value => "" - = f.hidden_field "name", :value => "" - = f.submit t("buttons.steal", :thing => t("defaults.thing")) diff --git a/app/views/users/profile.html.haml b/app/views/users/profile.html.haml index 660e03a..abf69f8 100644 --- a/app/views/users/profile.html.haml +++ b/app/views/users/profile.html.haml @@ -6,7 +6,6 @@ = t("titles.ofline", :organization => @thing.user.organization) unless @thing.user.organization.blank? - if user_signed_in? = render :partial => 'users/reminder' - = render :partial => 'things/steal' = render :partial => 'users/edit_profile' = render :partial => 'sessions/sign_out' - else diff --git a/config/locales/de.yml b/config/locales/de.yml index 16291aa..1b9e148 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -13,7 +13,6 @@ de: sign_in: "Anmelden" sign_out: "Austragen" sign_up: "Registrieren" - steal: "Steal this %{thing}" update: "Aktualisierung" captions: current_password: "(Wir brauchen Ihr aktuelles Passwort, um Ihre Änderungen zu bestätigen)" diff --git a/config/locales/en.yml b/config/locales/en.yml index 744c3a9..2441c4f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -13,7 +13,6 @@ en: sign_in: "Sign in" sign_out: "Sign out" sign_up: "Sign up" - steal: "Steal this %{thing}" update: "Update" captions: current_password: "(we need your current password to confirm your changes)" diff --git a/config/locales/es.yml b/config/locales/es.yml index 27d164d..6340062 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -13,7 +13,6 @@ es: sign_in: "Ingresar" sign_out: "Salir" sign_up: "Regístrate" - steal: "Robar esta %{thing}" update: "Actualización" captions: current_password: "(Necesitamos su contraseña actual para confirmar los cambios)" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 50f81f8..58a86b4 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -13,7 +13,6 @@ fr: sign_in: "Connexion" sign_out: "Inscription sur" sign_up: "S'inscrire" - steal: "Voler cette %{thing}" update: "Mise à jour" captions: current_password: "(Nous avons besoin de votre mot de passe actuel pour confirmer vos modifications)" diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 7becf45..0eec5da 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -13,7 +13,6 @@ pt: sign_in: "Entrar" sign_out: "Sair" sign_up: "Inscrever-se" - steal: "Roubar este %{thing}" update: "Atualizar" captions: current_password: "(Nós precisamos de sua senha atual para confirmar as alterações)"