<!-- 메인 이미지 -->
<section class="ready-image text-white d-flex flex-column justify-content-end px-4" style="background-image: url(<%=asset_path(@bill.image_0)%>);">
  <div class="image-text">
    <p class="ready-subject text-center"><%= @bill.category %></p>
    <pre class="ready-title mb-2"><%= @bill.title %></pre> <!-- 페이지 이름. -->
    <p class="ready-maker"><%= @raw_bill.main_footchair if !@raw_bill.nil? %></p>
  </div>
</section>
<!-- // 메인 이미지 -->
<!-- 콘텐츠 -->
<div class="ready-container py-3">
  <!-- 문제 -->
  <section class="ready-content py-3">
    <pre class="mt-4 ready-ment">
이런 문제가 일어나고 있습니다.</pre>
    <hr class="mt-4 banner-line ml-0">
    <ul class="problems mt-4 mb-5 pl-1">
      <% @bill.problems_content.gsub("\r\n","<br>").split('<br>').each do |content| %>
        <li class="problem"><%= content %></li>
      <% end %>
    </ul>
  </section>
  <!-- //문제 -->

  <!-- 솔루션 -->
  <section class="ready-content pb-5">
    <pre class="ready-ment">
국회에서 관심받지
못하고 있습니다.</pre>
    <hr class="mt-4 banner-line ml-0">
    <!-- 법안 이름-->
    <div class="ready-bill-title-box mb-3">
      <div class="font-24 d-flex justify-content-between"><span>&quot;</span><span>&quot;</span></div>
                                    <!-- Production에서만 title을 보여줌. -->
      <p class="mx-auto ready-bill-title text-center">‘<%= @raw_bill.title if !@raw_bill.nil? %>’</p>
    </div>
    <p class="solution">
    <!-- 법안 설명 : 의안정보 시스템 첫단락의 마지막 문장 -->
      <%= @bill.content %>
    </p>
    <button class="btn pro-link w-100 font-weight-bold" id="expandBtn" onclick="expand();">펼쳐 보기</button>
  </section>
  <!-- // 솔루션 -->

  <!-- 심사 과정 -->
  <section class="ready-content pb-4">
    <pre class="ready-ment">
심사는
이렇게 지연되고 있습니다.</pre>
    <hr class="mt-4 banner-line ml-0">
    <div class="ready-lawinfo px-2">
      <div class="d-flex justify-content-between">
        <div class="box">
          <h4 class="text-center font-32 font-weight-bold"><%= ((Time.now.to_date - @raw_bill.proposeday.to_date).to_s.split('/')[0]) if !@raw_bill.nil? %></h4>
          <p>계류기간</p>
        </div>
        <div class="box">
          <h4 class="text-center font-32 font-weight-bold"> <%= @bill.sangjung_time %></h4>
          <p>상정에 걸린 기간</p>
        </div>
        <div class="box">
          <h4 class="text-center font-32 font-weight-bold"><%= @bill.conference_time %></h4>
          <p>회의횟수</p>
        </div>
      </div>
      <div class="d-flex justify-content-center mt-2 mb-4">
        <a href="<%= @bill.review_doc %>" class="pro-link mr-1 font-weight-bold law-link">법안 검토보고서</a>
        <a href="<%= @bill.conference_doc %>" class="pro-link ml-1 font-weight-bold law-link">법안 심사회의록</a>
      </div>

      <!-- production -->
      <p class="mt-3 text-center font-weight-bold">심사 담당 <%= @raw_bill.assos if !@raw_bill.nil?%> 국회의원</p>
      <div class="container">
        <div class="row">
          <!-- Production에서만 실행됨. -->
          <% if !@makers.nil? %>
            <% @makers.each do |maker| %>
              <div class="col-2 px-0"><p><%= maker.name %></p></div>
            <% end %>
          <% end %>

        </div>
      </div>
    </div>
  </section>
  <!-- //심사과정 -->
  <!-- 좋아요 -->
  <section class="ready-content" id="last">
    <hr class="mb-3 banner-line2 ml-0">
    <div class="made-by">
      <p class="mb-1 text-right">Editor | <%= @bill.editor_name %> of Tojung</p>
      <p class="text-right">Designer | <%= @bill.designer_name %></p>
    </div>
<!--    <p>좋아요</p>-->
    <center>
      <iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Ftojung.me/best/<%= @bill.id %>&width=450&layout=button_count&action=like&size=small&show_faces=true&share=true&height=80&appId=1014670008686658" width="140" height="80" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>
    </center>

    <pre class="font-16 font-weight-bold">
청원에 참여해보세요.
많은 관심을 얻은 '베도'법안은
NEXT 캠페인으로 선정됩니다.</pre>
    <hr class="mt-3 banner-line2 ml-0">
  </section>
  <!-- //좋아요 -->
  <%# form_tag '/bill_comments' do %>
    <%#= hidden_field_tag 'user_id', current_user.id if !current_user.nil? %>
    <%#= hidden_field_tag 'best_bill_id', params[:id] %>
  <!-- 댓글 -->
  <section class="mb-5">
    <%= form_tag '/bill_comments' do %>
      <%= hidden_field_tag 'user_id', current_user.id if !current_user.nil? %>
      <%= hidden_field_tag 'best_bill_id', params[:id] %>
      <%= token_tag %>

      <div class="input-group mb-4" id="comment">
        <% if current_user.nil? %>
          <input type="text" onclick="location.href='/users/sign_in'" class="form-control ready-form" placeholder="로그인 후 글을 남기실 수 있습니다." aria-label="Recipient's username" aria-describedby="button-addon2">
        <% else %>
          <input type="text" name="content" class="form-control ready-form" placeholder="글을 남기실 수 있습니다." aria-label="Recipient's username" aria-describedby="button-addon2">
        <% end %>
        <div class="input-group-append">
          <button class="btn btn-outline-secondary text-white" id="button-addon2">등록</button>
        </div>
      </div>
    <% end %>
    <!-- comment each do  -->
    <% @comments.each do |comment| %>
      <div class="comment-box font-16 font-sm-12 px-2 py-3">
        <div class="comment-info d-flex justify-content-between mb-2">
          <div class="comment-info-1 d-flex">
            <p class="mb-0 mr-3">2018.10.24</p>
            <p class="mb-0"><%= comment.user.name %></p>
          </div>
          <% if !current_user.nil? && current_user.id == comment.user.id %>
              <%= form_tag "/bill_comments/#{comment.id}", method: 'delete' do %>
                <%= token_tag %>
                <div class="comment-info-2">
                  <button class="mb-0">삭제하기</button>
                </div>
              <% end %>
          <% end %>
        </div>
        <div class="comment-content">
          <p class="mb-0"><%= comment.content %></p>
        </div>
      </div>
    <% end %>
    <!-- comment each do end-->
  </section>


</div>
<!-- //콘텐츠 -->
