refinerycms-jobs 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +29 -0
  3. data/Gemfile +5 -0
  4. data/Rakefile +20 -0
  5. data/app/controllers/refinery/jobs/admin/jobs_controller.rb +44 -0
  6. data/app/controllers/refinery/jobs/admin/settings_controller.rb +64 -0
  7. data/app/controllers/refinery/jobs/job_applications_controller.rb +67 -0
  8. data/app/controllers/refinery/jobs/jobs_controller.rb +17 -0
  9. data/app/helpers/refinery/jobs/controller_helper.rb +18 -0
  10. data/app/helpers/refinery/jobs/jobs_helper.rb +7 -0
  11. data/app/mailers/refinery/jobs/job_mailer.rb +40 -0
  12. data/app/models/refinery/jobs/job.rb +59 -0
  13. data/app/models/refinery/jobs/job_application.rb +32 -0
  14. data/app/models/refinery/jobs/setting.rb +65 -0
  15. data/app/views/refinery/jobs/admin/job_applications/_job.html.erb +13 -0
  16. data/app/views/refinery/jobs/admin/job_applications/_sortable_list.html.erb +2 -0
  17. data/app/views/refinery/jobs/admin/jobs/_actions.html.erb +25 -0
  18. data/app/views/refinery/jobs/admin/jobs/_form.html.erb +93 -0
  19. data/app/views/refinery/jobs/admin/jobs/_job.html.erb +39 -0
  20. data/app/views/refinery/jobs/admin/jobs/_job_application.html.erb +20 -0
  21. data/app/views/refinery/jobs/admin/jobs/_jobs.html.erb +2 -0
  22. data/app/views/refinery/jobs/admin/jobs/_records.html.erb +16 -0
  23. data/app/views/refinery/jobs/admin/jobs/_sortable_list.html.erb +5 -0
  24. data/app/views/refinery/jobs/admin/jobs/edit.html.erb +1 -0
  25. data/app/views/refinery/jobs/admin/jobs/index.html.erb +7 -0
  26. data/app/views/refinery/jobs/admin/jobs/job_applications.html.erb +34 -0
  27. data/app/views/refinery/jobs/admin/jobs/new.html.erb +1 -0
  28. data/app/views/refinery/jobs/job_applications/_form.html.erb +33 -0
  29. data/app/views/refinery/jobs/job_applications/new.html.erb +5 -0
  30. data/app/views/refinery/jobs/job_applications/show.html.erb +11 -0
  31. data/app/views/refinery/jobs/job_mailer/confirmation.text.erb +1 -0
  32. data/app/views/refinery/jobs/job_mailer/notification.text.erb +20 -0
  33. data/app/views/refinery/jobs/jobs/index.html.erb +21 -0
  34. data/app/views/refinery/jobs/jobs/show.html.erb +67 -0
  35. data/config/locales/en.yml +99 -0
  36. data/config/locales/fr.yml +100 -0
  37. data/config/routes.rb +22 -0
  38. data/db/migrate/20130508210800_create_jobs.rb +31 -0
  39. data/db/migrate/20140929182859_add_slug_to_jobs.rb +6 -0
  40. data/db/migrate/20140929185232_add_draft_and_published_at_to_jobs.rb +6 -0
  41. data/db/migrate/20140930184502_create_job_translations.rb +15 -0
  42. data/db/migrate/20141001192020_add_fields_to_jobs.rb +32 -0
  43. data/db/seeds.rb +26 -0
  44. data/lib/generators/refinery/jobs/jobs_generator.rb +25 -0
  45. data/lib/generators/refinery/jobs/templates/config/initializers/refinery/jobs.rb.erb +7 -0
  46. data/lib/refinery/jobs/configuration.rb +11 -0
  47. data/lib/refinery/jobs/dragonfly.rb +57 -0
  48. data/lib/refinery/jobs/engine.rb +30 -0
  49. data/lib/refinery/jobs/validators/file_size_validator.rb +19 -0
  50. data/lib/refinery/jobs/validators.rb +7 -0
  51. data/lib/refinery/jobs.rb +25 -0
  52. data/lib/refinerycms-jobs.rb +1 -0
  53. data/readme.md +68 -0
  54. data/refinerycms-jobs.gemspec +24 -0
  55. metadata +154 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7bf6508cb6a3b48338b0b91fd97f3a156a90b447
