init
This commit is contained in:
0
app/assets/images/.keep
Normal file
0
app/assets/images/.keep
Normal file
16
app/assets/javascripts/application.js
Normal file
16
app/assets/javascripts/application.js
Normal file
@ -0,0 +1,16 @@
|
||||
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
||||
// listed below.
|
||||
//
|
||||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
||||
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
||||
//
|
||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||
// compiled file.
|
||||
//
|
||||
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
||||
// about supported directives.
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery_ujs
|
||||
//= require turbolinks
|
||||
//= require_tree .
|
15
app/assets/stylesheets/application.css
Normal file
15
app/assets/stylesheets/application.css
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
||||
* listed below.
|
||||
*
|
||||
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
||||
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
||||
*
|
||||
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
||||
* compiled file so the styles you add here take precedence over styles defined in any styles
|
||||
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
||||
* file per style scope.
|
||||
*
|
||||
*= require_tree .
|
||||
*= require_self
|
||||
*/
|
5
app/controllers/application_controller.rb
Normal file
5
app/controllers/application_controller.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
# Prevent CSRF attacks by raising an exception.
|
||||
# For APIs, you may want to use :null_session instead.
|
||||
protect_from_forgery with: :exception
|
||||
end
|
2
app/controllers/children_controller.rb
Normal file
2
app/controllers/children_controller.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class ChildrenController < ApplicationController
|
||||
end
|
10
app/controllers/docs_controller.rb
Normal file
10
app/controllers/docs_controller.rb
Normal file
@ -0,0 +1,10 @@
|
||||
class DocsController < ApplicationController
|
||||
def index
|
||||
doc = {
|
||||
name: "sms-pager-api",
|
||||
documentation: "https://bitbucket.org/markamoser/sms-pager-api"
|
||||
}.to_json
|
||||
|
||||
render json: doc
|
||||
end
|
||||
end
|
2
app/controllers/pages_controller.rb
Normal file
2
app/controllers/pages_controller.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class PagesController < ApplicationController
|
||||
end
|
6
app/controllers/parents_controller.rb
Normal file
6
app/controllers/parents_controller.rb
Normal file
@ -0,0 +1,6 @@
|
||||
class ParentsController < ApplicationController
|
||||
def index
|
||||
@parents = Person.just_parents
|
||||
respond_with @parents
|
||||
end
|
||||
end
|
2
app/controllers/staff_controller.rb
Normal file
2
app/controllers/staff_controller.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class StaffController < ApplicationController
|
||||
end
|
2
app/controllers/users_controller.rb
Normal file
2
app/controllers/users_controller.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class UsersController < ApplicationController
|
||||
end
|
2
app/helpers/application_helper.rb
Normal file
2
app/helpers/application_helper.rb
Normal file
@ -0,0 +1,2 @@
|
||||
module ApplicationHelper
|
||||
end
|
0
app/mailers/.keep
Normal file
0
app/mailers/.keep
Normal file
0
app/models/.keep
Normal file
0
app/models/.keep
Normal file
10
app/views/layouts/application.html.haml
Normal file
10
app/views/layouts/application.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
!!!
|
||||
%html
|
||||
%head
|
||||
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
|
||||
%title SmsPager
|
||||
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
||||
= javascript_include_tag 'application', 'data-turbolinks-track' => true
|
||||
= csrf_meta_tags
|
||||
%body
|
||||
= yield
|
21
app/workers/sms.rb
Normal file
21
app/workers/sms.rb
Normal file
@ -0,0 +1,21 @@
|
||||
class SmsSender
|
||||
attr_accessor :from
|
||||
attr_accessor :to
|
||||
attr_accessor :message
|
||||
|
||||
def initialize args_as_hash
|
||||
@from = args_as_hash["from"] ||= ENV["twilio_number"]
|
||||
@to = args_as_hash["to"]
|
||||
@message = args_as_hash["message"]
|
||||
end
|
||||
|
||||
def send!
|
||||
twilio.messages.create(from: @from, to: @to, body: @message)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def twilio
|
||||
Twilio::REST::Client.new ENV['twilio_sid'], ENV['twilio_token']
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user