From 7e3c676fb4f873430f3fdbaa00ffb851af13d9af Mon Sep 17 00:00:00 2001 From: Udo Kramer Date: Thu, 14 Nov 2013 02:48:21 +0100 Subject: [PATCH 1/3] remove search --- app/controllers/home_controller.rb | 3 --- app/views/home/already.html.erb | 4 ++-- app/views/home/index.html.erb | 2 +- app/views/home/search.html.erb | 22 ---------------------- app/views/home/thanks.html.erb | 4 ++-- config/routes.rb | 1 - 6 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 app/views/home/search.html.erb diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 2430872..8f998ee 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -5,9 +5,6 @@ def index def role_model end - def search - end - def thanks end diff --git a/app/views/home/already.html.erb b/app/views/home/already.html.erb index 129e827..8504900 100644 --- a/app/views/home/already.html.erb +++ b/app/views/home/already.html.erb @@ -1,7 +1,7 @@

- <%= link_to "Wir finden es wirklich cool, dich in unserer Datenbank zu haben !", home_search_path, class: 'btn btn-primary btn-block' %> + <%= link_to "Wir finden es wirklich cool, dich in unserer Datenbank zu haben !", users_path, class: 'btn btn-primary btn-block' %> - <%= link_to "Sieh dir andere Role Models an", home_search_path, class: 'btn btn-primary btn-block' %> + <%= link_to "Sieh dir andere Role Models an", users_path, class: 'btn btn-primary btn-block' %>

\ No newline at end of file diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 4e10cd7..7b5f923 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -9,7 +9,7 @@

Du unterrichtest in der Oberstufe und suchst nach Frauen in Tech-Berufen als Vorbild für deine Schülerinnen? Mit „Rent a Role Model” kannst du nach Frauen in deiner Stadt suchen, die Schülerinnen bei der Berufsorientierung unterstützen möchten.

- <%= link_to "Ich suche ein Role Model", home_search_path, class: 'btn btn-primary btn-block' %> + <%= link_to "Ich suche ein Role Model", users_path, class: 'btn btn-primary btn-block' %> diff --git a/app/views/home/search.html.erb b/app/views/home/search.html.erb deleted file mode 100644 index ee68feb..0000000 --- a/app/views/home/search.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -
-

Suche nach einem Role Model in deiner Stadt!

- -
-
-
- -
- - <%= link_to "Role Models in Berlin", users_path(city: "Berlin"), class: 'btn btn-primary btn-block' %> -
- - -
- - <%= link_to "Role Models in Hamburg", users_path(city: "Hamburg"), class: 'btn btn-primary btn-block' %> -
- -
-
-
-
diff --git a/app/views/home/thanks.html.erb b/app/views/home/thanks.html.erb index bb5beec..26eb9e7 100644 --- a/app/views/home/thanks.html.erb +++ b/app/views/home/thanks.html.erb @@ -4,7 +4,7 @@

- <%= link_to "Danke für deine Anmeldung!", home_search_path, class: 'btn btn-primary btn-block' %> + <%= link_to "Danke für deine Anmeldung!", users_path, class: 'btn btn-primary btn-block' %> - <%= link_to "Sieh dir andere Role Models an", home_search_path, class: 'btn btn-primary btn-block' %> + <%= link_to "Sieh dir andere Role Models an", users_path, class: 'btn btn-primary btn-block' %>

\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index cc2d730..faab991 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,6 @@ get "home/index" get "home/role_model" get "home/thanks" - get "home/search" get "home/already" get "home/about", as: :about # The priority is based upon order of creation: first created -> highest priority. From b2b918cbf4348c38b00384534dc859c0e7e1b79f Mon Sep 17 00:00:00 2001 From: Udo Kramer Date: Thu, 14 Nov 2013 02:52:32 +0100 Subject: [PATCH 2/3] remove a bunch of trailing spaces ^^ --- app/controllers/home_controller.rb | 2 +- app/controllers/oauth_controller.rb | 6 +++--- app/views/home/about.html.erb | 8 ++++---- app/views/home/already.html.erb | 2 +- app/views/home/index.html.erb | 1 - app/views/home/role_model.html.erb | 2 +- app/views/home/thanks.html.erb | 5 +---- app/views/users/show.html.erb | 4 ++-- config/routes.rb | 2 +- 9 files changed, 14 insertions(+), 18 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 8f998ee..90c7b64 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -9,7 +9,7 @@ def thanks end def already - end + end def about end diff --git a/app/controllers/oauth_controller.rb b/app/controllers/oauth_controller.rb index 7412677..f203bc7 100644 --- a/app/controllers/oauth_controller.rb +++ b/app/controllers/oauth_controller.rb @@ -8,11 +8,11 @@ def sign_up session[:secret] = request_token.secret # print request_token redirect_to request_token.authorize_url - end + end def callback request_token = OAuth::RequestToken.new(@consumer, session[:token], session[:secret]) - access_token = request_token.get_access_token(:oauth_verifier => params[:oauth_verifier]) + access_token = request_token.get_access_token(:oauth_verifier => params[:oauth_verifier]) result = access_token.request(:get, "https://api.xing.com/v1/users/me") user = JSON.parse(result.body) @@ -46,5 +46,5 @@ def set_consumer :access_token_path => "/v1/access_token" }) end - + end diff --git a/app/views/home/about.html.erb b/app/views/home/about.html.erb index d8753a2..9e678e0 100644 --- a/app/views/home/about.html.erb +++ b/app/views/home/about.html.erb @@ -3,17 +3,17 @@

