Skip to content

Commit

Permalink
New job list
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Feb 4, 2020
1 parent 4840f72 commit 205eaa4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/controllers/homeland/jobs/jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def index
@topics = @topics.last_actived.includes(:user).page(params[:page])
@topics = @topics.where("title ilike ?", "%[#{params[:location]}]%") if params[:location]
@page_title = '招聘'
render '/topics/index' if stale?(etag: [@node, @suggest_topics, @topics], template: '/topics/index')
end

def show
Expand Down
22 changes: 22 additions & 0 deletions app/views/homeland/jobs/jobs/_sidebar.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="card">
<div class="card-body">
<p>你是企业主,需要寻找相关人才?</p>
<%= link_to "发布招聘", main_app.new_topic_path(node_id: @node.id), class: "btn btn-primary btn-block" %>
</div>
</div>
<div class="card">
<div class="card-header">招聘栏目版规</div>
<div class="card-body">
<%= sanitize_markdown @node.summary_html %>
</div>
</div>
<div class="card">
<div class="card-header">城市索引</div>
<ul class="list-group list-group-flush">
<% cache "prefixes", expires_in: 7.days do %>
<% Location.hot.limit(10).each do |prefix| %>
<li class="list-group-item"><%= link_to prefix.name, homeland_jobs.jobs_path(location: prefix.name) %></li>
<% end %>
<% end %>
</ul>
</div>
21 changes: 21 additions & 0 deletions app/views/homeland/jobs/jobs/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<% title_tag(@page_title || t('menu.topics')) %>
<div class="row">
<div class="col-md-9">
<div class="topics topics-<%= action_name %> card">
<div class="card-body item-list">
<% if @suggest_topics.present? %>
<%= render partial: '/topics/topic', collection: @suggest_topics, locals: { suggest: true } %>
<% end %>
<%= render partial: '/topics/topic', collection: @topics, locals: { suggest: false } %>
</div>
<% if @topics.total_pages > 1 %>
<div class="card-footer clearfix">
<%= paginate @topics %>
</div>
<% end %>
</div>
</div>
<div class="sidebar col-md-3">
<%= render "sidebar" %>
</div>
</div>

0 comments on commit 205eaa4

Please sign in to comment.