refinerycms-registrations 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/app/assets/images/refinery/race_registrations/admin/chosen-sprite.png +0 -0
  2. data/app/assets/images/refinery/race_registrations/down_arrow.png +0 -0
  3. data/app/assets/images/refinery/race_registrations/up_arrow.png +0 -0
  4. data/app/assets/javascripts/refinery/race_registrations/admin/jquery.chosen.min.js +10 -0
  5. data/app/assets/javascripts/refinery/race_registrations/admin/race_registrations.js +53 -0
  6. data/app/assets/javascripts/refinery/race_registrations/race_registrations.js +41 -0
  7. data/app/assets/stylesheets/refinery/race_registrations/admin/chosen.css.scss +396 -0
  8. data/app/assets/stylesheets/refinery/race_registrations/admin/race_registrations.css.scss +13 -0
  9. data/app/assets/stylesheets/refinery/race_registrations/admin/sortable_table.css.scss +40 -0
  10. data/app/assets/stylesheets/refinery/race_registrations/race_registrations.css.scss +74 -0
  11. data/app/controllers/refinery/race_registrations/admin/categories_controller.rb +33 -0
  12. data/app/controllers/refinery/race_registrations/admin/groups_controller.rb +13 -0
  13. data/app/controllers/refinery/race_registrations/admin/people_controller.rb +89 -0
  14. data/app/controllers/refinery/race_registrations/admin/registrations_controller.rb +13 -0
  15. data/app/controllers/refinery/race_registrations/categories_controller.rb +17 -0
  16. data/app/controllers/refinery/race_registrations/people_controller.rb +36 -0
  17. data/app/controllers/refinery/race_registrations/registrations_controller.rb +40 -0
  18. data/app/helpers/refinery/race_registrations/admin/people_helper.rb +23 -0
  19. data/app/helpers/refinery/race_registrations/registrations_helper.rb +23 -0
  20. data/app/models/refinery/race_registrations/category.rb +17 -0
  21. data/app/models/refinery/race_registrations/group.rb +20 -0
  22. data/app/models/refinery/race_registrations/group_category.rb +8 -0
  23. data/app/models/refinery/race_registrations/person.rb +53 -0
  24. data/app/models/refinery/race_registrations/registration.rb +37 -0
  25. data/app/views/layouts/print.html.erb +14 -0
  26. data/app/views/refinery/pages/registration_list.html.erb +15 -0
  27. data/app/views/refinery/race_registrations/admin/_submenu.html.erb +77 -0
  28. data/app/views/refinery/race_registrations/admin/categories/_categories.html.erb +2 -0
  29. data/app/views/refinery/race_registrations/admin/categories/_category.html.erb +20 -0
  30. data/app/views/refinery/race_registrations/admin/categories/_form.html.erb +17 -0
  31. data/app/views/refinery/race_registrations/admin/categories/_records.html.erb +18 -0
  32. data/app/views/refinery/race_registrations/admin/categories/_sortable_list.html.erb +5 -0
  33. data/app/views/refinery/race_registrations/admin/categories/edit.html.erb +1 -0
  34. data/app/views/refinery/race_registrations/admin/categories/index.html.erb +5 -0
  35. data/app/views/refinery/race_registrations/admin/categories/new.html.erb +1 -0
  36. data/app/views/refinery/race_registrations/admin/groups/_form.html.erb +23 -0
  37. data/app/views/refinery/race_registrations/admin/groups/_group.html.erb +20 -0
  38. data/app/views/refinery/race_registrations/admin/groups/_groups.html.erb +2 -0
  39. data/app/views/refinery/race_registrations/admin/groups/_records.html.erb +18 -0
  40. data/app/views/refinery/race_registrations/admin/groups/_sortable_list.html.erb +5 -0
  41. data/app/views/refinery/race_registrations/admin/groups/edit.html.erb +1 -0
  42. data/app/views/refinery/race_registrations/admin/groups/index.html.erb +5 -0
  43. data/app/views/refinery/race_registrations/admin/groups/new.html.erb +1 -0
  44. data/app/views/refinery/race_registrations/admin/people/_form.html.erb +82 -0
  45. data/app/views/refinery/race_registrations/admin/people/_people.html.erb +14 -0
  46. data/app/views/refinery/race_registrations/admin/people/_person.html.erb +21 -0
  47. data/app/views/refinery/race_registrations/admin/people/_records.html.erb +11 -0
  48. data/app/views/refinery/race_registrations/admin/people/edit.html.erb +1 -0
  49. data/app/views/refinery/race_registrations/admin/people/index.html.erb +27 -0
  50. data/app/views/refinery/race_registrations/admin/people/index.js.erb +3 -0
  51. data/app/views/refinery/race_registrations/admin/people/new.html.erb +1 -0
  52. data/app/views/refinery/race_registrations/admin/registrations/_form.html.erb +54 -0
  53. data/app/views/refinery/race_registrations/admin/registrations/_records.html.erb +18 -0
  54. data/app/views/refinery/race_registrations/admin/registrations/_registration.html.erb +20 -0
  55. data/app/views/refinery/race_registrations/admin/registrations/_registrations.html.erb +2 -0
  56. data/app/views/refinery/race_registrations/admin/registrations/_sortable_list.html.erb +5 -0
  57. data/app/views/refinery/race_registrations/admin/registrations/edit.html.erb +1 -0
  58. data/app/views/refinery/race_registrations/admin/registrations/index.html.erb +5 -0
  59. data/app/views/refinery/race_registrations/admin/registrations/new.html.erb +1 -0
  60. data/app/views/refinery/race_registrations/categories/index.html.erb +11 -0
  61. data/app/views/refinery/race_registrations/categories/show.html.erb +27 -0
  62. data/app/views/refinery/race_registrations/groups/index.html.erb +11 -0
  63. data/app/views/refinery/race_registrations/groups/show.html.erb +27 -0
  64. data/app/views/refinery/race_registrations/people/_form.html.erb +81 -0
  65. data/app/views/refinery/race_registrations/people/_form_header.html.erb +8 -0
  66. data/app/views/refinery/race_registrations/people/new.html.erb +28 -0
  67. data/app/views/refinery/race_registrations/registrations/_registration.html.erb +47 -0
  68. data/app/views/refinery/race_registrations/registrations/_registration_chooser.html.erb +7 -0
  69. data/app/views/refinery/race_registrations/registrations/show.html.erb +21 -0
  70. data/config/initializers/refinery/core.rb +8 -0
  71. data/config/locales/en.yml +136 -0
  72. data/config/locales/es.yml +141 -0
  73. data/config/locales/fr.yml +139 -0
  74. data/config/locales/humanizer.de.yml +43 -0
  75. data/config/locales/humanizer.en.yml +43 -0
  76. data/config/locales/humanizer.es.yml +43 -0
  77. data/config/locales/humanizer.fi.yml +43 -0
  78. data/config/locales/humanizer.fr.yml +43 -0
  79. data/config/locales/humanizer.it.yml +43 -0
  80. data/config/locales/humanizer.nl.yml +43 -0
  81. data/config/locales/humanizer.pl.yml +43 -0
  82. data/config/locales/humanizer.pt-BR.yml +43 -0
  83. data/config/locales/humanizer.pt-PT.yml +43 -0
  84. data/config/locales/humanizer.ru.yml +43 -0
  85. data/config/locales/humanizer.sk.yml +9 -0
  86. data/config/locales/humanizer.zh-CN.yml +43 -0
  87. data/config/locales/nb.yml +141 -0
  88. data/config/locales/nl.yml +141 -0
  89. data/config/locales/sk.yml +138 -0
  90. data/config/routes.rb +44 -0
  91. data/db/migrate/1_create_race_registrations_registrations.rb +31 -0
  92. data/db/migrate/2_create_race_registrations_people.rb +33 -0
  93. data/db/migrate/3_create_race_registrations_categories.rb +26 -0
  94. data/db/migrate/4_create_race_registrations_groups.rb +26 -0
  95. data/db/migrate/5_create_race_registrations_group_categories.rb +18 -0
  96. data/db/migrate/6_add_registration_id_to_people.rb +20 -0
  97. data/db/migrate/7_add_group_id_to_registrations.rb +13 -0
  98. data/db/seeds.rb +51 -0
  99. data/lib/generators/refinery/registrations_generator.rb +18 -0
  100. data/lib/refinery/registrations.rb +22 -0
  101. data/lib/refinery/registrations/configuration.rb +11 -0
  102. data/lib/refinery/registrations/engine.rb +31 -0
  103. data/lib/refinery/registrations/extensions/pages_controller_extension.rb +18 -0
  104. data/lib/refinerycms-registrations.rb +1 -0
  105. data/lib/tasks/refinery/registrations.rake +13 -0
  106. data/readme.md +95 -0
  107. metadata +182 -0
