<commit_before>
<% provide :title, t(:event_detail) %>

<div class="row">
  <div class="large-2 columns">
    <%= image_tag @title_pic, class: 'profile-image round' if @event %>
  </div>
  <div class="large-10 columns">
    <h2><%= @event.title %></h2>
  </div>
</div>
<div class="row">
  <div class="small-12 columns">
    <%= event_info(@event) %><br>
  </div>
</div>
<div class="row">
  <div class="small-12 columns">
    <table style="width:100%">
      <tr>
        <th><%=t(:event)%> No.</th>
        <td>#<%= @event.id.to_s.rjust(10,'0') %></td>
      </tr>
      <tr>
        <th><%=t(:start_time)%></th>
        <td><%= @event.start_time.strftime("%Y-%m-%d %H:%M") %></td>
      </tr>
      <tr>
        <th><%=t(:duration)%></th>
        <td><%=@event.event_duration[0] + t(:day) + @event.event_duration[1] + t(:hour) + @event.event_duration[2] + t(:minute)  %></td>
      </tr>
      <tr>
        <th><%=t(:address)%></th>
        <td class="event-address"><%=@event.address%></td>
      </tr>
      <tr>
        <th><%=t(:contact)%></th>
        <td>
          <span class="contact-name"><%= @event.name.present? ? @event.name : @event.user.nickname %></span>
          <span class="contact-mobile"><%= @event.user.mobile %></span>
        </td>
      </tr>
      <tr>
        <th><%=t(:limited_people)%></th>
        <td><%=@event.limited_people%></td>
      </tr>
      <tr>
        <th><%=t(:participants)%></th>
        <td><%=@participants.count%></td>
      </tr>
      <tr>
        <th><%=t(:price)%></th>
        <td><%= @event.price.to_i > 0 ? '￥' + @event.price.to_s : t(:free) %></td>
      </tr>
      <tr>

        <td colspan='2'>
          <% if @content_pic.present? %>
          <% @content_pic.each do |pic| %>
          <div class="content-pictures columns small-12 medium-8 medium-center large-6 large-center">
            <%= image_tag pic.try(:image).present? ? pic.image : pic %>
          </div>
          <% end %>
          <% end %>
          <%= @event.body.html_safe  %>
        </td>
      </tr>
    </table>
  </div>
</div>
<% if current_user == @event.user %>
<div class="row">
  <div class="small-12 columns">
    <%= link_to '<i class="fa fa-pencil"></i>'.html_safe + ' ' + t(:edit), edit_event_path(@event), class:"tiny button radius" %>
    <%= link_to '<i class="fa fa-times"></i>'.html_safe + ' ' + t(:delete), @event, method: :delete,
    class:"tiny button alert radius",
      data: {confirm: '?'} %>
    </div>
  </div>
  <% end %>
  <div class="row">
    <div class="small-12 columns">
      <ul class="tabs" data-tab role="tablist">
        <li class="tab-title active">
          <a href="#participants"><i class="fa fa-user-plus"></i><%=t(:goings)%> (<%=@event.participants_count%>)</a>
        </li>
        <li class="tab-title">
          <a href="#comments"><i class="fa fa-comments"></i><%=t(:comments)%> (<%=@event.comments_count%>)</a>
        </li>
      </ul>
      <div class="tabs-content panel">
        <div class="content active" id="participants">
          <%=render 'participants/form' ,:locals=>{@parent=>@parent,@participant=>@participant} if current_user%>
          <%= render @participants %>
        </div>
        <div class="content" id="comments">
          <%=render 'comments/form' ,:locals=>{@parent=>@parent,@comment=>@comment} if current_user%>
          <div class="comments-list">
            <%= render @comments %>
          </div>
          <% if @active %>
          <a style="width:100%" href="#" class="more-comments tiny expanded button" data-parent="<%= params[:controller].gsub(/\w$/, '') %>" data-count="<%= @events.comments.count %>" data-id="<%= @event.id %>" data-url="<%= events_more_comments_path %>"><%= t(:more) %></a>
          <% end %>
        </div>
      </div>
    </div>
    <div id="container" class="gaodemap"></div>

  </div>


  <style type="text/css">
    html{height:100%}
    body{height:100%;margin:0px;padding:0px}
    #container {width:60%; height: 260px; position: relative;margin-left: 20%; }
  </style>

