<commit_before><% content_for :user, true %>
<% content_for :title, "Settings - Your " %>	
<% content_for :has_footer, true %>
<% content_for :setting_active, 'session' %>
<% content_for :scripts do %>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"></script>
<script>
$(document).ready(function() {
	google.maps.visualRefresh = true;

	<% @sessions.each do |session| %>
		<% 
			stuff = session.gps_loc.split(',')
			lat = stuff[0]
			lng = stuff[1]
		%>
		var sessionPosition = new google.maps.LatLng(<%= lat %>, <%= lng %>);
		var mapOptions = {
			zoom: 12,
			center: sessionPosition,
    		disableDefaultUI: true,
			mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		new google.maps.Marker({
			position: sessionPosition,
			map: new google.maps.Map(document.getElementById('map-<%= session.id %>'), mapOptions)
		});
	<% end %>
});
</script>
<% end %>
<% content_for :template, 'account settings settings_session' %>

<%= render partial: 'user/account/partials/header' %>

<div class="container">
	<div class="row">
		<div class="col-md-3">
			<%= render partial: 'user/settings/partials/sidebar' %>
		</div>

		<div class="col-md-9">
			<div class="bs-branch-section sessions">
				<div class="page-header">
					<h1>Sessions</h1>
				</div>

				<% @sessions.each do |user_session| %>
					<div class="row entry">
						<div class="col-md-12 session">
							<div class="map" id="map-<%= user_session.id %>"></div>
							<div class="mask">
								<div class="inner-content">
									<h2><%= user_session.location %></h2>
									<span class="ip"><%= user_session.owner_ip %></span>
									<hr />
									<span class="browser">Browser: <strong><%= user_session.browser %></strong></span> <br />
									<span class="os">Operating System: <strong><%= user_session.platform %></strong></span> <br />
									<%= form_for :session, url: :settings_session_destroy, method: :delete do |f| %>
										<%= hidden_field(:session, :sid, value: user_session.id) %>
										<% if request.session[:session_id] == user_session.identifier %>
											<%= f.submit('Murder Primary Session', class: 'btn btn-danger btn-large', confirm: 'This is your current session, killing this will sign you out.') %>
										<% else %>
											<%= f.submit('Murder Session', class: 'btn btn-danger btn-large') %>
										<% end %>
									<% end %>
								</div>
							</div>
						</div>
					</div>
				<% end %>
			</div>
		</div>
	</div>
</div>
<commit_msg>error catching if session gps/address shit is invalid<commit_after><% content_for :user, true %>
<% content_for :title, "Settings - Your " %>	
<% content_for :has_footer, true %>
<% content_for :setting_active, 'session' %>
<% content_for :scripts do %>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"></script>
<script>
$(document).ready(function() {
	google.maps.visualRefresh = true;

	<% @sessions.each do |session| %>
		<%
			lat = 0
			lng = 0

			if session.gps_loc != ','
				stuff = session.gps_loc.split(',')
				lat = stuff[0]
				lng = stuff[1]
			end
		%>
		var sessionPosition = new google.maps.LatLng(<%= lat %>, <%= lng %>);
		var mapOptions = {
			zoom: 12,
			center: sessionPosition,
    		disableDefaultUI: true,
			mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		new google.maps.Marker({
			position: sessionPosition,
			map: new google.maps.Map(document.getElementById('map-<%= session.id %>'), mapOptions)
		});
	<% end %>
});
</script>
<% end %>
<% content_for :template, 'account settings settings_session' %>

<%= render partial: 'user/account/partials/header' %>

<div class="container">
	<div class="row">
		<div class="col-md-3">
			<%= render partial: 'user/settings/partials/sidebar' %>
		</div>

		<div class="col-md-9">
			<div class="bs-branch-section sessions">
				<div class="page-header">
					<h1>Sessions</h1>
				</div>

				<% @sessions.each do |user_session| %>
					<div class="row entry">
						<div class="col-md-12 session">
							<div class="map" id="map-<%= user_session.id %>"></div>
							<div class="mask">
								<div class="inner-content">
									<% if user_session.location == '' %>
										<h2>Unknown Location</h2>
									<% else %>
										<h2><%= user_session.location %></h2>
									<% end %>
									<span class="ip"><%= user_session.owner_ip %></span>
									<hr />
									<span class="browser">Browser: <strong><%= user_session.browser %></strong></span> <br />
									<span class="os">Operating System: <strong><%= user_session.platform %></strong></span> <br />
									<%= form_for :session, url: :settings_session_destroy, method: :delete do |f| %>
										<%= hidden_field(:session, :sid, value: user_session.id) %>
										<% if request.session[:session_id] == user_session.identifier %>
											<%= f.submit('Murder Primary Session', class: 'btn btn-danger btn-large', confirm: 'This is your current session, killing this will sign you out.') %>
										<% else %>
											<%= f.submit('Murder Session', class: 'btn btn-danger btn-large') %>
										<% end %>
									<% end %>
								</div>
							</div>
						</div>
					</div>
				<% end %>
			</div>
		</div>
	</div>
</div>

{'fraction_non_alphanumeric': 0.19324505853003263, 'fraction_numerical': 0.0057570523891767415, 'mean_word_length': 3.021604938271605, 'pattern_counts': {'":': 0, '<': 154, '<?xml version=': 0, '>': 154, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 1, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4255335', 'n_tokens_mistral': 2326, 'n_tokens_neox': 1717, 'n_words': 376}