@@ -0,0 +1,14 @@
1
+ <%= will_paginate @people if Refinery::RaceRegistrations::Admin::PeopleController.pageable? %>
2
+ <table border="0" class="sortable">
3
+ <tr>
4
+ <th ><%= sortable "id", t('activerecord.attributes.refinery/race_registrations/person.id') %></th>
5
+ <th ><%= sortable "surname", t('activerecord.attributes.refinery/race_registrations/person.surname') %></th>
6
+ <th ><%= sortable "name", t('activerecord.attributes.refinery/race_registrations/person.name') %></th>
7
+ <th ><%= sortable "country", t('activerecord.attributes.refinery/race_registrations/person.country') %></th>
8
+ <th style="width: 70px;"><%= sortable "birth_date", t('activerecord.attributes.refinery/race_registrations/person.birth_date') %></th>
9
+ <th ><%= sortable "club", t('activerecord.attributes.refinery/race_registrations/person.club') %></th>
10
+ <th ><%= sortable "city", t('activerecord.attributes.refinery/race_registrations/person.city') %></th>
11
+ <th style="width: 60px;"></th>
12
+ </tr>
13
+ <%= render :partial => 'person', :collection => @people %>
14
+ </table>
@@ -0,0 +1,21 @@
1
+ <tr class='<%= cycle("on", "on-hover") %>'>
2
+ <td ><%= person.id %></td>
3
+ <td><a title="<%= person.email %>"><%= person.surname %></a></td>
4
+ <td><%= person.name %></td>
5
+ <td><%= person.country %></td>
6
+ <td><%= person.birth_date %></td>
7
+ <td><%= person.club %></td>
8
+ <td><%= person.city %></td>
9
+
10
+ <td class="action">
11
+ <%= link_to refinery_icon_tag("delete.png"), refinery.race_registrations_admin_person_path(person),
12
+ :class => "cancel confirm-delete",
13
+ :title => t('.delete'),
14
+ :confirm => t('message', :scope => 'refinery.admin.delete', :title => person.name),
15
+ :method => :delete %>
16
+
17
+ <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_race_registrations_admin_person_path(person),
18
+ :title => t('.edit') %>
19
+
20
+ </td>
21
+ </tr>
@@ -0,0 +1,11 @@
1
+ <div class='pagination_container'>
2
+ <%= render 'people' %>
3
+ <p>
4
+ <% if @people.empty? %>
5
+ <%= t('no_results', :scope => 'refinery.admin.search') %>
6
+ <% end %>
7
+ </p>
8
+ </div>
9
+
10
+ <%= hidden_field_tag :direction, sort_direction %>
11
+ <%= hidden_field_tag :sort, sort_column %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,27 @@
1
+ <section id="records" >
2
+ <%= form_for [refinery, :race_registrations_admin, @person] , :method => :get, :html => {:id => 'people_search_form'} do |f| -%>
3
+
4
+ <div class="filter_field" >
5
+ <%= f.label :registration_ids, t('.filter') %>
6
+ <%= f.collection_select( :registration_ids, Refinery::RaceRegistrations::Registration.all, :id, :title,
7
+ { },
8
+ { :data => {:placeholder=> t('.choose_registrations')}, :multiple => true, :class=> "chzn-select"}) %>
9
+
10
+ </div>
11
+
12
+ <div class="search_field" >
13
+ <label for="search"><%= t('.search') %></label>
14
+ <input id='search' name='search' size='22' type='search' value='<%= params[:search] %>' />
15
+ <%= submit_tag t('button_text', :scope => 'refinery.admin.search'), :name => nil %>
16
+ </div>
17
+
18
+ <div style="clear:both;"></div>
19
+
20
+
21
+ <div id="race_registrations_people">
22
+ <%= render 'records' %>
23
+ </div>
24
+ <% end %>
25
+
26
+ </section>
27
+ <%= render "refinery/race_registrations/admin/submenu" %>
@@ -0,0 +1,3 @@
1
+ $(function() {
2
+ $("#race_registrations_people").html("<%= escape_javascript(render :partial=> "records") %>")
3
+ });
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,54 @@
1
+ <%= form_for [refinery, :race_registrations_admin, @registration] do |f| -%>
2
+ <%= render '/refinery/admin/error_messages',
3
+ :object => @registration,
4
+ :include_object_name => true %>
5
+
6
+
7
+ <div class='field'>
8
+ <%= f.label :title -%>
9
+ <%= f.text_field :title, :class => 'larger widest' -%>
10
+
11
+ </div>
12
+
13
+ <div class='field'>
14
+ <%= f.label :locality -%>
15
+ <%= f.text_field :locality -%>
16
+
17
+ </div>
18
+
19
+ <div class='field'>
20
+ <%= f.label :race_date -%>
21
+ <%= f.date_select :race_date -%>
22
+
23
+ </div>
24
+
25
+ <div class='field'>
26
+ <%= f.label :group_id, t('refinery.plugins.groups.title') %>
27
+ <%= f.collection_select(:group_id, Refinery::RaceRegistrations::Group.all(:order=> "position DESC"), :id, :title,
28
+ { :include_blank => true },
29
+ { :data => {:placeholder=> t('.choose_groups')}, :multiple=> false, :class=> "chzn-select"}) %>
30
+ </div>
31
+
32
+ <div class='field'>
33
+ <%= f.label :is_active -%>
34
+ <%= f.check_box :is_active, :checked => @registration[:is_active] -%>
35
+
36
+ </div>
37
+
38
+ <div class='field'>
39
+ <%= f.label :start_date -%>
40
+ <%= f.datetime_select :start_date -%>
41
+
42
+ </div>
43
+
44
+ <div class='field'>
45
+ <%= f.label :end_date -%>
46
+ <%= f.datetime_select :end_date -%>
47
+
48
+ </div>
49
+
50
+ <%= render '/refinery/admin/form_actions', :f => f,
51
+ :continue_editing => false,
52
+ :delete_title => t('delete', :scope => 'refinery.registrations.admin.registrations.registration'),
53
+ :delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @registration.title) %>
54
+ <% end -%>
@@ -0,0 +1,18 @@
1
+ <% if searching? %>
2
+ <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
3
+ <% end %>
4
+ <div class='pagination_container'>
5
+ <% if @registrations.any? %>
6
+ <%= render 'registrations' %>
7
+ <% else %>
8
+ <p>
9
+ <% unless searching? %>
10
+ <strong>
11
+ <%= t('.no_items_yet') %>
12
+ </strong>
13
+ <% else %>
14
+ <%= t('no_results', :scope => 'refinery.admin.search') %>
15
+ <% end %>
16
+ </p>
17
+ <% end %>
18
+ </div>
@@ -0,0 +1,20 @@
1
+ <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(registration) -%>">
2
+ <span class='title'>
3
+ <%= registration.title %>
4
+
5
+ </span>
6
+ <span class='actions'>
7
+
8
+ <%= link_to refinery_icon_tag("application_go.png"), refinery.race_registrations_registration_path(registration),
9
+ :title => t('.view_live_html'),
10
+ :target => "_blank" %>
11
+
12
+ <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_race_registrations_admin_registration_path(registration),
13
+ :title => t('.edit') %>
14
+ <%= link_to refinery_icon_tag("delete.png"), refinery.race_registrations_admin_registration_path(registration),
15
+ :class => "cancel confirm-delete",
16
+ :title => t('.delete'),
17
+ :confirm => t('message', :scope => 'refinery.admin.delete', :title => registration.title),
18
+ :method => :delete %>
19
+ </span>
20
+ </li>
@@ -0,0 +1,2 @@
1
+ <%= will_paginate @registrations if Refinery::RaceRegistrations::Admin::RegistrationsController.pageable? %>
2
+ <%= render 'sortable_list' %>
@@ -0,0 +1,5 @@
1
+ <ul id='sortable_list'>
2
+ <%= render :partial => 'registration', :collection => @registrations %>
3
+ </ul>
4
+ <%= render '/refinery/admin/sortable_list',
5
+ :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %>
@@ -0,0 +1,5 @@
1
+ <section id='records'>
2
+ <%= render 'records' %>
3
+ </section>
4
+ <%= render "refinery/race_registrations/admin/submenu" %>
5
+ <%= render '/refinery/admin/make_sortable', :tree => false if !searching? and ::Refinery::RaceRegistrations::Admin::RegistrationsController.sortable? and ::Refinery::RaceRegistrations::Registration.count > 1 %>
@@ -0,0 +1,11 @@
1
+ <% content_for :body do %>
2
+ <ul id="categories">
3
+ <% @categories.each do |category| %>
4
+ <li>
5
+ <%= link_to category.title, refinery.race_registrations_category_path(category) %>
6
+ </li>
7
+ <% end %>
8
+ </ul>
9
+ <% end %>
10
+
11
+ <%= render '/refinery/content_page' %>
@@ -0,0 +1,27 @@
1
+ <% content_for :body_content_title do %>
2
+ <%= @category.title %>
3
+ <% end %>
4
+
5
+ <% content_for :body do %>
6
+ <section>
7
+ <h1>Title</h1>
8
+ <p>
9
+ <%=raw @category.title %>
10
+ </p>
11
+ </section>
12
+ <% end %>
13
+
14
+ <% content_for :side_body do %>
15
+ <aside>
16
+ <h2><%= t('.other') %></h2>
17
+ <ul id="categories">
18
+ <% @categories.each do |category| %>
19
+ <li>
20
+ <%= link_to category.title, refinery.race_registrations_category_path(category) %>
21
+ </li>
22
+ <% end %>
23
+ </ul>
24
+ </aside>
25
+ <% end %>
26
+
27
+ <%= render '/refinery/content_page' %>
@@ -0,0 +1,11 @@
1
+ <% content_for :body do %>
2
+ <ul id="groups">
3
+ <% @groups.each do |group| %>
4
+ <li>
5
+ <%= link_to group.title, refinery.race_registrations_group_path(group) %>
6
+ </li>
7
+ <% end %>
8
+ </ul>
9
+ <% end %>
10
+
11
+ <%= render '/refinery/content_page' %>
@@ -0,0 +1,27 @@
1
+ <% content_for :body_content_title do %>
2
+ <%= @group.title %>
3
+ <% end %>
4
+
5
+ <% content_for :body do %>
6
+ <section>
7
+ <h1>Title</h1>
8
+ <p>
9
+ <%=raw @group.title %>
10
+ </p>
11
+ </section>
12
+ <% end %>
13
+
14
+ <% content_for :side_body do %>
15
+ <aside>
16
+ <h2><%= t('.other') %></h2>
17
+ <ul id="groups">
18
+ <% @groups.each do |group| %>
19
+ <li>
20
+ <%= link_to group.title, refinery.race_registrations_group_path(group) %>
21
+ </li>
22
+ <% end %>
23
+ </ul>
24
+ </aside>
25
+ <% end %>
26
+
27
+ <%= render '/refinery/content_page' %>
@@ -0,0 +1,81 @@
1
+ <%= render :partial=>"form_header" %>
2
+ <%#TODO club autocomplete %>
3
+
4
+ <%= form_for [refinery, :race_registrations, @person] do |f| -%>
5
+ <%= render '/refinery/admin/error_messages',
6
+ :object => @person,
7
+ :include_object_name => true %><br/>
8
+
9
+
10
+
11
+ <div class='field'>
12
+ <%= f.label :registration_id %>
13
+ <%= f.collection_select(:registration_id, @registrations, :id, :title,
14
+ (@registrations.length == 1) ? {} : {:prompt=> :true},
15
+ { :data => {:placeholder=> t('.choose_registration')}, :multiple=> false, :class=> "chzn-select"}) %>
16
+ </div>
17
+
18
+
19
+ <div class='field' >
20
+ <%= f.label :category_id %>
21
+ <%= f.collection_select(:category_id, @categories, :id, :title,
22
+ (@categories.length == 1) ? {} : { :prompt => :true },
23
+ { :data => {:placeholder=> t('.choose_category')}, :multiple=> false, :class=> "chzn-select"}) %>
24
+ </div>
25
+
26
+ <div class='field'>
27
+ <%= f.label :name -%>
28
+ <%= f.text_field :name -%>
29
+
30
+ </div>
31
+
32
+ <div class='field'>
33
+ <%= f.label :surname -%>
34
+ <%= f.text_field :surname -%>
35
+ </div>
36
+
37
+ <div class='field'>
38
+ <%= f.label :email -%>
39
+ <%= f.text_field :email -%>
40
+ </div>
41
+
42
+ <div class='field'>
43
+ <%= f.label :birth_date -%>
44
+ <%= f.date_select :birth_date , :start_year => 1910, :include_blank=> true -%>
45
+ </div>
46
+
47
+ <div class='field'>
48
+ <%= f.label :club, t('.club_if_you_have'), :id=>"label_person_club" -%>
49
+ <%= f.text_field :club -%>
50
+
51
+ </div>
52
+
53
+ <div class='field'>
54
+ <%= f.label :city -%>
55
+ <%= f.text_field :city -%>
56
+ </div>
57
+
58
+ <div class='field'>
59
+ <label for="person_country_select"><%= t('activerecord.attributes.refinery/race_registrations/person.country') %></label>
60
+
61
+ <select id="person_country_select" name="person[country]">
62
+ <option value=""></option>
63
+ <option value="SVK">SVK</option>
64
+ <option value="CZE">CZE</option>
65
+ <option value="POL">POL</option>
66
+ <option value="POL">HUN</option>
67
+ <option value="AUT">AUT</option>
68
+ <option value="" onclick="$('#person_country_select').replaceWith('<input type=text name=person[country] >');"><%= t('.country.different') %></option>
69
+ </select>
70
+ </div>
71
+
72
+
73
+ <div class='field' >
74
+ <%= f.label :humanizer_answer, @person.humanizer_question %>
75
+ <%= f.text_field :humanizer_answer %>
76
+ <%= f.hidden_field :humanizer_question_id %>
77
+ </div>
78
+
79
+ <%= f.submit t('.save_registration') %>
80
+ <% end -%>
81
+
@@ -0,0 +1,8 @@
1
+ <% @registrations.each do |registration| %>
2
+ <%= t('.end_of_registration', :title=> registration.title) %> <strong><%= l(registration.end_date, :format=> :long) %></strong><br/>
3
+ <% end %>
4
+
5
+ <br/><span class="use_diacritics"><%= t('.please_use_diacritics') %></span>
6
+ <p></p>
7
+ <p></p>
8
+
@@ -0,0 +1,28 @@
1
+ <section id='left_body_content' >
2
+ <%= render "refinery/submenu", :locals=> {} %>
3
+ <%= @page[:left_body] %>
4
+ </section>
5
+
6
+
7
+ <section id='middle_body_content_without_right'>
8
+ <div class="body">
9
+ <%= render "refinery/pages/middle_body_header" %>
10
+
11
+ <%= raw @page[:middle_body] %>
12
+ <% if @registrations.present? %>
13
+ <%= render "form" %>
14
+ <% else %>
15
+ <p><%= t('.no_registration') %></p>
16
+ <% end %>
17
+
18
+ </div>
19
+ <%= render "refinery/pages/author_info" %>
20
+ </section>
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
@@ -0,0 +1,47 @@
1
+ <% if @registration.present? %>
2
+ <h2><%= @registration.title %></h2>
3
+ <h3><%= @registration.locality %> <%= @registration.race_date.strftime("%d.%m.%Y") %></h3>
4
+
5
+ <p><%= t('.number_of_registered_people') %> <%= @registration.people.count %></p>
6
+
7
+
8
+ <%= render :partial => '/refinery/message' %>
9
+
10
+
11
+ <% @registration.categories.each do |category| %>
12
+ <% people_in_category = @registration.people.in_category(category.id, sort_column(), sort_direction() ) %>
13
+
14
+ <% if people_in_category.count > 0 %>
15
+ <h3><%= category.title %></h3>
16
+
17
+ <table border="0" class="sortable">
18
+ <tr>
19
+ <th style="width:25px;">Č.</th>
20
+ <th style="width: 70px;"><%= sortable "surname", t('activerecord.attributes.refinery/race_registrations/person.surname') %></th>
21
+ <th ><%= sortable "name", t('activerecord.attributes.refinery/race_registrations/person.name') %></th>
22
+ <th ><%= sortable "country", t('activerecord.attributes.refinery/race_registrations/person.country') %></th>
23
+ <th style="width: 70px;"><%= sortable "birth_date", t('activerecord.attributes.refinery/race_registrations/person.birth_date') %></th>
24
+ <th ><%= sortable "club", t('activerecord.attributes.refinery/race_registrations/person.club') %></th>
25
+ <th ><%= sortable "city", t('activerecord.attributes.refinery/race_registrations/person.city') %></th>
26
+ <th style="width: 125px;;"><%= sortable "created_at", t('activerecord.attributes.refinery/race_registrations/person.created_at') %></th>
27
+ </tr>
28
+
29
+ <% people_in_category.each_with_index do |person,index| %>
30
+ <tr class='<%= cycle("on", "on-hover") %>'>
31
+ <td><%= index + 1 %></td>
32
+ <td title="ID <%= person.id %>"><%= person.surname %></td>
33
+ <td><%= person.name %></td>
34
+ <td><%= person.country %></td>
35
+ <td><%= person.birth_date %></td>
36
+ <td><%= person.club %></td>
37
+ <td><%= person.city %></td>
38
+ <td><%= person.created_at.strftime("%d.%m.%Y %H:%M") %></td>
39
+ </tr>
40
+ <% end %>
41
+ </table>
42
+ <% end %>
43
+
44
+ <% end %>
45
+ <% else %>
46
+ <%= t('.sorry_no_registrations') %>
47
+ <% end %>