<!--地图-->
  <script type="text/javascript">
    var address = $('.event-address').text();
    var map = new AMap.Map("container", {
      //lang: 'en',
      zoom: 14,
      resizeEnable: false
    });
    function geocoder() {
      AMap.service('AMap.Geocoder',function(){//回调函数
        //实例化Geocoder
        var geocoder = new AMap.Geocoder({
        });
        //地理编码,返回地理编码结果
        geocoder.getLocation(address, function(status, result) {
          if (status === 'complete' && result.info === 'OK') {
            geocoder_CallBack(result);
          }
        });
      });
    }

    function addMarker(i, d) {
      var marker = new AMap.Marker({
        map: map,
        position: [ d.location.getLng(),  d.location.getLat()]
      });
      var infoWindow = new AMap.InfoWindow({
        content: d.formattedAddress,
        offset: {x: 0, y: -30}
      });
      marker.on("mouseover", function(e) {
        infoWindow.open(map, marker.getPosition());
      });
    }
    //地理编码返回结果展示
    function geocoder_CallBack(data) {
      var resultStr = "";
        //地理编码结果数组
        var geocode = data.geocodes;
        for (var i = 0; i < geocode.length; i++) {
            //拼接输出html
            resultStr += "<span style=\"font-size: 12px;padding:0px 0 4px 2px; border-bottom:1px solid #C1FFC1;\">" + "<b>地址</b>：" + geocode[i].formattedAddress + "" + "&nbsp;&nbsp;<b>的地理编码结果是:</b><b>&nbsp;&nbsp;&nbsp;&nbsp;坐标</b>：" + geocode[i].location.getLng() + ", " + geocode[i].location.getLat() + "" + "<b>&nbsp;&nbsp;&nbsp;&nbsp;匹配级别</b>：" + geocode[i].level + "</span>";
            addMarker(i, geocode[i]);
            map.setCenter([ geocode[i].location.getLng(),  geocode[i].location.getLat()]);
          }
          
        }

      </script>

      <!-- ##################comment上传图片#####################   -->
      <script type="text/javascript" src="http://www.trade-v.com:5000/assets/comments.js"></script>

      <!--分享-->
      <script>
        console.log(location.href);
        wx.config({
    debug: false,  //开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
    appId: "<%= @appId %>", // 必填，公众号的唯一标识
    timestamp: "<%= @timestamp %>", // 必填，生成签名的时间戳
    nonceStr: "<%= @noncestr %>", // 必填，生成签名的随机串
    signature: "<%= @sign %>",// 必填，签名，见附录1
    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
  });
        wx.ready(function(){
          var url = location.href;
          wx.onMenuShareTimeline({
    title: "<%= @title %>", // 分享标题
    link: url, // 分享链接
    imgUrl: "<%= @img_url %>", // 分享图标
    success: function () {
        // 用户确认分享后执行的回调函数
        
      },
      cancel: function () {
        // 用户取消分享后执行的回调函数
      }
    });

          wx.onMenuShareAppMessage({

      title: "<%= @title %>", // 分享标题
      desc: "<%= @desc %>", // 分享描述
      link: url, // 分享链接
      imgUrl: "<%= @img_url %>", // 分享图标
      type: 'link', // 分享类型,music、video或link，不填默认为link
      dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
      success: function () {
          // 用户确认分享后执行的回调函数
        },
        cancel: function () {
          // 用户取消分享后执行的回调函数
        }

      });

        });

      </script>

<commit_msg>change the size of map<commit_after>
<% provide :title, t(:event_detail) %>

