Permalink
Browse files

Merge branch 'feature/codemirror' into develop

  • Loading branch information...
2 parents cab9685 + 92f48b1 commit f654d6263373c91e12fb6a67b60993ed58cdd883 Zach Morek committed Nov 12, 2013
View
@@ -7,6 +7,7 @@ gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 1.2'
gem 'simple_form'
+gem 'codemirror-rails'
group :doc do
gem 'sdoc', require: false
View
@@ -39,6 +39,8 @@ GEM
bootstrap-sass (2.3.2.2)
sass (~> 3.2)
builder (3.1.4)
+ codemirror-rails (3.16)
+ railties (>= 3.0, < 5)
diff-lcs (1.2.5)
dotenv (0.9.0)
dotenv-rails (0.9.0)
@@ -142,6 +144,7 @@ DEPENDENCIES
activerecord-jdbcmysql-adapter (= 1.3.0)
activerecord-jdbcsqlite3-adapter
bootstrap-sass (~> 2.3.2.0)
+ codemirror-rails
dotenv-rails
jbuilder (~> 1.2)
jquery-rails
@@ -13,4 +13,17 @@
//= require jquery
//= require jquery_ujs
//= require bootstrap
+//= require codemirror
+//= require codemirror/modes/sql
//= require_tree .
+
+$(function() {
+ window.editor = CodeMirror.fromTextArea($('#run_query_sql')[0], {
+ mode: 'text/x-sql',
+ indentWithTabs: true,
+ smartIndent: true,
+ lineNumbers: true,
+ matchBrackets : true,
+ autofocus: true
+ });
+});
@@ -9,6 +9,11 @@
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
+ *= require codemirror
*= require_tree .
*/
@import "bootstrap";
+
+body {
+ padding-top: 40px;
+}
@@ -1,14 +1,17 @@
<!DOCTYPE html>
<html>
-<head>
- <title>DonorsChoose</title>
- <%= stylesheet_link_tag "application", media: "all" %>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-
-<%= yield %>
-
-</body>
+ <head>
+ <title>DonorsChoose</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <%= stylesheet_link_tag "application", media: "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+ </head>
+ <body>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <%= yield %>
+ </div>
+ </div>
+ </body>
</html>
@@ -2,7 +2,7 @@
<%= f.error_notification %>
<div class="form-inputs">
- <%= f.input :sql %>
+ <%= f.input :sql, :as => :text, :input_html => { :cols => 80, :rows => 10 } %>
</div>
<div class="form-actions">
@@ -1,5 +1,5 @@
-<h1>New run_query</h1>
-
-<%= render 'form' %>
-
-<%= link_to 'Back', run_queries_path %>
+<div class="span12">
+ <div class="well">
+ <%= render 'form' %>
+ </div>
+</div>
@@ -1,4 +1,8 @@
en:
+ helpers:
+ submit:
+ run_query:
+ create: "Run Query"
simple_form:
"yes": 'Yes'
"no": 'No'

0 comments on commit f654d62

Please sign in to comment.