app/views/refinery/jobs/admin/jobs/_job.html.erb in refinerycms-jobs-3.0.0 vs app/views/refinery/jobs/admin/jobs/_job.html.erb in refinerycms-jobs-3.0.1
- old
+ new
@@ -1,39 +1,49 @@
+<% # setup params for various action links
+ open_url = refinery.jobs_admin_job_job_applications_path(job)
+ preview_url = refinery.jobs_job_url(job)
+ edit_url = refinery.edit_jobs_admin_job_path(job)
+ delete_url = refinery.jobs_admin_job_path(job)
+ delete_options = {
+ class: "cancel confirm-delete",
+ data: {confirm: t('message', scope: 'refinery.admin.delete', title: job.title)}
+ }
+%>
+
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(job) -%>">
<span class='title'>
<%= job.title.presence || job.translations.detect {|t| t.title.present?}.title %>
<span class="preview">
- <% job.translations.each do |translation| %>
- <% if translation.title.present? %>
- <%= link_to refinery_icon_tag("flags/#{translation.locale}.png", :size => '16x11'),
- refinery.edit_jobs_admin_job_path(job, :switch_locale => translation.locale),
- :class => 'locale' %>
- <% end %>
- <% end %>
-
<% if job.draft? %>
<span class="label notice"><%= t('refinery.jobs.admin.jobs.job.draft') %></span>
<% else %>
<%= job.published_at.strftime('%b %d, %Y') %>
<% end %>
+
+ <% if Refinery::I18n.frontend_locales.many? %>
+ <span class='locales'>
+ <% job.translations.sort_by{ |t| Refinery::I18n.frontend_locales.index(t.locale)}.each do |translation| %>
+ <% if translation.title.present? %>
+ <%= link_to refinery.edit_jobs_admin_job_path(job, :switch_locale => translation.locale), :class => 'locale', title: translation.locale.upcase do %>
+
+ <div class="<%=translation.locale %> locale_marker">
+ <%= locale_text_icon(translation.locale.upcase) %>
+ </div>
+ <% end %>
+ <% end %>
+ <% end %>
+ </span>
+ <% end %>
+
+ <%= t('.job_applications_count', count: job.job_applications.count ) %>
</span>
</span>
<span class='actions'>
- <% if !job.job_applications.blank? %>
- <%= link_to refinery_icon_tag("folder_open.png"), refinery.job_applications_jobs_admin_job_path(job),
- :title => t('.view_applications_for_this_job') %>
+ <% if job.job_applications.any? %>
+ <%= action_icon(:folder, open_url, t('.view_applications_for_this_job')) %>
<% end %>
- <%= link_to refinery_icon_tag("application_go.png"), refinery.jobs_job_url(job),
- :title => t('.view_live_html'),
- :target => "_blank" %>
- <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_jobs_admin_job_path(job),
- :title => t('.edit') %>
- <%= link_to refinery_icon_tag("delete.png"), refinery.jobs_admin_job_path(job),
- :class => "cancel confirm-delete",
- :title => t('.delete'),
- :method => :delete,
- :data => {
- :confirm => t('message', :scope => 'refinery.admin.delete', :title => job.title)
- } %>
+ <%= action_icon(:preview, preview_url, t('.view_live_html')) %>
+ <%= action_icon(:edit, edit_url, t('.edit' ) ) %>
+ <%= action_icon(:delete, delete_url, t('.delete' ), delete_options ) %>
</span>
</li>
\ No newline at end of file