<div class="row">
  <div class="large-2 columns">
    <%= image_tag @title_pic, class: 'profile-image round' if @event %>
  </div>
  <div class="large-10 columns">
    <h2><%= @event.title %></h2>
  </div>
</div>
<div class="row">
  <div class="small-12 columns">
    <%= event_info(@event) %><br>
  </div>
</div>
<div class="row">
  <div class="small-12 columns">
    <table style="width:100%">
      <tr>
        <th><%=t(:event)%> No.</th>
        <td>#<%= @event.id.to_s.rjust(10,'0') %></td>
      </tr>
      <tr>
        <th><%=t(:start_time)%></th>
        <td><%= @event.start_time.strftime("%Y-%m-%d %H:%M") %></td>
      </tr>
      <tr>
        <th><%=t(:duration)%></th>
        <td><%=@event.event_duration[0] + t(:day) + @event.event_duration[1] + t(:hour) + @event.event_duration[2] + t(:minute)  %></td>
      </tr>
      <tr>
        <th><%=t(:address)%></th>
        <td class="event-address"><%=@event.address%></td>
      </tr>
      <tr>
        <th><%=t(:contact)%></th>
        <td>
          <span class="contact-name"><%= @event.name.present? ? @event.name : @event.user.nickname %></span>
          <span class="contact-mobile"><%= @event.user.mobile %></span>
        </td>
      </tr>
      <tr>
        <th><%=t(:limited_people)%></th>
        <td><%=@event.limited_people%></td>
      </tr>
      <tr>
        <th><%=t(:participants)%></th>
        <td><%=@participants.count%></td>
      </tr>
      <tr>
        <th><%=t(:price)%></th>
        <td><%= @event.price.to_i > 0 ? '￥' + @event.price.to_s : t(:free) %></td>
      </tr>
      <tr>

        <td colspan='2'>
          <% if @content_pic.present? %>
          <% @content_pic.each do |pic| %>
          <div class="content-pictures columns small-12 medium-8 medium-center large-6 large-center">
            <%= image_tag pic.try(:image).present? ? pic.image : pic %>
          </div>
          <% end %>
          <% end %>
          <%= @event.body.html_safe  %>
        </td>
      </tr>
    </table>
  </div>
</div>
<% if current_user == @event.user %>
<div class="row">
  <div class="small-12 columns">
    <%= link_to '<i class="fa fa-pencil"></i>'.html_safe + ' ' + t(:edit), edit_event_path(@event), class:"tiny button radius" %>
    <%= link_to '<i class="fa fa-times"></i>'.html_safe + ' ' + t(:delete), @event, method: :delete,
    class:"tiny button alert radius",
      data: {confirm: '?'} %>
    </div>
  </div>
  <% end %>
  <div class="row">
    <div class="small-12 columns">
      <ul class="tabs" data-tab role="tablist">
        <li class="tab-title active">
          <a href="#participants"><i class="fa fa-user-plus"></i><%=t(:goings)%> (<%=@event.participants_count%>)</a>
        </li>
        <li class="tab-title">
          <a href="#comments"><i class="fa fa-comments"></i><%=t(:comments)%> (<%=@event.comments_count%>)</a>
        </li>
      </ul>
      <div class="tabs-content panel">
        <div class="content active" id="participants">
          <%=render 'participants/form' ,:locals=>{@parent=>@parent,@participant=>@participant} if current_user%>
          <%= render @participants %>
        </div>
        <div class="content" id="comments">
          <%=render 'comments/form' ,:locals=>{@parent=>@parent,@comment=>@comment} if current_user%>
          <div class="comments-list">
            <%= render @comments %>
          </div>
          <% if @active %>
          <a style="width:100%" href="#" class="more-comments tiny expanded button" data-parent="<%= params[:controller].gsub(/\w$/, '') %>" data-count="<%= @events.comments.count %>" data-id="<%= @event.id %>" data-url="<%= events_more_comments_path %>"><%= t(:more) %></a>
          <% end %>
        </div>
      </div>
    </div>
    <div id="container" class="gaodemap"></div>

  </div>


  <style type="text/css">
    html{height:100%}
    body{height:100%;margin:0px;padding:0px}
    #container {width:90%; height: 260px; position: relative;margin-left: 5%; }
  </style>

