Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[FIX] preparing widget

  • Loading branch information...
commit 0bb947e153d777442fee6512fef544de5ad42444 1 parent 3f6e7c4
@eladmeidar eladmeidar authored
View
50 app/views/devise/registrations/edit.html.erb
@@ -9,26 +9,38 @@
<%= f.input :team_name, as: :hidden %>
</div>
- <div class="container">
- <% Country.where(name: current_user.country).first.teams.in_groups_of(6) do |teams_group| %>
- <div class="row">
- <ul class="thumbnails">
- <% teams_group.compact.each do |team| %>
- <li class="span2">
- <a href="#" class="select_team_link" data-team-name="<%= team.name %>">
- <div class="thumbnail team <%= "selected_team" if current_user.team == team %>">
- <% if team.logo_picture.present? %>
- <%= image_tag team.logo_picture, class:"img-polaroid" %>
- <% end %>
- <h5 class="text-center"><%= team.name %></h3>
- </div>
- </a>
- </li>
- <% end %>
- </ul>
+ <% if current_user.team.present? %>
+ <div class="container">
+ <div class="span2">
+ <%= image_tag current_user.team.logo_picture, class:"img-polaroid" %>
</div>
- <% end %>
- </div>
+ <div class="span4">
+ Your currently selected team is <%= current_user.team.name %>, if you wish to change it
+ <%= link_to "Send us a request", new_feedback_url %>
+ </div>
+ </div>
+ <% else %>
+ <div class="container">
+ <% Country.where(name: current_user.country).first.teams.in_groups_of(6) do |teams_group| %>
+ <div class="row">
+ <ul class="thumbnails">
+ <% teams_group.compact.each do |team| %>
+ <li class="span2">
+ <a href="#" class="select_team_link" data-team-name="<%= team.name %>">
+ <div class="thumbnail team <%= "selected_team" if current_user.team == team %>">
+ <% if team.logo_picture.present? %>
+ <%= image_tag team.logo_picture, class:"img-polaroid" %>
+ <% end %>
+ <h5 class="text-center"><%= team.name %></h3>
+ </div>
+ </a>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+ </div>
+ <% end %>
<div class="form-actions">
<%= f.button :submit, "Update", class: "btn btn-success" %>
</div>
View
1  app/views/layouts/_navigation.html.erb
@@ -27,6 +27,7 @@
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><%= link_to "Unassigned Teams", manage_unassigned_matches_url %></li>
<li><%= link_to "Manage Club Details", edit_team_url(current_user.team.id) %></li>
+ <li><%= link_to "Users", manage_users_url %></li>
</ul>
</li>
<% end %>
View
21 app/workers/team_updater.rb
@@ -27,26 +27,7 @@ def perform(team_id)
player = Player.where(profile_uri: tm_player.profile_uri).first
- player.performance_datas.destroy_all
- tm_player.performance_data.each_pair do |year, competitions|
- next if competitions.empty?
- puts "#{year} performance"
- total = competitions.last
- total.delete(:competition)
-
- attrs = total.merge(year: year.to_i)
- attrs[:minutes] = attrs[:minutes].to_s.gsub(".", "")
- attrs[:minutes_per_goal] = attrs[:minutes_per_goal].to_s.gsub(".", "")
- player.performance_datas.create!(attrs)
-
- end
-
- player.injuries.destroy_all
- tm_player.injuries_data.to_a.each do |injury_attrs|
- player.injuries.create!(injury_attrs)
- end
-
- player.update_attribute(:updated_at, DateTime.now)
+ PlayerUpdate.perform_async(player.id)
end
team.update_attribute(:updated_at, DateTime.now)
View
4 config/routes.rb
@@ -1,6 +1,7 @@
require 'sidekiq/web'
Bascout::Application.routes.draw do
+
resources :feedbacks
resources :scouting_reports
@@ -35,7 +36,10 @@
namespace :manage do
resources :unassigned_matches
+ resources :users, only: [:index]
end
+
+ get "/widgets/rating.:format" => "rating_widget#index", as: :rating_widget
get "/squad" => 'squads#index', as: :team_squad
get "/my_team" => "teams#show", as: :my_team
get "/leaderboards/top_voted" => 'leaderboards#index', filter: 'top_voted', page: 1, as: :top_voted
Please sign in to comment.
Something went wrong with that request. Please try again.