Skip to content

Commit

Permalink
Minor bug fixes in views. Modified CSS.
Browse files Browse the repository at this point in the history
  • Loading branch information
lykaios committed Apr 26, 2012
1 parent 08c80f7 commit 2259b41
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
6 changes: 6 additions & 0 deletions app/assets/stylesheets/bootstrap_and_overrides.css.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ body {padding-top: 80px;
body.index{
text-align: center;
}
h3.error{
text-align: center;
}
h4.error{
text-align: center;
}
p.query-results{
border-top: 2px;
border-bottom: 0px;
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/sqlcons_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ def index
#@qstring = the query passed through params
def fetchquery
#Save initial query so user doesn't see uid regulation
@qstring_init = params[:q].downcase
@qstring = @qstring_init
@qstring_init = params[:q].downcase
#Use strip to trim out the whitespace
@qstring = @qstring_init.strip
#Pull back regexp for the specific lesson
sectionregex = Sqlcons.select(:regtext).where(:ch => session[:tutch], :sec => session[:tutsec]).first.regtext
@qmodel = Sqlcons.new(:id => 1, :qtext=> @qstring, :regtext => sectionregex)
Expand Down
6 changes: 3 additions & 3 deletions app/views/sqlcons/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
<!--
Regtext = <%= @qmodel.regtext.to_s if @qmodel%> | Qtext = <%= @qstring if @qstring%>
-->
<!-- Regtext = <%= @qmodel.regtext.to_s if @qmodel%> | Qtext = <%= @qstring if @qstring%> -->
<!--Prints to screen the current tutorial view or error message-->
<div class="span6">
<%= render :file => @lesson_name%>
Expand All @@ -25,7 +25,7 @@
<% if @qresults %>
<% unprint = [99] %>
<% field_chk = 0 %>
<b><i><%= "Query Results"%></b></i>
<b><i><%="Query Results" if !@waserror%></b></i>
<table >
<% qfields = @qresults.fields%>
<tr>
Expand Down
6 changes: 2 additions & 4 deletions app/views/sqlcons/tutorials/qerror.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<body class="index">
<h3> Your query didn't match this lessons statement. </h3>
<h4> Check the spelling of your query, or stop trying SQL injection </h4>
</body>
<h3 class="error"> Your query didn't match this lessons statement. </h3>
<h4 class="error"> Check the spelling of your query, or stop trying SQL injection </h4>
4 changes: 1 addition & 3 deletions app/views/sqlcons/tutorials/sqlerror.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<body class="index">
<h3> SQL Error (see below)</h3>
</body>
<h3 class="error"> SQL Error (see below)</h3>
2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Sqlcons.create(ch: 2,sec: 2,regtext: '(select)(.*?)(course_fcts)(.*?)(join)(.*?)');
Sqlcons.create(ch: 2,sec: 3,regtext: '(select)(.*?)(students)(.*?)(left join)(.*?)');
Sqlcons.create(ch: 2,sec: 4,regtext: '(select)(.*?)(teachers)(.*?)(left join)(.*?)');
Sqlcons.create(ch: 2,sec: 5,regtext: '(select)(.*?)(teachers)(.*?)(right join)(.*?)');
Sqlcons.create(ch: 2,sec: 5,regtext: '(select)(.*?)(course_fcts)(.*?)(right join)(.*?)');

#Chapter 3
Sqlcons.create(ch: 3,sec: 1,regtext: '(insert|select)(.*?)(students)');
Expand Down

0 comments on commit 2259b41

Please sign in to comment.