<commit_before><div class="row">
  <div class="col-md-12">

    <% if @decorate_schemes.size == 0 %>
        <div class="row">
          <div class="alert alert-warning" role="alert">
            <strong>注意!</strong> 目前没有装修方案，如果您已经提交预约上门测量申请，装修公司更新后会通知您。
          </div>
        </div>
    <% end %>


    <% @decorate_schemes.each do |decorate_scheme| %>
        <div class="row">
          <h3 style="padding-left: 20px;"><%= decorate_scheme.name %>
            <input type="hidden" id="hidden_decorate_scheme_id" class="hidden_decorate_scheme_id" value="<%= decorate_scheme.id %>">
          	<% if decorate_scheme.confirm_status == "未确认" and @confirm_status_count == 0 %>
              <a class="btn btn-info confirm-decorate-scheme" id="confirm-decorate-scheme" href="#">确认此方案</a>
              <span class="label label-success for_jquery"></span>
            <% elsif decorate_scheme.confirm_status == "未确认" and @confirm_status_count != 0 %>
            
            <% else %>
              <span class="label label-success">已确认</span>
            <% end %>

          </h3>
          

          <div class="row" id="justifiedGallery<%= decorate_scheme.id %>"  style="border: 1px solid #ddd;margin-left: 0px;">
            <% decorate_scheme.decorate_scheme_items.each do |x| %>
                <a href="<%= x.path %>" title="<%= x.description %>">
                  <img alt="<%= x.description %>" src="<%= x.path.t.url %>" />
                </a>
            <% end %>
            <script type="text/javascript">
                $(document).ready(function() {
                    $('#justifiedGallery<%= decorate_scheme.id %>').justifiedGallery({rel: 'gal0'}).on('jg.rowflush', function () {
                        $(this).find('a').colorbox({
                            maxWidth : '80%',
                            maxHeight : '80%',
                            opacity : 0.8,
                            transition : 'elastic',
                            current : ''
                        });
                    });
                });
            </script>

            </div>

        </div>
    <% end %>

    <link rel='stylesheet' href='/js/justifiedgallery/justifiedgallery.min.css' type='text/css' media='all' />
    <link rel='stylesheet' href='/js/colorbox/css/colorbox.css' type='text/css' media='screen' />
    <script src='/js/justifiedgallery/justifiedgallery.js'></script>
    <script src='/js/colorbox/jquery.colorbox-min.js'></script>

    <div class="row" align="center">
      <div class="col-md-12 ">
        <%= paginate @decorate_schemes %>
      </div>
    </div>
  </div>
</div>
<!-- End row -->

<script type="text/javascript">
  $(document).ready(function(){
      $('.confirm-decorate-scheme').on('click',function(event){
      	if(confirm("确定选择该装修方案？")){
          event.preventDefault();
      	  var temporary_confirm=$(this);
      	  var $confirmid = $(this).prev().val();
          $.post( "/decorate_schemes/confirm/"+$confirmid, function( data ) {
            $('.confirm-decorate-scheme').hide();
            $(temporary_confirm).next().append("已确认");
          });
        }
      });
  });
</script><commit_msg>fixed by five comments<commit_after><div class="modal fade" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>
        <h4 class="modal-title" id="myModalLabel">装修方案确认</h4>
      </div>
      <div class="modal-body" align="center">
        <h3><strong>确定选择该装修方案吗？</strong></h3>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary for-confirm" data-dismiss="modal">确定</button>
      </div>
    </div>
  </div>
</div>


<div class="row">
  <div class="col-md-12">

    <% if @decorate_schemes.size == 0 %>
        <div class="row">
          <div class="alert alert-warning" role="alert">
            <strong>注意!</strong> 目前没有装修方案，如果您已经提交预约上门测量申请，装修公司更新后会通知您。
          </div>
        </div>
    <% end %>


    <% @decorate_schemes.each do |decorate_scheme| %>
        <div class="row">
          <h3 style="padding-left: 20px;"><%= decorate_scheme.name %>
            <input type="hidden" value="<%= decorate_scheme.id %>">
          	<% if decorate_scheme.confirm_status == "未确认" and @confirm_status_count == 0 %>
              <a class="btn btn-info confirm-decorate-scheme" role="button" href="#myModal3" data-toggle="modal">确认此方案</a>
              <span class="label label-success"></span>
            <% elsif decorate_scheme.confirm_status == "未确认" and @confirm_status_count != 0 %>
            
            <% else %>
              <span class="label label-success">已确认</span>
            <% end %>

          </h3>
          

          <div class="row" id="justifiedGallery<%= decorate_scheme.id %>"  style="border: 1px solid #ddd;margin-left: 0px;">
            <% decorate_scheme.decorate_scheme_items.each do |x| %>
                <a href="<%= x.path %>" title="<%= x.description %>">
                  <img alt="<%= x.description %>" src="<%= x.path.t.url %>" />
                </a>
            <% end %>
            <script type="text/javascript">
                $(document).ready(function() {
                    $('#justifiedGallery<%= decorate_scheme.id %>').justifiedGallery({rel: 'gal0'}).on('jg.rowflush', function () {
                        $(this).find('a').colorbox({
                            maxWidth : '80%',
                            maxHeight : '80%',
                            opacity : 0.8,
                            transition : 'elastic',
                            current : ''
                        });
                    });
                });
            </script>

            </div>

        </div>
    <% end %>

    <link rel='stylesheet' href='/js/justifiedgallery/justifiedgallery.min.css' type='text/css' media='all' />
    <link rel='stylesheet' href='/js/colorbox/css/colorbox.css' type='text/css' media='screen' />
    <script src='/js/justifiedgallery/justifiedgallery.js'></script>
    <script src='/js/colorbox/jquery.colorbox-min.js'></script>

    <div class="row" align="center">
      <div class="col-md-12 ">
        <%= paginate @decorate_schemes %>
      </div>
    </div>
  </div>
</div>
<!-- End row -->

<script type="text/javascript">
  $(document).ready(function(){
      $('.confirm-decorate-scheme').on('click',function(event){
          event.preventDefault();
      	  $temporary_confirm=$(this);
      	  $confirmid = $(this).prev().val();
      });
      $('.for-confirm').on('click',function(){
          $.post( "/decorate_schemes/confirm/"+$confirmid, function( data ) {
            $('.confirm-decorate-scheme').hide();
            $temporary_confirm.next().text("已确认");
          });
      });
  });
</script>
{'fraction_non_alphanumeric': 0.18509106310885218, 'fraction_numerical': 0.006635606381476775, 'mean_word_length': 2.042955326460481, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 151, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1873937', 'n_tokens_mistral': 2336, 'n_tokens_neox': 2260, 'n_words': 348}