4
+ data.tar.gz: 461a6ca77a920595754d42125dcd2dd247992bf6
5
+ SHA512:
6
+ metadata.gz: dcac81632f3861b19b9c5fe7aae613a79c7623ee753acd6950de9e7d9f7a7dc5896094ac67f38f6c391ec1dc054ab04468967748bb1376f0196841879924b8a5
7
+ data.tar.gz: d69996dcb5eb87b3015ce1b20637b13399859584e0211c479d937a26b0ce7d055bf7bcecd98763f3d3e425cf1ca3f838c0ac659e5a27c25012c9580d8c79596a
data/.gitignore ADDED
@@ -0,0 +1,29 @@
1
+ public/system/*
2
+ public/themes/*
3
+ log/*.log
4
+ tmp/**/*
5
+ .DS_Store
6
+ doc/api
7
+ doc/app
8
+ doc/*
9
+ config/database.yml
10
+ config/amazon_s3.yml
11
+ config/rackspace_cloudfiles.yml
12
+ public/images/system/*
13
+ nbproject
14
+ index/**/*
15
+ db/*.sqlite3
16
+ *.tmproj
17
+ *.autobackupbyrefinery.*
18
+ refinerycms*.gem
19
+ public/javascripts/cache
20
+ public/stylesheets/cache
21
+ config/database.yml.example
22
+ .yardoc/
23
+ refinerycms.gemspec
24
+ .bundle
25
+ vendor/cache
26
+ *.lock
27
+ callsite_hash.*
28
+ **/*/slim_scrooge/ext/Makefile
29
+ public/javascripts/messages.js
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'refinerycms', '~> 2.0.3'
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+
8
+ ENGINE_PATH = File.dirname(__FILE__)
9
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
10
+
11
+ if File.exists?(APP_RAKEFILE)
12
+ load 'rails/tasks/engine.rake'
13
+ end
14
+
15
+ require "refinerycms-testing"
16
+ Refinery::Testing::Railtie.load_tasks
17
+ Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
18
+
19
+ load File.expand_path('../tasks/testing.rake', __FILE__)
20
+ load File.expand_path('../tasks/rspec.rake', __FILE__)
@@ -0,0 +1,44 @@
1
+ module Refinery
2
+ module Jobs
3
+ module Admin
4
+ class JobsController < ::Refinery::AdminController
5
+ crudify :'refinery/jobs/job',
6
+ :order => 'published_at DESC',
7
+ :include => [:translations]
8
+
9
+ def job_applications
10
+ find_job
11
+ @job_applications = @job.job_applications.paginate :page => params[:page]
12
+ end
13
+
14
+ private
15
+ def job_params
16
+ params.require(:job).permit(
17
+ :title,
18
+ :description,
19
+ :employment_terms,
20
+ :hours,
21
+ :position,
22
+ :draft,
23
+ :published_at,
24
+ :fill,
25
+ :ref,
26
+ :education,
27
+ :experience,
28
+ :skills,
29
+ :languages,
30
+ :salary,
31
+ :length,
32
+ :employment_date,
33
+ :contact
34
+ )
35
+ end
36
+
37
+ protected
38
+ def find_job
39
+ @job = Refinery::Jobs::Job.find_by_slug_or_id(params[:id])
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,64 @@
1
+ module Refinery
2
+ module Jobs
3
+ module Admin
4
+ class SettingsController < Refinery::AdminController
5
+
6
+ before_filter :find_setting, :only => [:edit, :update]
7
+ after_filter :save_subject_for_confirmation,
8
+ :save_message_for_confirmation, :save_notification_recipients, :only => :update
9
+
10
+ def edit
11
+ end
12
+
13
+ def update
14
+ flash[:notice] = t('refinery.crudify.updated', :what => @setting.name.gsub("job_", "").titleize)
15
+
16
+ unless request.xhr? or from_dialog?
17
+ redirect_back_or_default(refinery.jobs_admin_jobs_path)
18
+ else
19
+ render text: "<script type='text/javascript'>parent.window.location = '#{refinery.jobs_admin_jobs_path}';</script>"
20
+ end
21
+ end
22
+
23
+ protected
24
+
25
+ def find_setting
26
+ setting = params[:id].gsub("job_", "")
27
+
28
+ if Refinery::Jobs::Setting.respond_to?(setting)
29
+ Refinery::Jobs::Setting.send(setting)
30
+ end
31
+
32
+ @setting = Refinery::Setting.friendly.find(params[:id])
33
+ end
34
+
35
+ def save_notification_recipients
36
+ if setting_params.include?('value')
37
+ Refinery::Jobs::Setting.notification_recipients = setting_params[:value]
38
+ end
39
+ end
40
+
41
+ def save_subject_for_confirmation
42
+ if setting_params.include?('subject')
43
+ Refinery::Jobs::Setting.confirmation_subject = setting_params[:subject]
44
+ end
45
+ end
46
+
47
+ def save_message_for_confirmation
48
+ if setting_params.include?('message')
49
+ Refinery::Jobs::Setting.confirmation_message = setting_params[:message]
50
+ end
51
+ end
52
+
53
+ private
54
+
55
+ def setting_params
56
+ params.require(:setting).permit(:value,
57
+ subject: Refinery::I18n.frontend_locales,
58
+ message: Refinery::I18n.frontend_locales)
59
+ end
60
+
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,67 @@
1
+ module Refinery
2
+ module Jobs
3
+ class JobApplicationsController < ::ApplicationController
4
+ include ControllerHelper
5
+
6
+ before_filter :find_page
7
+ before_filter :find_job, :only => [:new]
8
+
9
+ def new
10
+ @job_application = Refinery::Jobs::JobApplication.new
11
+
12
+ present(@page)
13
+ end
14
+
15
+ def create
16
+ @job_application = Refinery::Jobs::JobApplication.new(job_application_params)
17
+ @job_id_integer = Refinery::Jobs::Job.find_by_slug_or_id(params[:job_id])
18
+
19
+ if !@job_id_integer.nil?
20
+ @job_application.job_id = @job_id_integer.id
21
+ @job = @job_application.job
22
+
23
+ if @job_application.save
24
+ if @job_application.ham? || Refinery::Jobs.send_notifications_for_job_applications_marked_as_spam
25
+ begin
26
+ JobMailer.notification(@job_application, request).deliver
27
+ rescue
28
+ logger.warn "There was an error delivering on job application notification.\n#{$!}\n"
29
+ end
30
+
31
+ if Refinery::Jobs::Setting.send_confirmation?
32
+ begin
33
+ JobMailer.confirmation(@job_application, request).deliver
34
+ rescue
35
+ logger.warn "There was an error delivering on job application confirmation:\n#{$!}\n"
36
+ end
37
+ end
38
+ end
39
+
40
+ redirect_to refinery.jobs_job_job_application_url(@job, @job_application)
41
+ else
42
+ render :action => 'new'
43
+ end
44
+ else
45
+ error_404
46
+ end
47
+ end
48
+
49
+ def show
50
+ @job_application = Refinery::Jobs::JobApplication.find(params[:id])
51
+ @job = @job_application.job
52
+
53
+ present(@page)
54
+
55
+ respond_to do |format|
56
+ format.html { render :action => 'show' }
57
+ format.xml { render :xml => @future_student }
58
+ end
59
+ end
60
+
61
+ private
62
+ def job_application_params
63
+ params.require(:job_application).permit!
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,17 @@
1
+ module Refinery
2
+ module Jobs
3
+ class JobsController < ::ApplicationController
4
+ include ControllerHelper
5
+
6
+ helper :'refinery/jobs/jobs'
7
+ before_filter :find_page
8
+ before_filter :find_all_jobs, :only => [:index]
9
+ before_filter :find_job, :only => [:show]
10
+
11
+ def show
12
+ find_job
13
+ @job_application = Refinery::Jobs::JobApplication.new
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ module Refinery
2
+ module Jobs
3
+ module ControllerHelper
4
+ protected
5
+ def find_all_jobs
6
+ @jobs = Refinery::Jobs::Job.published.friendly.order("position ASC").page(params[:page])
7
+ end
8
+
9
+ def find_job
10
+ @job = Refinery::Jobs::Job.published.friendly.find(params[:id])
11
+ end
12
+
13
+ def find_page
14
+ @page = Refinery::Page.friendly.find_by(:link_url => '/jobs')
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ module Refinery
2
+ module Jobs
3
+ module JobsHelper
4
+
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,40 @@
1
+ module Refinery
2
+ module Jobs
3
+ class JobMailer < ActionMailer::Base
4
+
5
+ def confirmation(job_application, request)
6
+ @job_application, @request = job_application, request
7
+ mail :subject => Refinery::Jobs::Setting.confirmation_subject(Globalize.locale),
8
+ :to => job_application.email,
9
+ :from => from_info,
10
+ :reply_to => Refinery::Jobs::Setting.notification_recipients.split(',').first
11
+ end
12
+
13
+ def notification(job_application, request)
14
+ @job_application, @request = job_application, request
15
+ @host = [request.protocol, request.host_with_port].join
16
+ mail :subject => Refinery::Jobs::Setting.notification_subject,
17
+ :to => Refinery::Jobs::Setting.notification_recipients,
18
+ :from => from_info,
19
+ :reply_to => job_application.email
20
+ end
21
+
22
+ private
23
+
24
+ def from_info
25
+ "\"#{from_name}\" <#{from_mail}>"
26
+ end
27
+
28
+ def from_name
29
+ ::I18n.t('from_name',
30
+ :scope => 'refinery.jobs.config',
31
+ :site_name => Refinery::Core.site_name,
32
+ :name => @job_application.name)
33
+ end
34
+
35
+ def from_mail
36
+ "#{Refinery::Jobs.from_name}@#{@request.domain}"
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,59 @@
1
+ module Refinery
2
+ module Jobs
3
+ class Job < ActiveRecord::Base
4
+ extend FriendlyId
5
+ self.table_name = 'refinery_jobs'
6
+
7
+ translates :title, :description, :slug, :education, :experience, :skills, :languages, :salary, :length, :contact
8
+
9
+ friendly_id :friendly_id_source, :use => [:slugged, :globalize]
10
+
11
+ acts_as_indexed :fields => [:title, :description, :employment_terms, :hours]
12
+
13
+ has_many :job_applications, :dependent => :destroy, :foreign_key => :job_id
14
+
15
+ validates_presence_of :title, :description
16
+ validates_uniqueness_of :title
17
+
18
+ scope :published, -> { where :draft => false }
19
+
20
+ def self.latest(number = 5)
21
+ limit(number).order('created_at DESC')
22
+ end
23
+
24
+ # If title changes tell friendly_id to regenerate slug when
25
+ # saving record
26
+ def should_generate_new_friendly_id?
27
+ title_changed?
28
+ end
29
+
30
+ def friendly_id_source
31
+ title
32
+ end
33
+
34
+ class << self
35
+ # Wrap up the logic of finding the pages based on the translations table.
36
+ def with_globalize(conditions = {})
37
+ conditions = {:locale => ::Globalize.locale}.merge(conditions)
38
+ globalized_conditions = {}
39
+ conditions.keys.each do |key|
40
+ if (translated_attribute_names.map(&:to_s) | %w(locale)).include?(key.to_s)
41
+ globalized_conditions["#{self.translation_class.table_name}.#{key}"] = conditions.delete(key)
42
+ end
43
+ end
44
+ # A join implies readonly which we don't really want.
45
+ where(conditions).joins(:translations).where(globalized_conditions)
46
+ .readonly(false)
47
+ end
48
+
49
+ def find_by_slug_or_id(slug_or_id)
50
+ if slug_or_id.friendly_id?
51
+ find_by_slug(slug_or_id)
52
+ else
53
+ find(slug_or_id)
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,32 @@
1
+ require 'dragonfly'
2
+ require 'refinery/core/base_model'
3
+ require 'filters_spam'
4
+
5
+ module Refinery
6
+ module Jobs
7
+ class JobApplication < Refinery::Core::BaseModel
8
+ self.table_name = 'refinery_job_applications'
9
+
10
+ dragonfly_accessor :resume, :app => :refinery_jobs
11
+
12
+ belongs_to :job, :class_name => "Refinery::Jobs::Job", :foreign_key => "job_id"
13
+
14
+ filters_spam message_field: :cover_letter,
15
+ email_field: :email,
16
+ author_field: :name,
17
+ other_fields: [:phone],
18
+ extra_spam_words: %w()
19
+
20
+ validates_presence_of :name, :phone, :email, :cover_letter
21
+ validates :email, format: {
22
+ with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
23
+ }, length: { maximum: 255 }
24
+ validates :resume, :presence => true
25
+ validates_with Refinery::Jobs::Validators::FileSizeValidator
26
+
27
+ def self.latest(number = 5)
28
+ limit(number).order('created_at DESC')
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,65 @@
1
+ require 'refinery/setting'
2
+
3
+ module Refinery
4
+ module Jobs
5
+ class Setting < ::Refinery::Setting
6
+
7
+ class << self
8
+ def confirmation_body
9
+ find_or_set(:job_application_confirmation_body,
10
+ "Thank you for your job application %name%,\n\nThis email is a receipt to confirm we have received your job application and we'll be in touch shortly.\n\nThanks."
11
+ )
12
+ end
13
+
14
+ def confirmation_subject(locale='en')
15
+ find_or_set(:"job_application_confirmation_subject_#{locale}",
16
+ "Thank you for your job application",
17
+ scoping: "jobs"
18
+ )
19
+ end
20
+
21
+ def confirmation_subject=(locales_subjects)
22
+ locales_subjects.each do |locale, subject|
23
+ set(:"job_application_confirmation_subject_#{locale}", {
24
+ value: subject,
25
+ scoping: "jobs"
26
+ })
27
+ end
28
+ end
29
+
30
+ def confirmation_message(locale='en')
31
+ find_or_set(:"job_application_confirmation_message_#{locale}", confirmation_body, scoping: "jobs")
32
+ end
33
+
34
+ def confirmation_message=(locales_messages)
35
+ locales_messages.each do |locale, message|
36
+ set(:"job_application_confirmation_message_#{locale}", {
37
+ value: message,
38
+ scoping: "jobs"
39
+ })
40
+ end
41
+ end
42
+
43
+ def notification_recipients
44
+ recipients = ((Role[:refinery].users.first.email rescue nil) if defined?(Role)).to_s
45
+ find_or_set(:job_application_notification_recipients, recipients, scoping: "jobs")
46
+ end
47
+
48
+ def notification_recipients=(recipients)
49
+ set(:job_application_notification_recipients, {
50
+ value: recipients,
51
+ scoping: "jobs"
52
+ })
53
+ end
54
+
55
+ def notification_subject
56
+ find_or_set(:job_application_notification_subject, "New job application from your website", scoping: "jobs")
57
+ end
58
+
59
+ def send_confirmation?
60
+ find_or_set(:job_application_send_confirmation, true, scoping: "jobs")
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,13 @@
1
+ <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(job_application) -%>">
2
+ <span class='title'>
3
+ <span class='actions'>
4
+ <%= link_to refinery_icon_tag("application_go.png"), job_application_url(job_application),
5
+ :title => 'View this job<br/><em>Opens in a new window</em>',
6
+ :target => "_blank" %>
7
+ <%= link_to refinery_icon_tag("delete.png"), admin_job_application_path(job),
8
+ :class => "cancel confirm-delete",
9
+ :title => 'Remove this job forever' %>
10
+ </span>
11
+ <%=h job.title %> <span class="preview">&nbsp;</span>
12
+ </span>
13
+ </li>
@@ -0,0 +1,2 @@
1
+ <%= render :partial => 'job', :collection => @jobs %>
2
+ <%= render :partial => "/shared/admin/sortable_list", :locals => {:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)} %>
@@ -0,0 +1,25 @@
1
+ <ul>
2
+ <% if ::Refinery::Jobs::Admin::JobsController.searchable? %>
3
+ <li>
4
+ <%= render '/refinery/admin/search', :url => refinery.jobs_admin_jobs_path %>
5
+ </li>
6
+ <% end %>
7
+ <li>
8
+ <%= link_to t('.create_new'), refinery.new_jobs_admin_job_path,
9
+ :class => "add_icon" %>
10
+ </li>
11
+ <% if !searching? && ::Refinery::Jobs::Admin::JobsController.sortable? && ::Refinery::Jobs::Job.many? %>
12
+ <li>
13
+ <%= link_to t('.reorder', :what => "Jobs"),
14
+ refinery.jobs_admin_jobs_path,
15
+ :id => "reorder_action",
16
+ :class => "reorder_icon" %>
17
+
18
+ <%= link_to t('.reorder_done', :what => "Jobs"),
19
+ refinery.jobs_admin_jobs_path,
20
+ :id => "reorder_action_done",
21
+ :style => "display: none;",
22
+ :class => "reorder_icon" %>
23
+ </li>
24
+ <% end %>
25
+ </ul>
@@ -0,0 +1,93 @@
1
+ <%= form_for [refinery, :jobs, :admin, @job] do |f| -%>
2
+ <%= render "/refinery/admin/error_messages",
3
+ :object => f.object,
4
+ :include_object_name => true %>
5
+
6
+ <%= render '/refinery/admin/locale_picker',
7
+ :current_locale => Globalize.locale %>
8
+
9
+ <div class='field'>
10
+ <%= f.label :title -%>
11
+ <%= f.text_field :title, :class => 'larger widest' -%>
12
+ </div>
13
+
14
+ <div class='field'>
15
+ <%= f.label :fill -%>
16
+ <%= f.number_field :fill, :class => "larger" -%>
17
+ </div>
18
+
19
+ <div class='field'>
20
+ <%= f.label :ref -%>
21
+ <%= f.text_field :ref, :class => "larger" -%>
22
+ </div>
23
+
24
+ <div class='field'>
25
+ <%= f.label :description -%>
26
+ <%= f.text_area :description, :rows => 20, :class => 'wymeditor widest' -%>
27
+ </div>
28
+
29
+ <div class='field'>
30
+ <%= f.label :education -%>
31
+ <%= f.text_field :education, :class => "larger widest" -%>
32
+ </div>
33
+
34
+ <div class='field'>
35
+ <%= f.label :experience -%>
36
+ <%= f.text_field :experience, :class => "larger widest" -%>
37
+ </div>
38
+
39
+ <div class='field'>
40
+ <%= f.label :skills -%>
41
+ <%= f.text_field :skills, :class => "larger widest" -%>
42
+ </div>
43
+
44
+ <div class='field'>
45
+ <%= f.label :languages -%>
46
+ <%= f.text_field :languages, :class => "larger widest" -%>
47
+ </div>
48
+
49
+ <div class='field'>
50
+ <%= f.label :salary -%>
51
+ <%= f.text_field :salary, :class => "larger" -%>
52
+ </div>
53
+
54
+ <div class='field'>
55
+ <%= f.label :hours -%>
56
+ <%= f.text_field :hours, :class => "larger" -%>
57
+ </div>
58
+
59
+ <div class='field'>
60
+ <%= f.label :employment_terms -%>
61
+ <%= f.text_field :employment_terms, :class => "larger widest" -%>
62
+ </div>
63
+
64
+ <div class='field'>
65
+ <%= f.label :length -%>
66
+ <%= f.text_field :length, :class => "larger" -%>
67
+ </div>
68
+
69
+ <div class='field'>
70
+ <%= f.label :employment_date -%>
71
+ <%= f.date_field :employment_date, :class => "larger" -%>
72
+ </div>
73
+
74
+ <div class='field'>
75
+ <%= f.label :contact -%>
76
+ <%= f.text_field :contact, :class => "larger widest" -%>
77
+ </div>
78
+
79
+ <div class='field'>
80
+ <%= f.label :published_at -%>
81
+ <%= f.datetime_select :published_at %>
82
+ </div>
83
+
84
+ <div id="field">
85
+ <%= f.label :draft%>
86
+ <%= f.check_box :draft %>
87
+ </div>
88
+
89
+ <%= render "/refinery/admin/form_actions",
90
+ :f => f,
91
+ :continue_editing => true,
92
+ :delete_title => t('delete', :scope => 'refinery.blog.admin.jobs.job') %>
93
+ <% end %>
@@ -0,0 +1,39 @@
1
+ <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(job) -%>">
2
+ <span class='title'>
3
+ <%= job.title.presence || job.translations.detect {|t| t.title.present?}.title %>
4
+ <span class="preview">
5
+ <% job.translations.each do |translation| %>
6
+ <% if translation.title.present? %>
7
+ <%= link_to refinery_icon_tag("flags/#{translation.locale}.png", :size => '16x11'),
8
+ refinery.edit_jobs_admin_job_path(job, :switch_locale => translation.locale),
9
+ :class => 'locale' %>
10
+ <% end %>
11
+ <% end %>
12
+
13
+ <% if job.draft? %>
14
+ <span class="label notice"><%= t('refinery.jobs.admin.jobs.job.draft') %></span>
15
+ <% else %>
16
+ <%= job.published_at.strftime('%b %d, %Y') %>
17
+ <% end %>
18
+ </span>
19
+ </span>
20
+
21
+ <span class='actions'>
22
+ <% if !job.job_applications.blank? %>
23
+ <%= link_to refinery_icon_tag("folder_open.png"), refinery.job_applications_jobs_admin_job_path(job),
24
+ :title => t('.view_applications_for_this_job') %>
25
+ <% end %>
26
+ <%= link_to refinery_icon_tag("application_go.png"), refinery.jobs_job_url(job),
27
+ :title => t('.view_live_html'),
28
+ :target => "_blank" %>
29
+ <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_jobs_admin_job_path(job),
30
+ :title => t('.edit') %>
31
+ <%= link_to refinery_icon_tag("delete.png"), refinery.jobs_admin_job_path(job),
32
+ :class => "cancel confirm-delete",
33
+ :title => t('.delete'),
34
+ :method => :delete,
35
+ :data => {
36
+ :confirm => t('message', :scope => 'refinery.admin.delete', :title => job.title)
37
+ } %>
38
+ </span>
39
+ </li>