Upstream sync
This commit is contained in:
10
app/views/projects/_new_project_button.html.erb
Normal file
10
app/views/projects/_new_project_button.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<% if policy(Project).new? %>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3 mt-4">
|
||||
<li class="card h-100 shadow-sm">
|
||||
<div class="card-body d-flex flex-column justify-content-center align-items-center">
|
||||
<%= fa_icon("plus-circle", class: "text-success", style: "font-size:4rem") %>
|
||||
<%= link_to t(".actions.new"), [:new, :project], class: "mt-4 text-reset text-decoration-none stretched-link" %>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,17 +1,14 @@
|
||||
<% if @projects.any? %>
|
||||
<section class="container mt-5">
|
||||
<h1 class="h3"><%= t(".heading") %> (<%= @projects.size %>)</h1>
|
||||
<ul class="list-unstyled mt-2 row">
|
||||
<% if policy(Project).new? %>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3 mt-4">
|
||||
<li class="card h-100 shadow-sm">
|
||||
<div class="card-body d-flex flex-column justify-content-center align-items-center">
|
||||
<%= fa_icon("plus-circle", class: "text-success", style: "font-size:4rem") %>
|
||||
<%= link_to t(".actions.new"), [:new, :project], class: "mt-4 text-reset text-decoration-none stretched-link" %>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<div class="d-flex flex-row justify-content-between align-items-center mb-3">
|
||||
<h1 class="h3"><%= t(".heading") %> (<%= @projects.size %>)</h1>
|
||||
|
||||
<%= bootstrap_form_with url: [@account, :projects], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), class: "btn btn-light border rounded-pill-left") %>
|
||||
<% end %>
|
||||
</div>
|
||||
<ul id="projects" class="list-unstyled mt-2 row">
|
||||
<%= render partial: "new_project_button" %>
|
||||
<%= render @projects %>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
4
app/views/projects/index.js.erb
Normal file
4
app/views/projects/index.js.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
$("#projects").html("")
|
||||
$("#projects").append("<%= j render(partial: "new_project_button") %>");
|
||||
$("#projects").append("<%= j render(@projects) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
Reference in New Issue
Block a user