<!--地图-->
  <script type="text/javascript">
    var address = $('.event-address').text();
    var map = new AMap.Map("container", {
      //lang: 'en',
      zoom: 14,
      resizeEnable: false
    });
    function geocoder() {
      AMap.service('AMap.Geocoder',function(){//回调函数
        //实例化Geocoder
        var geocoder = new AMap.Geocoder({
        });
        //地理编码,返回地理编码结果
        geocoder.getLocation(address, function(status, result) {
          if (status === 'complete' && result.info === 'OK') {
            geocoder_CallBack(result);
          }
        });
      });
    }

    function addMarker(i, d) {
      var marker = new AMap.Marker({
        map: map,
        position: [ d.location.getLng(),  d.location.getLat()]
      });
      var infoWindow = new AMap.InfoWindow({
        content: d.formattedAddress,
        offset: {x: 0, y: -30}
      });
      marker.on("mouseover", function(e) {
        infoWindow.open(map, marker.getPosition());
      });
    }
    //地理编码返回结果展示
    function geocoder_CallBack(data) {
      var resultStr = "";
        //地理编码结果数组
        var geocode = data.geocodes;
        for (var i = 0; i < geocode.length; i++) {
            //拼接输出html
            resultStr += "<span style=\"font-size: 12px;padding:0px 0 4px 2px; border-bottom:1px solid #C1FFC1;\">" + "<b>地址</b>：" + geocode[i].formattedAddress + "" + "&nbsp;&nbsp;<b>的地理编码结果是:</b><b>&nbsp;&nbsp;&nbsp;&nbsp;坐标</b>：" + geocode[i].location.getLng() + ", " + geocode[i].location.getLat() + "" + "<b>&nbsp;&nbsp;&nbsp;&nbsp;匹配级别</b>：" + geocode[i].level + "</span>";
            addMarker(i, geocode[i]);
            map.setCenter([ geocode[i].location.getLng(),  geocode[i].location.getLat()]);
          }
          
        }

      </script>

      <!-- ##################comment上传图片#####################   -->
      <script type="text/javascript" src="http://www.trade-v.com:5000/assets/comments.js"></script>

      <!--分享-->
      <script>
        console.log(location.href);
        wx.config({
    debug: false,  //开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
    appId: "<%= @appId %>", // 必填，公众号的唯一标识
    timestamp: "<%= @timestamp %>", // 必填，生成签名的时间戳
    nonceStr: "<%= @noncestr %>", // 必填，生成签名的随机串
    signature: "<%= @sign %>",// 必填，签名，见附录1
    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
  });
        wx.ready(function(){
          var url = location.href;
          wx.onMenuShareTimeline({
    title: "<%= @title %>", // 分享标题
    link: url, // 分享链接
    imgUrl: "<%= @img_url %>", // 分享图标
    success: function () {
        // 用户确认分享后执行的回调函数
        
      },
      cancel: function () {
        // 用户取消分享后执行的回调函数
      }
    });

          wx.onMenuShareAppMessage({

      title: "<%= @title %>", // 分享标题
      desc: "<%= @desc %>", // 分享描述
      link: url, // 分享链接
      imgUrl: "<%= @img_url %>", // 分享图标
      type: 'link', // 分享类型,music、video或link，不填默认为link
      dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
      success: function () {
          // 用户确认分享后执行的回调函数
        },
        cancel: function () {
          // 用户取消分享后执行的回调函数
        }

      });

        });

      </script>


{'fraction_non_alphanumeric': 0.2232032004414402, 'fraction_numerical': 0.009173679128155608, 'mean_word_length': 2.3585823488533704, 'pattern_counts': {'":': 0, '<': 387, '<?xml version=': 0, '>': 399, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3077716', 'n_tokens_mistral': 5676, 'n_tokens_neox': 5603, 'n_words': 872}