Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Commit

Permalink
Merge branch 'feature/codemirror' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Morek committed Nov 12, 2013
2 parents cab9685 + 92f48b1 commit f654d62
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 17 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails' gem 'jquery-rails'
gem 'jbuilder', '~> 1.2' gem 'jbuilder', '~> 1.2'
gem 'simple_form' gem 'simple_form'
gem 'codemirror-rails'


group :doc do group :doc do
gem 'sdoc', require: false gem 'sdoc', require: false
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ GEM
bootstrap-sass (2.3.2.2) bootstrap-sass (2.3.2.2)
sass (~> 3.2) sass (~> 3.2)
builder (3.1.4) builder (3.1.4)
codemirror-rails (3.16)
railties (>= 3.0, < 5)
diff-lcs (1.2.5) diff-lcs (1.2.5)
dotenv (0.9.0) dotenv (0.9.0)
dotenv-rails (0.9.0) dotenv-rails (0.9.0)
Expand Down Expand Up @@ -142,6 +144,7 @@ DEPENDENCIES
activerecord-jdbcmysql-adapter (= 1.3.0) activerecord-jdbcmysql-adapter (= 1.3.0)
activerecord-jdbcsqlite3-adapter activerecord-jdbcsqlite3-adapter
bootstrap-sass (~> 2.3.2.0) bootstrap-sass (~> 2.3.2.0)
codemirror-rails
dotenv-rails dotenv-rails
jbuilder (~> 1.2) jbuilder (~> 1.2)
jquery-rails jquery-rails
Expand Down
13 changes: 13 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,4 +13,17 @@
//= require jquery //= require jquery
//= require jquery_ujs //= require jquery_ujs
//= require bootstrap //= require bootstrap
//= require codemirror
//= require codemirror/modes/sql
//= require_tree . //= 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
});
});
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
* compiled file, but it's generally better to create a new file per style scope. * compiled file, but it's generally better to create a new file per style scope.
* *
*= require_self *= require_self
*= require codemirror
*= require_tree . *= require_tree .
*/ */
@import "bootstrap"; @import "bootstrap";

body {
padding-top: 40px;
}
25 changes: 14 additions & 11 deletions app/views/layouts/application.html.erb
Original file line number Original file line Diff line number Diff line change
@@ -1,14 +1,17 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>DonorsChoose</title> <title>DonorsChoose</title>
<%= stylesheet_link_tag "application", media: "all" %> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<%= javascript_include_tag "application" %> <%= stylesheet_link_tag "application", media: "all" %>
<%= csrf_meta_tags %> <%= javascript_include_tag "application" %>
</head> <%= csrf_meta_tags %>
<body> </head>

<body>
<%= yield %> <div class="container-fluid">

<div class="row-fluid">
</body> <%= yield %>
</div>
</div>
</body>
</html> </html>
2 changes: 1 addition & 1 deletion app/views/run_queries/_form.html.erb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<%= f.error_notification %> <%= f.error_notification %>


<div class="form-inputs"> <div class="form-inputs">
<%= f.input :sql %> <%= f.input :sql, :as => :text, :input_html => { :cols => 80, :rows => 10 } %>
</div> </div>


<div class="form-actions"> <div class="form-actions">
Expand Down
10 changes: 5 additions & 5 deletions app/views/run_queries/new.html.erb
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>New run_query</h1> <div class="span12">

<div class="well">
<%= render 'form' %> <%= render 'form' %>
</div>
<%= link_to 'Back', run_queries_path %> </div>
4 changes: 4 additions & 0 deletions config/locales/simple_form.en.yml
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,8 @@
en: en:
helpers:
submit:
run_query:
create: "Run Query"
simple_form: simple_form:
"yes": 'Yes' "yes": 'Yes'
"no": 'No' "no": 'No'
Expand Down

0 comments on commit f654d62

Please sign in to comment.