recruiter 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +2 -0
  4. data/app/assets/images/ruby.png +0 -0
  5. data/app/assets/images/ruby_72x72.png +0 -0
  6. data/app/assets/images/ruby_rotated.png +0 -0
  7. data/app/assets/images/ruby_worker.png +0 -0
  8. data/app/assets/javascripts/recruiter/application.js +3 -0
  9. data/app/assets/javascripts/recruiter/filters.js +35 -0
  10. data/app/assets/javascripts/recruiter/site.js +3 -0
  11. data/app/assets/stylesheets/recruiter/application.css.scss +7 -0
  12. data/app/assets/stylesheets/recruiter/foundation_and_overrides.scss +1251 -0
  13. data/app/assets/stylesheets/recruiter/gh-fork-ribbon.css +140 -0
  14. data/app/assets/stylesheets/recruiter/site.css.sass +116 -0
  15. data/app/assets/stylesheets/recruiter/variables.css.sass +6 -0
  16. data/app/controllers/recruiter/filters_controller.rb +14 -0
  17. data/app/controllers/recruiter/jobs_controller.rb +18 -0
  18. data/app/controllers/recruiter/omniauth_callbacks_controller.rb +45 -0
  19. data/app/controllers/recruiter/users/jobs_controller.rb +59 -0
  20. data/app/controllers/recruiter/users/user_controller.rb +8 -0
  21. data/app/controllers/recruiter_controller.rb +13 -0
  22. data/app/decorators/recruiter/job_decorator.rb +49 -0
  23. data/app/decorators/recruiter/user_decorator.rb +22 -0
  24. data/app/helpers/recruiter/crud_flash_messager_helper.rb +21 -0
  25. data/app/helpers/recruiter/form_helper.rb +29 -0
  26. data/app/helpers/recruiter/header_helper.rb +13 -0
  27. data/app/helpers/recruiter/icons_helper.rb +29 -0
  28. data/app/helpers/recruiter/links_helper.rb +59 -0
  29. data/app/helpers/recruiter/markdown_helper.rb +12 -0
  30. data/app/helpers/recruiter/oauth_providers_helper.rb +23 -0
  31. data/app/helpers/recruiter/show_helper.rb +29 -0
  32. data/app/models/recruiter/city.rb +9 -0
  33. data/app/models/recruiter/custom_devise_failure.rb +7 -0
  34. data/app/models/recruiter/filters.rb +44 -0
  35. data/app/models/recruiter/filters/city_filter.rb +21 -0
  36. data/app/models/recruiter/filters/job_filter.rb +21 -0
  37. data/app/models/recruiter/filters/state_filter.rb +17 -0
  38. data/app/models/recruiter/job.rb +34 -0
  39. data/app/{helpers/recruiter/application_helper.rb → models/recruiter/oauth.rb} +1 -1
  40. data/app/models/recruiter/oauth/base.rb +24 -0
  41. data/app/models/recruiter/oauth/facebook.rb +6 -0
  42. data/app/models/recruiter/oauth/github.rb +6 -0
  43. data/app/models/recruiter/oauth/google.rb +9 -0
  44. data/app/models/recruiter/state.rb +9 -0
  45. data/app/models/recruiter/tag.rb +6 -0
  46. data/app/models/recruiter/user.rb +11 -0
  47. data/app/views/devise/sessions/new.html.erb +8 -0
  48. data/app/views/kaminari/_first_page.html.erb +11 -0
  49. data/app/views/kaminari/_gap.html.erb +8 -0
  50. data/app/views/kaminari/_last_page.html.erb +11 -0
  51. data/app/views/kaminari/_next_page.html.erb +11 -0
  52. data/app/views/kaminari/_page.html.erb +12 -0
  53. data/app/views/kaminari/_paginator.html.erb +23 -0
  54. data/app/views/kaminari/_prev_page.html.erb +11 -0
  55. data/app/views/layouts/recruiter/application.html.erb +28 -10
  56. data/app/views/recruiter/_analytics.html.erb +10 -0
  57. data/app/views/recruiter/_filters.html.erb +17 -0
  58. data/app/views/recruiter/_flashes.html.erb +14 -0
  59. data/app/views/recruiter/_footer.html.erb +7 -0
  60. data/app/views/recruiter/_form_actions.html.erb +4 -0
  61. data/app/views/recruiter/_javascript.html.erb +10 -0
  62. data/app/views/recruiter/_login_button.html.erb +15 -0
  63. data/app/views/recruiter/_login_links.html.erb +7 -0
  64. data/app/views/recruiter/_login_status.html.erb +8 -0
  65. data/app/views/recruiter/_show_actions.html.erb +6 -0
  66. data/app/views/recruiter/_show_item.html.erb +8 -0
  67. data/app/views/recruiter/_tags.html.erb +6 -0
  68. data/app/views/recruiter/_top_menu.html.erb +28 -0
  69. data/app/views/recruiter/jobs/_job.html.erb +14 -0
  70. data/app/views/recruiter/jobs/index.html.erb +14 -0
  71. data/app/views/recruiter/jobs/show.html.erb +1 -0
  72. data/app/views/recruiter/users/jobs/_form.html.erb +30 -0
  73. data/app/views/recruiter/users/jobs/_job.html.erb +35 -0
  74. data/app/views/recruiter/users/jobs/edit.html.erb +3 -0
  75. data/app/views/recruiter/users/jobs/index.html.erb +24 -0
  76. data/app/views/recruiter/users/jobs/new.html.erb +3 -0
  77. data/app/views/recruiter/users/jobs/show.html.erb +4 -0
  78. data/config/initializers/devise.rb +272 -0
  79. data/config/initializers/simple_form.rb +145 -0
  80. data/config/routes.rb +19 -0
  81. data/config/spring.rb +1 -0
  82. data/db/migrate/20140617180316_create_recruiter_states.rb +12 -0
  83. data/db/migrate/20140617180934_create_recruiter_cities.rb +14 -0
  84. data/db/migrate/20140618164609_create_recruiter_users.rb +51 -0
  85. data/db/migrate/20140618165301_add_name_to_users.rb +5 -0
  86. data/db/migrate/20140618165802_create_recruiter_jobs.rb +14 -0
  87. data/db/migrate/20140618170815_create_recruiter_tags.rb +13 -0
  88. data/db/migrate/20140618170904_create_recruiter_jobs_tags.rb +10 -0
  89. data/lib/generators/templates/locales/devise.en.yml +59 -0
  90. data/lib/generators/templates/locales/devise.pt-BR.yml +60 -0
  91. data/lib/generators/templates/locales/en.yml +11 -0
  92. data/lib/generators/templates/locales/pt-BR.yml +237 -0
  93. data/lib/generators/templates/locales/recruiter.pt-BR.yml +78 -0
  94. data/lib/generators/templates/locales/simple_form.en.yml +26 -0
  95. data/lib/recruiter.rb +12 -0
  96. data/lib/recruiter/engine.rb +31 -0
  97. data/lib/recruiter/version.rb +1 -1
  98. metadata +362 -11
  99. data/app/assets/stylesheets/recruiter/application.css +0 -15
  100. data/app/controllers/recruiter/application_controller.rb +0 -4
