change to idiomatic use of layouts versus regular views
no functional change here, but familiar Rails users will see view files in the locations they expect. this also slightly simplifies controller code there is one attendant change in the wiki at `rails_3/A1-SQL-Injection-Interpolation.md` that I'm happy to make after the PR is merged.
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
<form action="">
|
||||
Search by IP: <input type="text" name="ip"><br />
|
||||
<input type="checkbox" value="" name="field[ip_address]"> IP Address<br />
|
||||
<input type="checkbox" value="" name="field[referrer]"> Referrer<br />
|
||||
<input type="checkbox" value="" name="field[user_agent]"> User Agent
|
||||
</form>
|
||||
|
||||
<div id="dt_example" class="example_alt_pagination">
|
||||
<table class="table table-striped table-hover table-bordered pull-left" id="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<%
|
||||
count = (params[:field] ? params[:field].count : 3)
|
||||
count.times do %>
|
||||
<td> </td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @analytics.each do |a|%>
|
||||
<tr>
|
||||
<% a.attributes.each do |k,v| %>
|
||||
<td><%= v %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="editAcct" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function dataTablePagination(){
|
||||
$('#data-table').dataTable({
|
||||
"sPaginationType": "full_numbers"
|
||||
});
|
||||
};
|
||||
|
||||
$(document).ready(dataTablePagination());
|
||||
</script>
|
||||
@@ -1,60 +0,0 @@
|
||||
<div id="dt_example" class="example_alt_pagination">
|
||||
<table class="table table-striped table-hover table-bordered pull-left" id="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
Email
|
||||
</th>
|
||||
<th>
|
||||
Admin User
|
||||
</th>
|
||||
<th>
|
||||
Action
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @users.each do |u|%>
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">
|
||||
<%= "#{u.first_name} #{u.last_name}"%>
|
||||
</td>
|
||||
<td>
|
||||
<%= u.email%>
|
||||
</td>
|
||||
<td>
|
||||
<%= u.admin ? %{<span class="fs1" aria-hidden="true" data-icon=""}.html_safe : nil %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to "Edit", "#", {:onClick => "javascript:openEditModal(#{u.id});", :role => "button", :style => "width:70px", :class => "btn btn-inverse", "data-toggle" => "modal"}%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="editAcct" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function openEditModal(id){
|
||||
var link = '/admin/'+ id +'/get_user';
|
||||
$("#editAcct").load(link);
|
||||
$("#editAcct").modal('show');
|
||||
};
|
||||
|
||||
function dataTablePagination(){
|
||||
$('#data-table').dataTable({
|
||||
"sPaginationType": "full_numbers"
|
||||
});
|
||||
};
|
||||
|
||||
$(document).ready(dataTablePagination());
|
||||
</script>
|
||||
@@ -1,96 +0,0 @@
|
||||
<!-- Begin Modal -->
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
||||
×
|
||||
</button>
|
||||
<h4 id="myModalLabel1">
|
||||
Account Settings
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<%= form_for @user, :html => {:id => "account_edit"} do |f| %>
|
||||
<div class="control-group">
|
||||
<%= f.label :email, nil, {:class => "control-label"}%>
|
||||
<%= f.text_field :email, {:class => "span12"}%>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<%= f.label :first_name, nil, {:class => "control-label"}%>
|
||||
<%= f.text_field :first_name, {:class => "span12"} %>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<%= f.label :last_name, nil, {:class => "control-label"}%>
|
||||
<%= f.text_field :last_name, {:class => "span12"} %>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<%= f.label :password, nil, {:class => "control-label"}%>
|
||||
<%= f.password_field :password, {:class => "span12", :placeholder => "Enter Password"}%>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<%= f.label :password_confirmation, nil, {:class => "control-label"}%>
|
||||
<%= f.password_field :password_confirmation, {:class => "span12", :placeholder => "Enter Password"} %>
|
||||
</div>
|
||||
|
||||
<%= f.label :admin, nil, {:class => "control-label"}%>
|
||||
<%= f.select(:admin, @admin_select) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">
|
||||
Close
|
||||
</button>
|
||||
<%= link_to "Delete", "#", {:id => "delete_button", :class => "btn btn-danger pull-left"} %>
|
||||
<%= f.submit "Submit", {:id => 'submit_button', :class => "btn btn-primary pull-right"} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- End Modal -->
|
||||
|
||||
<%= javascript_include_tag ('validation.js')%>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#submit_button').click(function() {
|
||||
var valuesToSubmit = $("#account_edit").serialize();
|
||||
$("#editAcct").modal('hide');
|
||||
|
||||
$.ajax({
|
||||
url: "/admin/" + <%= @user.user_id %> + "/update_user.json",
|
||||
data: valuesToSubmit,
|
||||
type: "POST",
|
||||
success: function(response) {
|
||||
$('#success').show(500).delay(1500).fadeOut();
|
||||
loadTable();
|
||||
},
|
||||
error: function(event) {
|
||||
$('#failure').show(500).delay(1500).fadeOut();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#delete_button').click(function() {
|
||||
$("#editAcct").modal('hide');
|
||||
|
||||
$.ajax({
|
||||
url: "/admin/" + <%= params[:admin_id] %> + "/delete_user.json",
|
||||
type: "POST",
|
||||
success: function(response) {
|
||||
$('#success').show(500).delay(1500).fadeOut();
|
||||
loadTable();
|
||||
},
|
||||
error: function(event) {
|
||||
$('#failure').show(500).delay(1500).fadeOut();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -1,54 +0,0 @@
|
||||
<div id="column_chart"></div>
|
||||
<!-- Google Visualization JS -->
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// google.load("visualization", "1", {packages:["corechart"]});
|
||||
|
||||
|
||||
|
||||
function drawChart3() {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Year', 'Visitors', 'Orders', 'Income', 'Expenses'],
|
||||
['2007', 300, 800, 900, 300],
|
||||
['2008', 1170, 860, 1220, 564],
|
||||
['2009', 260, 1120, 2870, 2340],
|
||||
['2010', 1030, 540, 3430, 1200],
|
||||
['2011', 200, 700, 1700, 770],
|
||||
['2012', 1170, 2160, 3920, 800], ]);
|
||||
|
||||
var options = {
|
||||
width: 'auto',
|
||||
height: '160',
|
||||
backgroundColor: 'transparent',
|
||||
colors: ['#b5799e', '#579da9', '#e26666', '#1e825e', '#dba26b'],
|
||||
tooltip: {
|
||||
textStyle: {
|
||||
color: '#666666',
|
||||
fontSize: 11
|
||||
},
|
||||
showColorCode: true
|
||||
},
|
||||
legend: {
|
||||
textStyle: {
|
||||
color: 'black',
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
chartArea: {
|
||||
left: 60,
|
||||
top: 10,
|
||||
height: '80%'
|
||||
},
|
||||
};
|
||||
|
||||
var chart = new google.visualization.ColumnChart(document.getElementById('column_chart'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(
|
||||
drawChart3()
|
||||
);
|
||||
|
||||
</script>
|
||||
@@ -1,199 +0,0 @@
|
||||
<% if @user.paid_time_off %>
|
||||
<!-- Begin easy pie charts container -->
|
||||
<div class="easy-pie-charts-container">
|
||||
<div class="pie-chart">
|
||||
<div class="chart1" data-percent="100">
|
||||
<%= @user.paid_time_off.pto_days_remaining %>
|
||||
</div>
|
||||
<h5 class="name">
|
||||
Available PTO
|
||||
</h5>
|
||||
</div>
|
||||
<div class="pie-chart">
|
||||
<div class="chart2" data-percent="<%= @user.paid_time_off.sick_days_taken_percentage %>">
|
||||
<%= @user.paid_time_off.sick_days_taken %>
|
||||
</div>
|
||||
<h5 class="name">
|
||||
Sick Days Taken
|
||||
</h5>
|
||||
</div>
|
||||
<div class="pie-chart">
|
||||
<div class="chart3" data-percent="100">
|
||||
<%= @user.work_info.income %>
|
||||
</div>
|
||||
<h5 class="name">
|
||||
Income
|
||||
</h5>
|
||||
</div>
|
||||
<div class="pie-chart">
|
||||
<div class="chart4" data-percent="100">
|
||||
<%= @user.performance.last.score %>
|
||||
</div>
|
||||
<h5 class="name">
|
||||
Performance Score
|
||||
</h5>
|
||||
</div>
|
||||
<div class="pie-chart">
|
||||
<div class="chart5" data-percent="91">
|
||||
<%= @user.retirement.total %>
|
||||
</div>
|
||||
<h5 class="name">
|
||||
401k
|
||||
</h5>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
</div>
|
||||
</div>
|
||||
<!-- End easy pie charts container -->
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
|
||||
function pieChartHome() {
|
||||
$(function () {
|
||||
//create instance
|
||||
$('.chart1').easyPieChart({
|
||||
animate: 2000,
|
||||
barColor: '#e26666',
|
||||
trackColor: '#dddddd',
|
||||
scaleColor: '#e26666',
|
||||
size: 160,
|
||||
lineWidth: 7,
|
||||
});
|
||||
//update instance after 5 sec
|
||||
setTimeout(function () {
|
||||
$('.chart1').data('easyPieChart').update(50);
|
||||
}, 5000);
|
||||
setTimeout(function () {
|
||||
$('.chart1').data('easyPieChart').update(70);
|
||||
}, 10000);
|
||||
setTimeout(function () {
|
||||
$('.chart1').data('easyPieChart').update(30);
|
||||
}, 15000);
|
||||
setTimeout(function () {
|
||||
$('.chart1').data('easyPieChart').update(90);
|
||||
}, 19000);
|
||||
setTimeout(function () {
|
||||
$('.chart1').data('easyPieChart').update(40);
|
||||
}, 32000);
|
||||
});
|
||||
|
||||
$(function () {
|
||||
//create instance
|
||||
$('.chart2').easyPieChart({
|
||||
animate: 2000,
|
||||
barColor: '#b5799e',
|
||||
trackColor: '#dddddd',
|
||||
scaleColor: '#b5799e',
|
||||
size: 160,
|
||||
lineWidth: 7,
|
||||
});
|
||||
//update instance after 5 sec
|
||||
setTimeout(function () {
|
||||
$('.chart2').data('easyPieChart').update(90);
|
||||
}, 10000);
|
||||
setTimeout(function () {
|
||||
$('.chart2').data('easyPieChart').update(40);
|
||||
}, 18000);
|
||||
setTimeout(function () {
|
||||
$('.chart2').data('easyPieChart').update(70);
|
||||
}, 28000);
|
||||
setTimeout(function () {
|
||||
$('.chart2').data('easyPieChart').update(50);
|
||||
}, 32000);
|
||||
setTimeout(function () {
|
||||
$('.chart2').data('easyPieChart').update(80);
|
||||
}, 40000);
|
||||
});
|
||||
|
||||
$(function () {
|
||||
//create instance
|
||||
$('.chart3').easyPieChart({
|
||||
animate: 2000,
|
||||
barColor: '#579da9',
|
||||
trackColor: '#dddddd',
|
||||
scaleColor: '#579da9',
|
||||
size: 160,
|
||||
lineWidth: 7,
|
||||
});
|
||||
//update instance after 5 sec
|
||||
setTimeout(function () {
|
||||
$('.chart3').data('easyPieChart').update(20);
|
||||
}, 9000);
|
||||
setTimeout(function () {
|
||||
$('.chart3').data('easyPieChart').update(59);
|
||||
}, 20000);
|
||||
setTimeout(function () {
|
||||
$('.chart3').data('easyPieChart').update(38);
|
||||
}, 35000);
|
||||
setTimeout(function () {
|
||||
$('.chart3').data('easyPieChart').update(79);
|
||||
}, 49000);
|
||||
setTimeout(function () {
|
||||
$('.chart3').data('easyPieChart').update(96);
|
||||
}, 52000);
|
||||
});
|
||||
|
||||
$(function () {
|
||||
//create instance
|
||||
$('.chart4').easyPieChart({
|
||||
animate: 2000,
|
||||
barColor: '#dba26b',
|
||||
trackColor: '#dddddd',
|
||||
scaleColor: '#dba26b',
|
||||
size: 160,
|
||||
lineWidth: 7,
|
||||
});
|
||||
//update instance after 5 sec
|
||||
setTimeout(function () {
|
||||
$('.chart4').data('easyPieChart').update(40);
|
||||
}, 6000);
|
||||
setTimeout(function () {
|
||||
$('.chart4').data('easyPieChart').update(67);
|
||||
}, 14000);
|
||||
setTimeout(function () {
|
||||
$('.chart4').data('easyPieChart').update(43);
|
||||
}, 23000);
|
||||
setTimeout(function () {
|
||||
$('.chart4').data('easyPieChart').update(80);
|
||||
}, 36000);
|
||||
setTimeout(function () {
|
||||
$('.chart4').data('easyPieChart').update(66);
|
||||
}, 41000);
|
||||
});
|
||||
|
||||
$(function () {
|
||||
//create instance
|
||||
$('.chart5').easyPieChart({
|
||||
animate: 3000,
|
||||
barColor: '#1e825e',
|
||||
trackColor: '#dddddd',
|
||||
scaleColor: '#1e825e',
|
||||
size: 160,
|
||||
lineWidth: 7,
|
||||
});
|
||||
//update instance after 5 sec
|
||||
setTimeout(function () {
|
||||
$('.chart5').data('easyPieChart').update(30);
|
||||
}, 9000);
|
||||
setTimeout(function () {
|
||||
$('.chart5').data('easyPieChart').update(87);
|
||||
}, 19000);
|
||||
setTimeout(function () {
|
||||
$('.chart5').data('easyPieChart').update(28);
|
||||
}, 27000);
|
||||
setTimeout(function () {
|
||||
$('.chart5').data('easyPieChart').update(69);
|
||||
}, 39000);
|
||||
setTimeout(function () {
|
||||
$('.chart5').data('easyPieChart').update(99);
|
||||
}, 47000);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(
|
||||
pieChartHome()
|
||||
);
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
<!-- Begin Modal -->
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
||||
×
|
||||
</button>
|
||||
<h4 id="myModalLabel1">
|
||||
Application Credentials (Spoiler)
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<p>Warning, this is a spoiler</p>
|
||||
<p>Are you sure you want to see the credentials?</p>
|
||||
<div id="creds_hidden" style="display:none">
|
||||
<table class="table table-striped table-hover table-bordered pull-left" id="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Email
|
||||
</th>
|
||||
<th>
|
||||
Password
|
||||
</th>
|
||||
<th>
|
||||
API Key
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">
|
||||
admin@metacorp.com
|
||||
</td>
|
||||
<td>
|
||||
admin1234
|
||||
</td>
|
||||
<td>
|
||||
1-01de24d75cffaa66db205278d1cf900bf087a737
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">
|
||||
jack@metacorp.com
|
||||
</td>
|
||||
<td>
|
||||
yankeessuck
|
||||
</td>
|
||||
<td>
|
||||
2-050ddd40584978fe9e82840b8b95abb98e4786dc
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">
|
||||
jim@metacorp.com
|
||||
</td>
|
||||
<td>
|
||||
alohaowasp
|
||||
</td>
|
||||
<td>
|
||||
3-eaa9b4d748d6a8c6a38e24ac1cc2204ebc3541c1
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">
|
||||
mike@metacorp.com
|
||||
</td>
|
||||
<td>
|
||||
motocross1445
|
||||
</td>
|
||||
<td>
|
||||
4-4c809b3d11d272cff8cab1da9e4cdf61137f29d2
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">
|
||||
ken@metacorp.com
|
||||
</td>
|
||||
<td>
|
||||
citrusblend
|
||||
</td>
|
||||
<td>
|
||||
5-4af604a848ca212cfa3935352aabe9522cf89fdc
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">
|
||||
Close
|
||||
</button>
|
||||
<button id="understood" class="btn btn-primary" aria-hidden="true">
|
||||
I understand
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- End Modal -->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#understood').click(function() {
|
||||
$("#creds_hidden").show();
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user