wip
This commit is contained in:
66
app/assets/stylesheets/main.scss
Normal file
66
app/assets/stylesheets/main.scss
Normal file
@ -0,0 +1,66 @@
|
||||
// maybe this? => https://color.adobe.com/Theme-1-color-theme-6893131/edit/?copy=true
|
||||
$white: #F2E8DF;
|
||||
$light: #C7C9CD;
|
||||
$grey: #8E969D;
|
||||
$dark: #646267;
|
||||
|
||||
@mixin inline-ul {
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
padding: 15px;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
color: $dark;
|
||||
background-color: $white;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 15px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.nav {
|
||||
@include inline-ul;
|
||||
background-color: $dark;
|
||||
color: $light;
|
||||
margin: -15px -15px 15px;
|
||||
width: calc(100% + 30px);
|
||||
|
||||
li {
|
||||
&:hover {
|
||||
background-color: $grey;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $light;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sub-nav {
|
||||
@include inline-ul;
|
||||
margin: -19px -15px 0;
|
||||
a {
|
||||
color: $dark;
|
||||
&:hover {
|
||||
background-color: $light;
|
||||
}
|
||||
}
|
||||
}
|
@ -3,4 +3,6 @@ class ChildrenController < ApplicationController
|
||||
@children = Child.all.order(:last_name, :first_name)
|
||||
respond_with @children
|
||||
end
|
||||
|
||||
def lookup; end
|
||||
end
|
||||
|
@ -1,10 +1,9 @@
|
||||
class DocsController < ApplicationController
|
||||
def index
|
||||
doc = {
|
||||
@doc = {
|
||||
name: "sms-pager-api",
|
||||
documentation: "https://bitbucket.org/markamoser/sms-pager-api"
|
||||
}.to_json
|
||||
|
||||
render json: doc
|
||||
}
|
||||
respond_with @doc
|
||||
end
|
||||
end
|
||||
|
@ -1,2 +1,11 @@
|
||||
class PagesController < ApplicationController
|
||||
def index
|
||||
@pages = Page.last_ten
|
||||
respond_with @pages
|
||||
end
|
||||
|
||||
def page; end
|
||||
|
||||
def send_page
|
||||
end
|
||||
end
|
||||
|
@ -1,2 +1,7 @@
|
||||
module ApplicationHelper
|
||||
def page_link(person)
|
||||
return if person.phone.blank?
|
||||
|
||||
link_to 'page', page_person_path(person)
|
||||
end
|
||||
end
|
||||
|
6
app/models/page.rb
Normal file
6
app/models/page.rb
Normal file
@ -0,0 +1,6 @@
|
||||
class Page < ActiveRecord::Base
|
||||
belongs_to :user, class_name: Person
|
||||
belongs_to :person
|
||||
|
||||
scope :last_ten, -> { order(updated_at: :desc).limit(10) }
|
||||
end
|
3
app/views/children/_sub_nav.html.haml
Normal file
3
app/views/children/_sub_nav.html.haml
Normal file
@ -0,0 +1,3 @@
|
||||
%ul.sub-nav
|
||||
%li= link_to 'look up', lookup_child_path
|
||||
|
@ -5,4 +5,4 @@
|
||||
%li= child.name
|
||||
%ul
|
||||
- child.parents.each do |parent|
|
||||
%li #{parent.name}: #{number_to_phone parent.phone}
|
||||
%li #{parent.name} #{page_link(parent)}
|
1
app/views/children/lookup.html.haml
Normal file
1
app/views/children/lookup.html.haml
Normal file
@ -0,0 +1 @@
|
||||
build search form here
|
4
app/views/docs/index.html.haml
Normal file
4
app/views/docs/index.html.haml
Normal file
@ -0,0 +1,4 @@
|
||||
%h2 Something helpful later
|
||||
|
||||
%p= raw( ap @doc )
|
||||
|
18
app/views/layouts/_alerts.html.haml
Normal file
18
app/views/layouts/_alerts.html.haml
Normal file
@ -0,0 +1,18 @@
|
||||
- unless flash.empty?
|
||||
- if flash[:notice].present?
|
||||
.container{'data-id' => 'alertbox', 'data-alert' => 'auto-close'}
|
||||
.row
|
||||
.col-md-6.col-md-offset-3.col-xs-12
|
||||
.alertbox
|
||||
.alertbox.box_blue
|
||||
.box_close{'data-id'=> 'alert-close'}
|
||||
= flash[:notice]
|
||||
|
||||
- if flash[:alert].present?
|
||||
.container{'data-id' => 'alertbox'}
|
||||
.row
|
||||
.col-md-6.col-md-offset-3.col-xs-12
|
||||
.alertbox
|
||||
.alertbox.box_red
|
||||
.box_close{'data-id'=> 'alert-close'}
|
||||
%b= flash[:alert]
|
0
app/views/layouts/_footer.html.haml
Normal file
0
app/views/layouts/_footer.html.haml
Normal file
7
app/views/layouts/_navigation.html.haml
Normal file
7
app/views/layouts/_navigation.html.haml
Normal file
@ -0,0 +1,7 @@
|
||||
%ul.nav
|
||||
%li= link_to 'Home', root_path
|
||||
%li= link_to 'Parents', list_parents_path
|
||||
%li= link_to 'Children', list_children_path
|
||||
%li= link_to 'Staff', list_staff_path
|
||||
%li= link_to 'Users', list_users_path
|
||||
%li= link_to 'Pages', list_pages_path
|
@ -6,5 +6,12 @@
|
||||
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
||||
= javascript_include_tag 'application', 'data-turbolinks-track' => true
|
||||
= csrf_meta_tags
|
||||
= yield :custom_head
|
||||
%body
|
||||
= render partial: 'layouts/alerts'
|
||||
= render partial: 'layouts/navigation'
|
||||
= render partial: 'sub_nav' if lookup_context.find_all('sub_nav').any?
|
||||
= yield
|
||||
= render partial: 'layouts/footer'
|
||||
= yield :modals
|
||||
= yield :custom_scripts
|
||||
|
5
app/views/pages/index.html.haml
Normal file
5
app/views/pages/index.html.haml
Normal file
@ -0,0 +1,5 @@
|
||||
%h1 Pages
|
||||
|
||||
- @pages.each do |page|
|
||||
%ul
|
||||
%li= raw(ap page)
|
2
app/views/pages/page.html.haml
Normal file
2
app/views/pages/page.html.haml
Normal file
@ -0,0 +1,2 @@
|
||||
%p send page form
|
||||
%p active class on main navs
|
Reference in New Issue
Block a user