@@ -0,0 +1,6 @@
1
+ module Recruiter
2
+ module Oauth
3
+ class Facebook < Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Recruiter
2
+ module Oauth
3
+ class Github < Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ module Recruiter
2
+ module Oauth
3
+ class Google < Base
4
+ def self.provider_key
5
+ :google_oauth2
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Recruiter
2
+ class State < ActiveRecord::Base
3
+ delegate :to_s, to: :name
4
+ validates :name, presence: true, uniqueness: { case_sensitive: false }
5
+ validates :short, presence: true, uniqueness: { case_sensitive: false }
6
+
7
+ scope :with_open_jobs, ->{ where(id: City.with_open_jobs.select(:state_id).uniq) }
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ module Recruiter
2
+ class Tag < ActiveRecord::Base
3
+ has_and_belongs_to_many :jobs, class_name: 'Recruiter::Job'
4
+ validates :name, presence: true, uniqueness: { case_sensitive: false }
5
+ end
6
+ end
@@ -0,0 +1,11 @@
1
+ module Recruiter
2
+ class User < ActiveRecord::Base
3
+ devise :omniauthable, :trackable
4
+ has_many :jobs
5
+ serialize :provider_data, JSON
6
+
7
+ validates :name, presence: true
8
+
9
+ validates :uid, uniqueness: { case_sensitive: false, scope: :provider }
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ <h2><%= t('.title') %></h2>
2
+
3
+ <p class="alert-box"><%= t('.message') %></p>
4
+
5
+ <% available_oauth_providers.each do |name, provider| %>
6
+ <%= render 'recruiter/login_button', provider: provider, options: { class: "#{provider} button large secondary" } %>
7
+ <% end %>
8
+
@@ -0,0 +1,11 @@
1
+ <%# Link to the "First" page
2
+ - available local variables
3
+ url: url to the first page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="first">
10
+ <%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, :remote => remote %>
11
+ </li>
@@ -0,0 +1,8 @@
1
+ <%# Non-link tag that stands for skipped pages...
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ total_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ -%>
8
+ <li class="page gap unavailable"><%= t('views.pagination.truncate').html_safe %></li>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Last" page
2
+ - available local variables
3
+ url: url to the last page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="last">
10
+ <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, :remote => remote %>
11
+ </li>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Next" page
2
+ - available local variables
3
+ url: url to the next page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="next">
10
+ <%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, :rel => 'next', :remote => remote %>
11
+ </li>
@@ -0,0 +1,12 @@
1
+ <%# Link showing page number
2
+ - available local variables
3
+ page: a page object for "this" page
4
+ url: url to this page
5
+ current_page: a page object for the currently displayed page
6
+ total_pages: total number of pages
7
+ per_page: number of items to fetch per page
8
+ remote: data-remote
9
+ -%>
10
+ <li class="<%= ' current' if page.current? %>">
11
+ <%= link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
12
+ </li>
@@ -0,0 +1,23 @@
1
+ <%# The container tag
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ total_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ paginator: the paginator that renders the pagination tags inside
8
+ -%>
9
+ <%= paginator.render do -%>
10
+ <ul class="pagination">
11
+ <%= first_page_tag unless current_page.first? %>
12
+ <%= prev_page_tag unless current_page.first? %>
13
+ <% each_page do |page| -%>
14
+ <% if page.left_outer? || page.right_outer? || page.inside_window? -%>
15
+ <%= page_tag page %>
16
+ <% elsif !page.was_truncated? -%>
17
+ <%= gap_tag %>
18
+ <% end -%>
19
+ <% end -%>
20
+ <%= next_page_tag unless current_page.last? %>
21
+ <%= last_page_tag unless current_page.last? %>
22
+ </ul>
23
+ <% end -%>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Previous" page
2
+ - available local variables
3
+ url: url to the previous page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="prev">
10
+ <%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, :rel => 'prev', :remote => remote %>
11
+ </li>
@@ -1,14 +1,32 @@
1
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Recruiter</title>
5
- <%= stylesheet_link_tag "recruiter/application", media: "all" %>
6
- <%= javascript_include_tag "recruiter/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
2
+ <html lang="pt-BR">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10
6
 