- „Rent a Role Model“ verbindet LehrerInnen mit weiblichen Vorbildern aus der IT-Branche. Lehrerinnen ohne Netzwerk in der IT-Branche finden hier Frauen, die gerne an Schulen über ihren Berufsalltag erzählen würden. Die Role Models sollen Schüler und Schülerinnen zu einer Karriere in der IT inspirieren. Die Vorbilder sind weiblich, um vor allen den Mädchen die Angst vor technischen Berufen zu nehmen. + „Rent a Role Model“ verbindet LehrerInnen mit weiblichen Vorbildern aus der IT-Branche. Lehrerinnen ohne Netzwerk in der IT-Branche finden hier Frauen, die gerne an Schulen über ihren Berufsalltag erzählen würden. Die Role Models sollen Schüler und Schülerinnen zu einer Karriere in der IT inspirieren. Die Vorbilder sind weiblich, um vor allen den Mädchen die Angst vor technischen Berufen zu nehmen.

- Die Idee für „Rent a Role Model” stammt von <%= link_to "Birte Goldt", "https://twitter.com/birtona" %>. Im Rahmen des Berlin Geekettes All Women-Hackathon im Oktober 2013 haben wir – <%= link_to "Debora Blass", "https://twitter.com/bumbledebee" %>, <%= link_to "Bettina Shzu-Juraschek", "https://twitter.com/ThatBettina" %>, <%= link_to "Joan Wolkerstorfer", "https://twitter.com/joanwolk" %>, und <%= link_to "Kathrin Kaufmann", "https://twitter.com/kommanderkat" %> – gemeinsam mit Birte die vorliegende Alpha-Version umgesetzt. + Die Idee für „Rent a Role Model” stammt von <%= link_to "Birte Goldt", "https://twitter.com/birtona" %>. Im Rahmen des Berlin Geekettes All Women-Hackathon im Oktober 2013 haben wir – <%= link_to "Debora Blass", "https://twitter.com/bumbledebee" %>, <%= link_to "Bettina Shzu-Juraschek", "https://twitter.com/ThatBettina" %>, <%= link_to "Joan Wolkerstorfer", "https://twitter.com/joanwolk" %>, und <%= link_to "Kathrin Kaufmann", "https://twitter.com/kommanderkat" %> – gemeinsam mit Birte die vorliegende Alpha-Version umgesetzt.

- Wer Interesse hat, an der Weiterentwicklung von „Rent a Role Model” mitzuarbeiten, findet uns <%= link_to "auf Github", "https://github.com/birtona/rent-a-role-model" %>. + Wer Interesse hat, an der Weiterentwicklung von „Rent a Role Model” mitzuarbeiten, findet uns <%= link_to "auf Github", "https://github.com/birtona/rent-a-role-model" %>.

- +

diff --git a/app/views/home/already.html.erb b/app/views/home/already.html.erb index 8504900..acb29cb 100644 --- a/app/views/home/already.html.erb +++ b/app/views/home/already.html.erb @@ -4,4 +4,4 @@ <%= link_to "Wir finden es wirklich cool, dich in unserer Datenbank zu haben !", users_path, class: 'btn btn-primary btn-block' %> <%= link_to "Sieh dir andere Role Models an", users_path, class: 'btn btn-primary btn-block' %> - \ No newline at end of file + diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 7b5f923..957f04c 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -40,4 +40,3 @@ - diff --git a/app/views/home/role_model.html.erb b/app/views/home/role_model.html.erb index b45bd72..77cb6ed 100644 --- a/app/views/home/role_model.html.erb +++ b/app/views/home/role_model.html.erb @@ -10,4 +10,4 @@
- \ No newline at end of file + diff --git a/app/views/home/thanks.html.erb b/app/views/home/thanks.html.erb index 26eb9e7..df54387 100644 --- a/app/views/home/thanks.html.erb +++ b/app/views/home/thanks.html.erb @@ -1,10 +1,7 @@ - - -

<%= link_to "Danke für deine Anmeldung!", users_path, class: 'btn btn-primary btn-block' %> <%= link_to "Sieh dir andere Role Models an", users_path, class: 'btn btn-primary btn-block' %> -

\ No newline at end of file + diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 01402a5..d4f4b18 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -10,8 +10,8 @@

<%= @user.job %>
<%= @user.city %>

-
- <%=link_to @user.xing_profile, class: "btn btn-default btn-lg white_button" do %> +
+ <%=link_to @user.xing_profile, class: "btn btn-default btn-lg white_button" do %> <%= image_tag('https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQD1lCGSiROaXVJyx1h1CfkuZsiO80_RMyEo1GXCulFXQmUFDGi', width: 20) %> Xing-Profil ansehen <% end %>
diff --git a/config/routes.rb b/config/routes.rb index faab991..680d01b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -46,7 +46,7 @@ # get 'recent', on: :collection # end # end - + # Example resource route with concerns: # concern :toggleable do # post 'toggle' From 7845ce024e5aa5199f9efb18d55538790e62ffd9 Mon Sep 17 00:00:00 2001 From: Udo Kramer Date: Thu, 14 Nov 2013 02:52:53 +0100 Subject: [PATCH 3/3] put city selection into /users which replaces search now --- app/views/users/index.html.erb | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 9f19e28..a8c8fb0 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,5 +1,30 @@
-

<%= @city %> Role Models

+

+ <% if @city.nil? %> + Suche nach einem Role Model in deiner Stadt! + <% else %> + <%= @city %> Role Models + <% end %> +

+ + <% if @city.nil? %> +
+
+ <%= link_to "Role Models in Berlin", + users_path(city: "Berlin"), + class: "btn btn-primary btn-block" + %> +
+ +
+ <%= link_to "Role Models in Hamburg", + users_path(city: "Hamburg"), + class: "btn btn-primary btn-block" + %> +
+
+ <% end %> + <% @users.each do |user| %>
<%= link_to user_path(user) do %>