Skip to content

Commit

Permalink
Improved show view
Browse files Browse the repository at this point in the history
  • Loading branch information
lykaios committed May 2, 2012
1 parent 54dc516 commit d79045e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
10 changes: 9 additions & 1 deletion app/assets/stylesheets/bootstrap_and_overrides.css.less
Expand Up @@ -12,7 +12,8 @@
@backgroundColor: #EFEFEF;
@highlightColor:white;
@tabborder: #999;

@textareaW: 500px;
@textareaH: 40px;
body {padding-top: 80px;
background-color: @backgroundColor;
//text-align: center;
Expand All @@ -36,6 +37,13 @@ p.query-results{
border-color: black;
text-align: center;
}
textarea{
resize: none;
max-height: @textareaH;
min-height: @textareaH;
max-width: @textareaW;
min-width: @textareaW;
}
table{
border: 2px solid @tabborder;
text-align: center;
Expand Down
6 changes: 4 additions & 2 deletions app/views/sqlcons/show.html.erb
Expand Up @@ -3,23 +3,25 @@
<div class="span12">Regtext = <%= @qmodel.regtext.to_s if @qmodel%> | Qtext = <%= @qstring if @qstring%> </div>
<% end %>

<!--Prints to screen the current tutorial view or error message-->
<!--Prints to screen the current tutorial view-->
<div class="span6">
<%= render :file => @lesson_name%>
<p>
<!-- Text area for next query-->
<%= form_tag(sqlcons_fetchquery_path, :method => "get") do %>
<%= text_area_tag(:q, @qstring_init,:size=>"60x3") %>
<%= text_area_tag(:q, @qstring_init,:size=>"100x3") %>
<br />
<%= submit_tag("QueryDB", :onclick=>"this", :class=>"btn btn-inverse") %>
<!-- if they submitted a valid query, allow them to move on to the next section -->
<%= link_to( "Next Lesson", sqlcons_nextlesson_path, :class=>"btn btn-success") if @qstatus == 0%>
<% end %>
</div>
<!--Display the tips page-->
<div class="span6">
<%= render :file => @help_name%>
</div>
<br />
<!-- Display all the query results -->
<div class="span12">
<p class="query-results">
<%= render :file => @error_name if @waserror%>
Expand Down
1 change: 1 addition & 0 deletions app/views/sqlcons/tutorials/help.html
Expand Up @@ -42,4 +42,5 @@ <h3>Tips</h3>
<td>student_id</td>
</tr>
</table>
<br />
</div>
2 changes: 1 addition & 1 deletion db/seeds.rb
Expand Up @@ -24,7 +24,7 @@
Sqlcons.create(ch: 3,sec: 4,regtext: '(update)(.*?)(courses)( )+(set)|(select)(.*?)(courses)');

#Chapter 4
Sqlcons.create(ch: 4,sec: 1,regtext: '(select)(.*?)');
Sqlcons.create(ch: 4,sec: 1,regtext: '(select)(.*?)(count)');

#Chapter description for each chapter.
Chapters.create( title:'Select' , description:'The most basic forms of querying a database', maxlesson:7);
Expand Down

0 comments on commit d79045e

Please sign in to comment.