11
- <%= yield %>
7
+ <meta name="ROBOTS" content="NOODP" />
8
+ <title><%= title %></title>
9
+ <meta property="og:url" content="<%= t('recruiter.url') %>">
10
+ <meta property="og:site_name" content="<%= t('recruiter.layout.header.site_name') %>">
11
+ <!-- <meta property="og:image" content=""> -->
12
+ <meta property="og:description" content="<%= t('recruiter.layout.header.meta_description') %>">
13
+ <%= stylesheet_link_tag 'recruiter/application', :media => 'all' %>
14
+ <%= javascript_include_tag "vendor/modernizr" %>
15
+ <%= csrf_meta_tags %>
16
+ <%= render 'recruiter/analytics' %>
17
+ </head>
12
18
 
13
- </body>
19
+ <body>
20
+ <%= render 'recruiter/top_menu' -%>
21
+ <%= render 'recruiter/flashes' -%>
22
+ <div id="middle">
23
+ <div id="main_content" class="row">
24
+ <div class="small-12 columns">
25
+ <%= yield %>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ <%= render 'recruiter/footer' %>
30
+ <%= render 'recruiter/javascript' %>
31
+ </body>
14
32
  </html>
@@ -0,0 +1,10 @@
1
+ <script>
2
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
6
+
7
+ ga('create', 'UA-51869206-1', 'rubyjobsbrazil.com.br');
8
+ ga('send', 'pageview');
9
+
10
+ </script>
@@ -0,0 +1,17 @@
1
+ <%-
2
+ state_options = options_for_select(options_for_available_states, params[:state_id])
3
+ city_options = options_for_select(options_for_available_cities(params[:state_id]), params[:city_id])
4
+ -%>
5
+ <section>
6
+ <header>
7
+ <h1><%= t('.title') %></h1>
8
+ <%= form_tag(root_path, method: :get) do %>
9
+ <label for="state_id"><%= t('.state') %></label>
10
+ <%= select_tag :state_id, state_options, include_blank: true, data: { 'filter-select' => '{"target": "#city_id", "filterParam":"state_id", "filter": "city", "data": { "open_jobs": "1"} }' } %>
11
+
12
+ <label for="city_id"><%= t('.city') %></label>
13
+ <%= select_tag :city_id, city_options, prompt: t('.select_state') %>
14
+ <button class="expand secondary"> <%= icon('page-search') %> <%= t('.submit') %> </button>
15
+ <% end %>
16
+ </header>
17
+ </section>
@@ -0,0 +1,14 @@
1
+ <% if notice %>
2
+ <div class="alert-box success">
3
+ <div class="row">
4
+ <%= notice %>
5
+ </div>
6
+ </div>
7
+ <% end %>
8
+ <% if alert %>
9
+ <div class="alert-box alert">
10
+ <div class="row">
11
+ <%= alert %>
12
+ </div>
13
+ </div>
14
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <footer>
2
+ <div class="github-fork-ribbon-wrapper right-bottom">
3
+ <div class="github-fork-ribbon">
4
+ <a href="https://github.com/mjacobus/rubyjobsbrazil">Fork me on GitHub</a>
5
+ </div>
6
+ </div>
7
+ </footer>
@@ -0,0 +1,4 @@
1
+ <div class="right">
2
+ <%= submit_button %>
3
+ <%= cancel_link %>
4
+ </div>
@@ -0,0 +1,10 @@
1
+ <%= javascript_include_tag 'recruiter/application' %>
2
+
3
+ <%= yield :javascript %>
4
+
5
+ <% if Rails.env.test? %>
6
+ <%= javascript_tag do %>
7
+ $.fx.off = true;
8
+ $.ajaxSetup({ async: false });
9
+ <% end %>
10
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%
2
+ options ||= {}
3
+
4
+ default_options = {
5
+ class: "login #{provider}",
6
+ title: t("recruiter.messages.login_with.#{provider}")
7
+ }
8
+
9
+ options.reverse_merge!(default_options)
10
+ %>
11
+
12
+ <%= link_to recruiter.user_omniauth_authorize_path(provider), options do %>
13
+ <%= provider_icon(provider) %>
14
+ <%= t("recruiter.links.login.#{provider}") %>
15
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <li class="has-dropdown"><a href="#">Login</a>
2
+ <ul class="dropdown">
3
+ <% available_oauth_providers.each do |name, provider| %>
4
+ <li><%= render 'recruiter/login_button', provider: provider %></li>
5
+ <% end %>
6
+ </ul>
7
+ </li>
@@ -0,0 +1,8 @@
1
+ <li> <%= link_to t('recruiter.links.published_jobs'), :jobs %> </li>
2
+ <li>
3
+ <%= link_to "#" do %>
4
+ <%= current_user.decorate.avatar(30, 30) %>
5
+ <%= t('recruiter.messages.logged_as', username: current_user.name) %>
6
+ <% end %>
7
+ </li>
8
+ <li> <%= link_to t('recruiter.links.logout'), :destroy_user_session %> </li>
@@ -0,0 +1,6 @@
1
+ <div class="right">
2
+ <%= button_link([:edit, record], 'medium success') do %>
3
+ <%= edit_icon %> <%= t('recruiter.links.edit') %>
4
+ <% end %>
5
+ <%= back_link %>
6
+ </div>
@@ -0,0 +1,8 @@
1
+ <div class="row">
2
+ <div class="small-4 medium-2 columns">
3
+ <label><%= label %></label>
4
+ </div>
5
+ <div class="small-8 medium-10 columns">
6
+ <%= value %>
7
+ </div>
8
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="list no-buttons tags">
2
+ <% tags.each do |tag| %>
3
+ <span class="tag <%= tag.name.parameterize %>"><i class="fi-check"></i><span class="content"><%= tag.name %></span></span>
4
+ <% end %>
5
+ </div>
6
+
@@ -0,0 +1,28 @@
1
+ <div class="sticky">
2
+ <nav class="top-bar" data-topbar>
3
+ <ul class="title-area">
4
+ <li class="name"><h1><a href="/">Ruby Jobs Brazil</a></h1> </li>
5
+ <li class="toggle-topbar menu-icon"><a href="#">Menu</a></li>
6
+ </ul>
7
+
8
+
9
+ <section class="top-bar-section">
10
+ <!-- Right Nav Section -->
11
+ <ul class="right">
12
+ <li> <%= link_to(t('recruiter.links.jobs.new'), recruiter.new_job_path) %> </li>
13
+ <%= render 'recruiter/login_links' unless current_user -%>
14
+ <%= render 'recruiter/login_status' if current_user -%>
15
+ </ul>
16
+ </section>
17
+ </nav>
18
+ </div>
19
+
20
+ <div id="after_menu">
21
+ <div class="row">
22
+ <div class="small-12 columns">
23
+ <div class="wrapper">
24
+ <h1> <%= image_tag('ruby_worker.png') %> Ruby Jobs Brazil</h1>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </div>
@@ -0,0 +1,14 @@
1
+ <div class="job">
2
+ <%= link_to offer_path(job) do %>
3
+ <article class="row">
4
+ <div class="small-12 columns">
5
+ <div class="wrapper">
6
+ <h2><%= job.decorate.title %></h2>
7
+ <div class="line"><%= render 'tags', tags: job.tags %></div>
8
+ <div class="location line"><%= job.decorate.location %></div>
9
+ <div class="published_date line"><%= job.decorate.published_at %></div>
10
+ </div>
11
+ </div>
12
+ </article>
13
+ <% end %>
14
+ </div>
@@ -0,0 +1,14 @@
1
+ <div class="row">
2
+ <div class="small-12 medium-4 large-4 columns">
3
+ <%= render 'filters' %>
4
+ </div>
5
+ <div id="jobs" class="small-12 medium-8 large-8 columns">
6
+ <h1><%= t('.title') %></h1>
7
+ <%= render @jobs %>
8
+ </div>
9
+ <div class="small-12 medium-8 large-8 columns">
10
+ <div class="wrapper">
11
+ <%= paginate @jobs %>
12
+ </div>
13
+ </div>
14
+ </div>
@@ -0,0 +1 @@
1
+ <%= render 'recruiter/users/jobs/job', job: @job %>
@@ -0,0 +1,30 @@
1
+ <%= simple_form_for(job) do |f| %>
2
+
3
+ <div class="row">
4
+ <div class="small-12 medium-8 large-8 columns">
5
+ <%= f.input :title %>
6
+ <%= f.input :state_id, as: :select, collection: options_for_states,
7
+ input_html: {
8
+ 'data-filter-select' => '{"target": "#job_city_id", "filterParam":"state_id", "filter": "city"}'
9
+ }
10
+ %>
11
+ <%= f.association :city, collection: options_for_cities(job.state_id) %>
12
+ <%= f.input :description, as: :text, input_html: { rows: 5 }, hint: t('.markdown_hint').html_safe %>
13
+ <%= f.input :how_to_apply, as: :text, input_html: { rows: 5 }, hint: t('.markdown_hint').html_safe %>
14
+ </div>
15
+
16
+ <div class="small-12 medium-4 large-4 columns">
17
+ <h2><%= t('.tags') %></h2>
18
+ <% tags.each do |tag| %>
19
+ <div>
20
+ <%= check_box_tag 'job[tag_ids][]', tag.id, job.tag_ids.include?(tag.id), id: "tag_#{tag.id}" %>
21
+ <%= label_tag("tag_#{tag.id}", tag.name) %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ </div>
26
+
27
+
28
+
29
+ <%= render 'form_actions' %>
30
+ <% end %>