Skip to content

Commit

Permalink
Merge pull request #45 from ToshinoriIzumi/feature/fix_search_form
Browse files Browse the repository at this point in the history
お疲れ様です。綺麗に修正していただきありがとうございます。
https://image.lgtmoon.dev/183646
  • Loading branch information
kuuwannya authored Oct 9, 2022
2 parents 15abb8f + 75ff5d1 commit 2c78b3d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/tokyoto_app/app/views/top/_result.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p class="text-3xl">あなたが利用できる支援は、<%= conditions_supports.count %>件です。</p>
<p class="text-xl my-3">あなたが利用できる支援は、<%= conditions_supports.count %>件です。</p>
<% conditions_supports.each do |conditions_support| %>
<section class="mb-6">
<div class="max-w-7xl px-8 py-4 bg-white rounded-lg shadow-md dark:bg-gray-800">
Expand Down
32 changes: 21 additions & 11 deletions app/tokyoto_app/app/views/top/_search_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
<%= search_form_for @q, url: "/search" do |f| %>
<div class="flex justify-start">
<%= f.label :support_support_name, "制度名" %>
<%= f.search_field :support_support_name_cont, class: "block w-1/2 py-3 text-base text-neutral-600 placeholder-gray-300 transition duration-500 ease-in-out transform border border-transparent rounded-lg bg-gray-50 focus:border-transparent focus:ring-2 focus:ring-blue-300 focus:ring-offset-2 focus:ring-offset-gray-300 border-gray-500 flex-start mr-5" %>
<%= f.label :city_city_name, "地区名" %>
<%= f.search_field :city_city_name_cont, class: "block w-1/2 py-3 text-base text-neutral-600 placeholder-gray-300 transition duration-500 ease-in-out transform border border-transparent rounded-lg bg-gray-50 focus:border-transparent focus:ring-2 focus:ring-blue-300 focus:ring-offset-2 focus:ring-offset-gray-300 border-gray-500 flex-start mr-5" %>
<%= f.label :income_money, "所得額" %>
<%= f.number_field :income_money_gt, class: "block w-1/2 py-3 text-base text-neutral-600 placeholder-gray-300 transition duration-500 ease-in-out transform border border-transparent rounded-lg bg-gray-50 focus:border-transparent focus:ring-2 focus:ring-blue-300 focus:ring-offset-2 focus:ring-offset-gray-300 border-gray-500 flex-start mr-5" %>
<%= f.label :age_search, "子どもの年齢" %>
<%= f.number_field :age_search, class: "block w-1/2 py-3 text-base text-neutral-600 placeholder-gray-300 transition duration-500 ease-in-out transform border border-transparent rounded-lg bg-gray-50 focus:border-transparent focus:ring-2 focus:ring-blue-300 focus:ring-offset-2 focus:ring-offset-gray-300 border-gray-500 flex-start mr-5" %>
<%= f.submit "検索", class: "px-2 py-1 bg-yellow-400 text-white font-semibold rounded hover:bg-yellow-500" %>
<div class="flex flex-row space-x-4 mx-1 mb-3">
<div class="flex-1">
<%= f.label :support_support_name_cont, "制度名" , class: "block mb-2 text-xl font-medium text-gray-600 dark:text-gray-300" %>
<%= f.search_field :support_support_name_cont, class: "block mb-4 p-4 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder: "記入例(医療)" %>
</div>
<div class="flex-1">
<%= f.label :city_city_name_cont, "地区名" , class: "block mb-2 text-xl font-medium text-gray-600 dark:text-gray-300" %>
<%= f.search_field :city_city_name_cont, class: "block mb-4 p-4 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder: "記入例(港区)" %>
</div>
<div class="flex-1">
<%= f.label :income_money_gt, "所得額" , class: "block mb-2 text-xl font-medium text-gray-600 dark:text-gray-300" %>
<%= f.number_field :income_money_gt, class: "block mb-4 p-4 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder: "記入例(3,000,000)" %>
</div>
<div class="flex-1">
<%= f.label :age_search, "子供の年齢" , class: "block mb-2 text-xl font-medium text-gray-600 dark:text-gray-300" %>
<%= f.number_field :age_search, class: "block mb-4 p-4 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder: "記入例(10)" %>
</div>
<div class="mt-10" >
<%= f.submit "検索", class: "px-6 py-3 text-xl bg-yellow-600 text-white font-semibold rounded hover:bg-yellow-500" %>
</div>
</div>
<% end %>
<% end %>
5 changes: 3 additions & 2 deletions app/tokyoto_app/app/views/top/search.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<h1>データ一覧</h1>

<%= render 'search_form' %>

<p class="text-2xl">データ一覧</p>

<%= render partial: "result", locals: {conditions_supports: @results} %>

0 comments on commit 2c78b3d

Please sign in to comment.