Refactor database with pg and foudation6( stage 1 )
This commit is contained in:
parent
a36c272e28
commit
859d6bbf22
|
@ -13,3 +13,4 @@
|
||||||
/config/mongoid.yml
|
/config/mongoid.yml
|
||||||
/public/assets/*
|
/public/assets/*
|
||||||
*.old
|
*.old
|
||||||
|
*.bak
|
||||||
|
|
4
Gemfile
4
Gemfile
|
@ -14,13 +14,13 @@ gem 'font-awesome-sass'
|
||||||
gem 'angularjs-rails'
|
gem 'angularjs-rails'
|
||||||
|
|
||||||
gem 'jbuilder'
|
gem 'jbuilder'
|
||||||
|
gem 'pg'
|
||||||
|
|
||||||
gem 'redcarpet'
|
gem 'redcarpet'
|
||||||
gem 'rouge'
|
gem 'rouge'
|
||||||
gem 'slim-rails'
|
gem 'slim-rails'
|
||||||
gem 'simple_form'
|
gem 'simple_form'
|
||||||
gem 'mini_magick'
|
gem 'mini_magick'
|
||||||
gem 'carrierwave-mongoid'
|
|
||||||
gem 'html_truncator'
|
gem 'html_truncator'
|
||||||
gem 'nokogiri'
|
gem 'nokogiri'
|
||||||
gem 'figaro'
|
gem 'figaro'
|
||||||
|
@ -62,5 +62,5 @@ group :test, :development do
|
||||||
gem "rspec-rails", ">= 2.8.1"
|
gem "rspec-rails", ">= 2.8.1"
|
||||||
gem 'pry-rails'
|
gem 'pry-rails'
|
||||||
gem 'pry-nav'
|
gem 'pry-nav'
|
||||||
gem 'factory_girl_rails'
|
#gem 'factory_girl_rails'
|
||||||
end
|
end
|
||||||
|
|
27
Gemfile.lock
27
Gemfile.lock
|
@ -45,7 +45,6 @@ GEM
|
||||||
babel-transpiler (0.7.0)
|
babel-transpiler (0.7.0)
|
||||||
babel-source (>= 4.0, < 6)
|
babel-source (>= 4.0, < 6)
|
||||||
execjs (~> 2.0)
|
execjs (~> 2.0)
|
||||||
bson (4.1.0)
|
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
capybara (2.7.0)
|
capybara (2.7.0)
|
||||||
addressable
|
addressable
|
||||||
|
@ -54,14 +53,6 @@ GEM
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
xpath (~> 2.0)
|
xpath (~> 2.0)
|
||||||
carrierwave (0.11.0)
|
|
||||||
activemodel (>= 3.2.0)
|
|
||||||
activesupport (>= 3.2.0)
|
|
||||||
json (>= 1.7)
|
|
||||||
mime-types (>= 1.16)
|
|
||||||
carrierwave-mongoid (0.1.0)
|
|
||||||
carrierwave
|
|
||||||
mongoid
|
|
||||||
chunky_png (1.3.5)
|
chunky_png (1.3.5)
|
||||||
codeclimate-test-reporter (0.5.0)
|
codeclimate-test-reporter (0.5.0)
|
||||||
simplecov (>= 0.7.1, < 1.0.0)
|
simplecov (>= 0.7.1, < 1.0.0)
|
||||||
|
@ -80,14 +71,8 @@ GEM
|
||||||
docile (1.1.5)
|
docile (1.1.5)
|
||||||
domain_name (0.5.20160310)
|
domain_name (0.5.20160310)
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
durran-validatable (2.0.1)
|
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
execjs (2.6.0)
|
execjs (2.6.0)
|
||||||
factory_girl (4.7.0)
|
|
||||||
activesupport (>= 3.0.0)
|
|
||||||
factory_girl_rails (4.7.0)
|
|
||||||
factory_girl (~> 4.7.0)
|
|
||||||
railties (>= 3.0.0)
|
|
||||||
ffi (1.9.10)
|
ffi (1.9.10)
|
||||||
figaro (1.1.1)
|
figaro (1.1.1)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
|
@ -138,7 +123,6 @@ GEM
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.8.3)
|
json (1.8.3)
|
||||||
kgio (2.10.0)
|
kgio (2.10.0)
|
||||||
leshill-will_paginate (2.3.11)
|
|
||||||
listen (3.0.6)
|
listen (3.0.6)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9.7)
|
rb-inotify (>= 0.9.7)
|
||||||
|
@ -160,13 +144,6 @@ GEM
|
||||||
mini_magick (4.5.1)
|
mini_magick (4.5.1)
|
||||||
mini_portile2 (2.0.0)
|
mini_portile2 (2.0.0)
|
||||||
minitest (5.8.4)
|
minitest (5.8.4)
|
||||||
mongo (2.2.4)
|
|
||||||
bson (~> 4.0)
|
|
||||||
mongoid (1.0.6)
|
|
||||||
activesupport (>= 2.2.2)
|
|
||||||
durran-validatable (>= 2.0.1)
|
|
||||||
leshill-will_paginate (>= 2.3.11)
|
|
||||||
mongo (>= 0.18.2)
|
|
||||||
multi_json (1.11.2)
|
multi_json (1.11.2)
|
||||||
nenv (0.3.0)
|
nenv (0.3.0)
|
||||||
netrc (0.11.0)
|
netrc (0.11.0)
|
||||||
|
@ -178,6 +155,7 @@ GEM
|
||||||
nenv (~> 0.1)
|
nenv (~> 0.1)
|
||||||
shellany (~> 0.0)
|
shellany (~> 0.0)
|
||||||
open4 (1.3.4)
|
open4 (1.3.4)
|
||||||
|
pg (0.18.4)
|
||||||
pry (0.10.3)
|
pry (0.10.3)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
|
@ -329,12 +307,10 @@ PLATFORMS
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
angularjs-rails
|
angularjs-rails
|
||||||
capybara
|
capybara
|
||||||
carrierwave-mongoid
|
|
||||||
chunky_png
|
chunky_png
|
||||||
codeclimate-test-reporter
|
codeclimate-test-reporter
|
||||||
coffee-rails (~> 4.1.0)
|
coffee-rails (~> 4.1.0)
|
||||||
database_cleaner
|
database_cleaner
|
||||||
factory_girl_rails
|
|
||||||
figaro
|
figaro
|
||||||
font-awesome-sass
|
font-awesome-sass
|
||||||
foundation-icons-sass-rails
|
foundation-icons-sass-rails
|
||||||
|
@ -354,6 +330,7 @@ DEPENDENCIES
|
||||||
mini_magick
|
mini_magick
|
||||||
newrelic_rpm
|
newrelic_rpm
|
||||||
nokogiri
|
nokogiri
|
||||||
|
pg
|
||||||
pry-nav
|
pry-nav
|
||||||
pry-rails
|
pry-rails
|
||||||
quiet_assets
|
quiet_assets
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
//= require jquery
|
//= require jquery
|
||||||
//= require jquery_ujs
|
//= require jquery_ujs
|
||||||
//= require foundation/foundation
|
//= require foundation
|
||||||
//= require foundation/foundation.alert
|
|
||||||
//= require foundation/foundation.topbar
|
|
||||||
//= require foundation/foundation.offcanvas
|
|
||||||
//= require foundation/foundation.magellan
|
|
||||||
//= require angularjs
|
//= require angularjs
|
||||||
//= require 'jquery.html5-fileupload'
|
//= require 'jquery.html5-fileupload'
|
||||||
//= require_tree .
|
//= require_tree .
|
||||||
|
|
|
@ -0,0 +1,567 @@
|
||||||
|
// Foundation for Sites Settings
|
||||||
|
// -----------------------------
|
||||||
|
//
|
||||||
|
// Table of Contents:
|
||||||
|
//
|
||||||
|
// 1. Global
|
||||||
|
// 2. Breakpoints
|
||||||
|
// 3. The Grid
|
||||||
|
// 4. Base Typography
|
||||||
|
// 5. Typography Helpers
|
||||||
|
// 6. Abide
|
||||||
|
// 7. Accordion
|
||||||
|
// 8. Accordion Menu
|
||||||
|
// 9. Badge
|
||||||
|
// 10. Breadcrumbs
|
||||||
|
// 11. Button
|
||||||
|
// 12. Button Group
|
||||||
|
// 13. Callout
|
||||||
|
// 14. Close Button
|
||||||
|
// 15. Drilldown
|
||||||
|
// 16. Dropdown
|
||||||
|
// 17. Dropdown Menu
|
||||||
|
// 18. Flex Video
|
||||||
|
// 19. Forms
|
||||||
|
// 20. Label
|
||||||
|
// 21. Media Object
|
||||||
|
// 22. Menu
|
||||||
|
// 23. Meter
|
||||||
|
// 24. Off-canvas
|
||||||
|
// 25. Orbit
|
||||||
|
// 26. Pagination
|
||||||
|
// 27. Progress Bar
|
||||||
|
// 28. Reveal
|
||||||
|
// 29. Slider
|
||||||
|
// 30. Switch
|
||||||
|
// 31. Table
|
||||||
|
// 32. Tabs
|
||||||
|
// 33. Thumbnail
|
||||||
|
// 34. Title Bar
|
||||||
|
// 35. Tooltip
|
||||||
|
// 36. Top Bar
|
||||||
|
|
||||||
|
@import 'util/util';
|
||||||
|
|
||||||
|
// 1. Global
|
||||||
|
// ---------
|
||||||
|
|
||||||
|
$global-font-size: 100%;
|
||||||
|
$global-width: rem-calc(1200);
|
||||||
|
$global-lineheight: 1.5;
|
||||||
|
$foundation-palette: (
|
||||||
|
primary: #2199e8,
|
||||||
|
secondary: #777,
|
||||||
|
success: #3adb76,
|
||||||
|
warning: #ffae00,
|
||||||
|
alert: #ec5840,
|
||||||
|
);
|
||||||
|
$light-gray: #e6e6e6;
|
||||||
|
$medium-gray: #cacaca;
|
||||||
|
$dark-gray: #8a8a8a;
|
||||||
|
$black: #0a0a0a;
|
||||||
|
$white: #fefefe;
|
||||||
|
$body-background: $white;
|
||||||
|
$body-font-color: $black;
|
||||||
|
$body-font-family: 'Helvetica Neue', 'Microsoft Yahei', Helvetica, Roboto, 'WenQuanYi Micro Hei', Arial, sans-serif;
|
||||||
|
$body-antialiased: true;
|
||||||
|
$global-margin: 1rem;
|
||||||
|
$global-padding: 1rem;
|
||||||
|
$global-weight-normal: normal;
|
||||||
|
$global-weight-bold: bold;
|
||||||
|
$global-radius: 0;
|
||||||
|
$global-text-direction: ltr;
|
||||||
|
$global-flexbox: false;
|
||||||
|
$print-transparent-backgrounds: true;
|
||||||
|
|
||||||
|
@include add-foundation-colors;
|
||||||
|
|
||||||
|
// 2. Breakpoints
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
$breakpoints: (
|
||||||
|
small: 0,
|
||||||
|
medium: 640px,
|
||||||
|
large: 1024px,
|
||||||
|
xlarge: 1200px,
|
||||||
|
xxlarge: 1440px,
|
||||||
|
);
|
||||||
|
$breakpoint-classes: (small medium large);
|
||||||
|
|
||||||
|
// 3. The Grid
|
||||||
|
// -----------
|
||||||
|
|
||||||
|
$grid-row-width: $global-width;
|
||||||
|
$grid-column-count: 12;
|
||||||
|
$grid-column-gutter: (
|
||||||
|
small: 20px,
|
||||||
|
medium: 30px,
|
||||||
|
);
|
||||||
|
$grid-column-align-edge: true;
|
||||||
|
$block-grid-max: 8;
|
||||||
|
|
||||||
|
// 4. Base Typography
|
||||||
|
// ------------------
|
||||||
|
|
||||||
|
$header-font-family: $body-font-family;
|
||||||
|
$header-font-weight: $global-weight-normal;
|
||||||
|
$header-font-style: normal;
|
||||||
|
$font-family-monospace: Consolas, 'Liberation Mono', Courier, monospace;
|
||||||
|
$header-sizes: (
|
||||||
|
small: (
|
||||||
|
'h1': 24,
|
||||||
|
'h2': 20,
|
||||||
|
'h3': 19,
|
||||||
|
'h4': 18,
|
||||||
|
'h5': 17,
|
||||||
|
'h6': 16,
|
||||||
|
),
|
||||||
|
medium: (
|
||||||
|
'h1': 48,
|
||||||
|
'h2': 40,
|
||||||
|
'h3': 31,
|
||||||
|
'h4': 25,
|
||||||
|
'h5': 20,
|
||||||
|
'h6': 16,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
$header-color: inherit;
|
||||||
|
$header-lineheight: 1.4;
|
||||||
|
$header-margin-bottom: 0.5rem;
|
||||||
|
$header-text-rendering: optimizeLegibility;
|
||||||
|
$small-font-size: 80%;
|
||||||
|
$header-small-font-color: $medium-gray;
|
||||||
|
$paragraph-lineheight: 1.6;
|
||||||
|
$paragraph-margin-bottom: 1rem;
|
||||||
|
$paragraph-text-rendering: optimizeLegibility;
|
||||||
|
$code-color: $black;
|
||||||
|
$code-font-family: $font-family-monospace;
|
||||||
|
$code-font-weight: $global-weight-normal;
|
||||||
|
$code-background: $light-gray;
|
||||||
|
$code-border: 1px solid $medium-gray;
|
||||||
|
$code-padding: rem-calc(2 5 1);
|
||||||
|
$anchor-color: $primary-color;
|
||||||
|
$anchor-color-hover: scale-color($anchor-color, $lightness: -14%);
|
||||||
|
$anchor-text-decoration: none;
|
||||||
|
$anchor-text-decoration-hover: none;
|
||||||
|
$hr-width: $global-width;
|
||||||
|
$hr-border: 1px solid $medium-gray;
|
||||||
|
$hr-margin: rem-calc(20) auto;
|
||||||
|
$list-lineheight: $paragraph-lineheight;
|
||||||
|
$list-margin-bottom: $paragraph-margin-bottom;
|
||||||
|
$list-style-type: disc;
|
||||||
|
$list-style-position: outside;
|
||||||
|
$list-side-margin: 1.25rem;
|
||||||
|
$list-nested-side-margin: 1.25rem;
|
||||||
|
$defnlist-margin-bottom: 1rem;
|
||||||
|
$defnlist-term-weight: $global-weight-bold;
|
||||||
|
$defnlist-term-margin-bottom: 0.3rem;
|
||||||
|
$blockquote-color: $dark-gray;
|
||||||
|
$blockquote-padding: rem-calc(9 20 0 19);
|
||||||
|
$blockquote-border: 1px solid $medium-gray;
|
||||||
|
$cite-font-size: rem-calc(13);
|
||||||
|
$cite-color: $dark-gray;
|
||||||
|
$keystroke-font: $font-family-monospace;
|
||||||
|
$keystroke-color: $black;
|
||||||
|
$keystroke-background: $light-gray;
|
||||||
|
$keystroke-padding: rem-calc(2 4 0);
|
||||||
|
$keystroke-radius: $global-radius;
|
||||||
|
$abbr-underline: 1px dotted $black;
|
||||||
|
|
||||||
|
// 5. Typography Helpers
|
||||||
|
// ---------------------
|
||||||
|
|
||||||
|
$lead-font-size: $global-font-size * 1.25;
|
||||||
|
$lead-lineheight: 1.6;
|
||||||
|
$subheader-lineheight: 1.4;
|
||||||
|
$subheader-color: $dark-gray;
|
||||||
|
$subheader-font-weight: $global-weight-normal;
|
||||||
|
$subheader-margin-top: 0.2rem;
|
||||||
|
$subheader-margin-bottom: 0.5rem;
|
||||||
|
$stat-font-size: 2.5rem;
|
||||||
|
|
||||||
|
// 6. Abide
|
||||||
|
// --------
|
||||||
|
|
||||||
|
$abide-inputs: true;
|
||||||
|
$abide-labels: true;
|
||||||
|
$input-background-invalid: map-get($foundation-palette, alert);
|
||||||
|
$form-label-color-invalid: map-get($foundation-palette, alert);
|
||||||
|
$input-error-color: map-get($foundation-palette, alert);
|
||||||
|
$input-error-font-size: rem-calc(12);
|
||||||
|
$input-error-font-weight: $global-weight-bold;
|
||||||
|
|
||||||
|
// 7. Accordion
|
||||||
|
// ------------
|
||||||
|
|
||||||
|
$accordion-background: $white;
|
||||||
|
$accordion-plusminus: true;
|
||||||
|
$accordion-item-color: foreground($accordion-background, $primary-color);
|
||||||
|
$accordion-item-background-hover: $light-gray;
|
||||||
|
$accordion-item-padding: 1.25rem 1rem;
|
||||||
|
$accordion-content-background: $white;
|
||||||
|
$accordion-content-border: 1px solid $light-gray;
|
||||||
|
$accordion-content-color: foreground($accordion-background, $primary-color);
|
||||||
|
$accordion-content-padding: 1rem;
|
||||||
|
|
||||||
|
// 8. Accordion Menu
|
||||||
|
// -----------------
|
||||||
|
|
||||||
|
$accordionmenu-arrows: true;
|
||||||
|
$accordionmenu-arrow-color: $primary-color;
|
||||||
|
|
||||||
|
// 9. Badge
|
||||||
|
// --------
|
||||||
|
|
||||||
|
$badge-background: $primary-color;
|
||||||
|
$badge-color: foreground($badge-background);
|
||||||
|
$badge-padding: 0.3em;
|
||||||
|
$badge-minwidth: 2.1em;
|
||||||
|
$badge-font-size: 0.6rem;
|
||||||
|
|
||||||
|
// 10. Breadcrumbs
|
||||||
|
// ---------------
|
||||||
|
|
||||||
|
$breadcrumbs-margin: 0 0 $global-margin 0;
|
||||||
|
$breadcrumbs-item-font-size: rem-calc(11);
|
||||||
|
$breadcrumbs-item-color: $primary-color;
|
||||||
|
$breadcrumbs-item-color-current: $black;
|
||||||
|
$breadcrumbs-item-color-disabled: $medium-gray;
|
||||||
|
$breadcrumbs-item-margin: 0.75rem;
|
||||||
|
$breadcrumbs-item-uppercase: true;
|
||||||
|
$breadcrumbs-item-slash: true;
|
||||||
|
|
||||||
|
// 11. Button
|
||||||
|
// ----------
|
||||||
|
|
||||||
|
$button-padding: 0.85em 1em;
|
||||||
|
$button-margin: 0 0 $global-margin 0;
|
||||||
|
$button-fill: solid;
|
||||||
|
$button-background: $primary-color;
|
||||||
|
$button-background-hover: scale-color($button-background, $lightness: -15%);
|
||||||
|
$button-color: $white;
|
||||||
|
$button-color-alt: $black;
|
||||||
|
$button-radius: $global-radius;
|
||||||
|
$button-sizes: (
|
||||||
|
tiny: 0.6rem,
|
||||||
|
small: 0.75rem,
|
||||||
|
default: 0.9rem,
|
||||||
|
large: 1.25rem,
|
||||||
|
);
|
||||||
|
$button-opacity-disabled: 0.25;
|
||||||
|
|
||||||
|
// 12. Button Group
|
||||||
|
// ----------------
|
||||||
|
|
||||||
|
$buttongroup-margin: 1rem;
|
||||||
|
$buttongroup-spacing: 1px;
|
||||||
|
$buttongroup-child-selector: '.button';
|
||||||
|
$buttongroup-expand-max: 6;
|
||||||
|
|
||||||
|
// 13. Callout
|
||||||
|
// -----------
|
||||||
|
|
||||||
|
$callout-background: $white;
|
||||||
|
$callout-background-fade: 85%;
|
||||||
|
$callout-border: 1px solid rgba($black, 0.25);
|
||||||
|
$callout-margin: 0 0 1rem 0;
|
||||||
|
$callout-padding: 1rem;
|
||||||
|
$callout-font-color: $body-font-color;
|
||||||
|
$callout-font-color-alt: $body-background;
|
||||||
|
$callout-radius: $global-radius;
|
||||||
|
$callout-link-tint: 30%;
|
||||||
|
|
||||||
|
// 14. Close Button
|
||||||
|
// ----------------
|
||||||
|
|
||||||
|
$closebutton-position: right top;
|
||||||
|
$closebutton-offset-horizontal: 1rem;
|
||||||
|
$closebutton-offset-vertical: 0.5rem;
|
||||||
|
$closebutton-size: 2em;
|
||||||
|
$closebutton-lineheight: 1;
|
||||||
|
$closebutton-color: $dark-gray;
|
||||||
|
$closebutton-color-hover: $black;
|
||||||
|
|
||||||
|
// 15. Drilldown
|
||||||
|
// -------------
|
||||||
|
|
||||||
|
$drilldown-transition: transform 0.15s linear;
|
||||||
|
$drilldown-arrows: true;
|
||||||
|
$drilldown-arrow-color: $primary-color;
|
||||||
|
$drilldown-background: $white;
|
||||||
|
|
||||||
|
// 16. Dropdown
|
||||||
|
// ------------
|
||||||
|
|
||||||
|
$dropdown-padding: 1rem;
|
||||||
|
$dropdown-border: 1px solid $medium-gray;
|
||||||
|
$dropdown-font-size: 1rem;
|
||||||
|
$dropdown-width: 300px;
|
||||||
|
$dropdown-radius: $global-radius;
|
||||||
|
$dropdown-sizes: (
|
||||||
|
tiny: 100px,
|
||||||
|
small: 200px,
|
||||||
|
large: 400px,
|
||||||
|
);
|
||||||
|
|
||||||
|
// 17. Dropdown Menu
|
||||||
|
// -----------------
|
||||||
|
|
||||||
|
$dropdownmenu-arrows: true;
|
||||||
|
$dropdownmenu-arrow-color: $anchor-color;
|
||||||
|
$dropdownmenu-min-width: 200px;
|
||||||
|
$dropdownmenu-background: $white;
|
||||||
|
$dropdownmenu-border: 1px solid $medium-gray;
|
||||||
|
|
||||||
|
// 18. Flex Video
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
$flexvideo-margin-bottom: rem-calc(16);
|
||||||
|
$flexvideo-ratio: 4 by 3;
|
||||||
|
$flexvideo-ratio-widescreen: 16 by 9;
|
||||||
|
|
||||||
|
// 19. Forms
|
||||||
|
// ---------
|
||||||
|
|
||||||
|
$fieldset-border: 1px solid $medium-gray;
|
||||||
|
$fieldset-padding: rem-calc(20);
|
||||||
|
$fieldset-margin: rem-calc(18 0);
|
||||||
|
$legend-padding: rem-calc(0 3);
|
||||||
|
$form-spacing: rem-calc(16);
|
||||||
|
$helptext-color: $black;
|
||||||
|
$helptext-font-size: rem-calc(13);
|
||||||
|
$helptext-font-style: italic;
|
||||||
|
$input-prefix-color: $black;
|
||||||
|
$input-prefix-background: $light-gray;
|
||||||
|
$input-prefix-border: 1px solid $medium-gray;
|
||||||
|
$input-prefix-padding: 1rem;
|
||||||
|
$form-label-color: $black;
|
||||||
|
$form-label-font-size: rem-calc(14);
|
||||||
|
$form-label-font-weight: $global-weight-normal;
|
||||||
|
$form-label-line-height: 1.8;
|
||||||
|
$select-background: $white;
|
||||||
|
$select-triangle-color: $dark-gray;
|
||||||
|
$select-radius: $global-radius;
|
||||||
|
$input-color: $black;
|
||||||
|
$input-placeholder-color: $medium-gray;
|
||||||
|
$input-font-family: inherit;
|
||||||
|
$input-font-size: rem-calc(16);
|
||||||
|
$input-background: $white;
|
||||||
|
$input-background-focus: $white;
|
||||||
|
$input-background-disabled: $light-gray;
|
||||||
|
$input-border: 1px solid $medium-gray;
|
||||||
|
$input-border-focus: 1px solid $dark-gray;
|
||||||
|
$input-shadow: inset 0 1px 2px rgba($black, 0.1);
|
||||||
|
$input-shadow-focus: 0 0 5px $medium-gray;
|
||||||
|
$input-cursor-disabled: not-allowed;
|
||||||
|
$input-transition: box-shadow 0.5s, border-color 0.25s ease-in-out;
|
||||||
|
$input-number-spinners: true;
|
||||||
|
$input-radius: $global-radius;
|
||||||
|
|
||||||
|
// 20. Label
|
||||||
|
// ---------
|
||||||
|
|
||||||
|
$label-background: $primary-color;
|
||||||
|
$label-color: foreground($label-background);
|
||||||
|
$label-font-size: 0.8rem;
|
||||||
|
$label-padding: 0.33333rem 0.5rem;
|
||||||
|
$label-radius: $global-radius;
|
||||||
|
|
||||||
|
// 21. Media Object
|
||||||
|
// ----------------
|
||||||
|
|
||||||
|
$mediaobject-margin-bottom: $global-margin;
|
||||||
|
$mediaobject-section-padding: $global-padding;
|
||||||
|
$mediaobject-image-width-stacked: 100%;
|
||||||
|
|
||||||
|
// 22. Menu
|
||||||
|
// --------
|
||||||
|
|
||||||
|
$menu-margin: 0;
|
||||||
|
$menu-margin-nested: 1rem;
|
||||||
|
$menu-item-padding: 0.7rem 1rem;
|
||||||
|
$menu-item-color-active: $white;
|
||||||
|
$menu-item-background-active: map-get($foundation-palette, primary);
|
||||||
|
$menu-icon-spacing: 0.25rem;
|
||||||
|
|
||||||
|
// 23. Meter
|
||||||
|
// ---------
|
||||||
|
|
||||||
|
$meter-height: 1rem;
|
||||||
|
$meter-radius: $global-radius;
|
||||||
|
$meter-background: $medium-gray;
|
||||||
|
$meter-fill-good: $success-color;
|
||||||
|
$meter-fill-medium: $warning-color;
|
||||||
|
$meter-fill-bad: $alert-color;
|
||||||
|
|
||||||
|
// 24. Off-canvas
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
$offcanvas-size: 250px;
|
||||||
|
$offcanvas-background: #474747;
|
||||||
|
$offcanvas-zindex: -1;
|
||||||
|
$offcanvas-transition-length: 0.5s;
|
||||||
|
$offcanvas-transition-timing: ease;
|
||||||
|
$offcanvas-fixed-reveal: true;
|
||||||
|
$offcanvas-exit-background: rgba($white, 0.25);
|
||||||
|
$maincontent-class: 'off-canvas-content';
|
||||||
|
$maincontent-shadow: 0 0 10px rgba($black, 0.5);
|
||||||
|
|
||||||
|
// 25. Orbit
|
||||||
|
// ---------
|
||||||
|
|
||||||
|
$orbit-bullet-background: $medium-gray;
|
||||||
|
$orbit-bullet-background-active: $dark-gray;
|
||||||
|
$orbit-bullet-diameter: 1.2rem;
|
||||||
|
$orbit-bullet-margin: 0.1rem;
|
||||||
|
$orbit-bullet-margin-top: 0.8rem;
|
||||||
|
$orbit-bullet-margin-bottom: 0.8rem;
|
||||||
|
$orbit-caption-background: rgba($black, 0.5);
|
||||||
|
$orbit-caption-padding: 1rem;
|
||||||
|
$orbit-control-background-hover: rgba($black, 0.5);
|
||||||
|
$orbit-control-padding: 1rem;
|
||||||
|
$orbit-control-zindex: 10;
|
||||||
|
|
||||||
|
// 26. Pagination
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
$pagination-font-size: rem-calc(14);
|
||||||
|
$pagination-margin-bottom: $global-margin;
|
||||||
|
$pagination-item-color: $black;
|
||||||
|
$pagination-item-padding: rem-calc(3 10);
|
||||||
|
$pagination-item-spacing: rem-calc(1);
|
||||||
|
$pagination-radius: $global-radius;
|
||||||
|
$pagination-item-background-hover: $light-gray;
|
||||||
|
$pagination-item-background-current: $primary-color;
|
||||||
|
$pagination-item-color-current: foreground($pagination-item-background-current);
|
||||||
|
$pagination-item-color-disabled: $medium-gray;
|
||||||
|
$pagination-ellipsis-color: $black;
|
||||||
|
$pagination-mobile-items: false;
|
||||||
|
$pagination-arrows: true;
|
||||||
|
|
||||||
|
// 27. Progress Bar
|
||||||
|
// ----------------
|
||||||
|
|
||||||
|
$progress-height: 1rem;
|
||||||
|
$progress-background: $medium-gray;
|
||||||
|
$progress-margin-bottom: $global-margin;
|
||||||
|
$progress-meter-background: $primary-color;
|
||||||
|
$progress-radius: $global-radius;
|
||||||
|
|
||||||
|
// 28. Reveal
|
||||||
|
// ----------
|
||||||
|
|
||||||
|
$reveal-background: $white;
|
||||||
|
$reveal-width: 600px;
|
||||||
|
$reveal-max-width: $global-width;
|
||||||
|
$reveal-padding: $global-padding;
|
||||||
|
$reveal-border: 1px solid $medium-gray;
|
||||||
|
$reveal-radius: $global-radius;
|
||||||
|
$reveal-zindex: 1005;
|
||||||
|
$reveal-overlay-background: rgba($black, 0.45);
|
||||||
|
|
||||||
|
// 29. Slider
|
||||||
|
// ----------
|
||||||
|
|
||||||
|
$slider-width-vertical: 0.5rem;
|
||||||
|
$slider-transition: all 0.2s ease-in-out;
|
||||||
|
$slider-height: 0.5rem;
|
||||||
|
$slider-background: $light-gray;
|
||||||
|
$slider-fill-background: $medium-gray;
|
||||||
|
$slider-handle-height: 1.4rem;
|
||||||
|
$slider-handle-width: 1.4rem;
|
||||||
|
$slider-handle-background: $primary-color;
|
||||||
|
$slider-opacity-disabled: 0.25;
|
||||||
|
$slider-radius: $global-radius;
|
||||||
|
|
||||||
|
// 30. Switch
|
||||||
|
// ----------
|
||||||
|
|
||||||
|
$switch-background: $medium-gray;
|
||||||
|
$switch-background-active: $primary-color;
|
||||||
|
$switch-height: 2rem;
|
||||||
|
$switch-height-tiny: 1.5rem;
|
||||||
|
$switch-height-small: 1.75rem;
|
||||||
|
$switch-height-large: 2.5rem;
|
||||||
|
$switch-radius: $global-radius;
|
||||||
|
$switch-margin: $global-margin;
|
||||||
|
$switch-paddle-background: $white;
|
||||||
|
$switch-paddle-offset: 0.25rem;
|
||||||
|
$switch-paddle-radius: $global-radius;
|
||||||
|
$switch-paddle-transition: all 0.25s ease-out;
|
||||||
|
|
||||||
|
// 31. Table
|
||||||
|
// ---------
|
||||||
|
|
||||||
|
$table-background: $white;
|
||||||
|
$table-color-scale: 5%;
|
||||||
|
$table-border: 1px solid smart-scale($table-background, $table-color-scale);
|
||||||
|
$table-padding: rem-calc(8 10 10);
|
||||||
|
$table-hover-scale: 2%;
|
||||||
|
$table-row-hover: darken($table-background, $table-hover-scale);
|
||||||
|
$table-row-stripe-hover: darken($table-background, $table-color-scale + $table-hover-scale);
|
||||||
|
$table-striped-background: smart-scale($table-background, $table-color-scale);
|
||||||
|
$table-stripe: even;
|
||||||
|
$table-head-background: smart-scale($table-background, $table-color-scale / 2);
|
||||||
|
$table-foot-background: smart-scale($table-background, $table-color-scale);
|
||||||
|
$table-head-font-color: $body-font-color;
|
||||||
|
$show-header-for-stacked: false;
|
||||||
|
|
||||||
|
// 32. Tabs
|
||||||
|
// --------
|
||||||
|
|
||||||
|
$tab-margin: 0;
|
||||||
|
$tab-background: $white;
|
||||||
|
$tab-background-active: $light-gray;
|
||||||
|
$tab-item-font-size: rem-calc(12);
|
||||||
|
$tab-item-background-hover: $white;
|
||||||
|
$tab-item-padding: 1.25rem 1.5rem;
|
||||||
|
$tab-expand-max: 6;
|
||||||
|
$tab-content-background: $white;
|
||||||
|
$tab-content-border: $light-gray;
|
||||||
|
$tab-content-color: foreground($tab-background, $primary-color);
|
||||||
|
$tab-content-padding: 1rem;
|
||||||
|
|
||||||
|
// 33. Thumbnail
|
||||||
|
// -------------
|
||||||
|
|
||||||
|
$thumbnail-border: solid 4px $white;
|
||||||
|
$thumbnail-margin-bottom: $global-margin;
|
||||||
|
$thumbnail-shadow: 0 0 0 1px rgba($black, 0.2);
|
||||||
|
$thumbnail-shadow-hover: 0 0 6px 1px rgba($primary-color, 0.5);
|
||||||
|
$thumbnail-transition: box-shadow 200ms ease-out;
|
||||||
|
$thumbnail-radius: $global-radius;
|
||||||
|
|
||||||
|
// 34. Title Bar
|
||||||
|
// -------------
|
||||||
|
|
||||||
|
$titlebar-background: $black;
|
||||||
|
$titlebar-color: $white;
|
||||||
|
$titlebar-padding: 0.5rem;
|
||||||
|
$titlebar-text-font-weight: bold;
|
||||||
|
$titlebar-icon-color: $white;
|
||||||
|
$titlebar-icon-color-hover: $medium-gray;
|
||||||
|
$titlebar-icon-spacing: 0.25rem;
|
||||||
|
|
||||||
|
// 35. Tooltip
|
||||||
|
// -----------
|
||||||
|
|
||||||
|
$has-tip-font-weight: $global-weight-bold;
|
||||||
|
$has-tip-border-bottom: dotted 1px $dark-gray;
|
||||||
|
$tooltip-background-color: $black;
|
||||||
|
$tooltip-color: $white;
|
||||||
|
$tooltip-padding: 0.75rem;
|
||||||
|
$tooltip-font-size: $small-font-size;
|
||||||
|
$tooltip-pip-width: 0.75rem;
|
||||||
|
$tooltip-pip-height: $tooltip-pip-width * 0.866;
|
||||||
|
$tooltip-radius: $global-radius;
|
||||||
|
|
||||||
|
// 36. Top Bar
|
||||||
|
// -----------
|
||||||
|
|
||||||
|
$topbar-padding: 0.5rem;
|
||||||
|
$topbar-background: $black;
|
||||||
|
$topbar-submenu-background: $topbar-background;
|
||||||
|
$topbar-title-spacing: 1rem;
|
||||||
|
$topbar-input-width: 200px;
|
||||||
|
$topbar-unstack-breakpoint: medium;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
//.inner-wrap {
|
@import 'font-awesome-sprockets';
|
||||||
//min-height: 100%;
|
@import 'font-awesome';
|
||||||
//}
|
|
||||||
|
|
||||||
@import 'foundation_and_overrides';
|
@import 'foundation_and_overrides';
|
||||||
|
|
||||||
@import 'aboutme_welcome';
|
@import 'aboutme_welcome';
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +1,35 @@
|
||||||
.middle-text {
|
.my-topbar {
|
||||||
text-align: center;
|
|
||||||
z-index: 999;
|
|
||||||
a {
|
a {
|
||||||
color: #F7F7F7;
|
color: #F7F7F7;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.title {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#offCanvas {
|
||||||
|
min-height: 100%;
|
||||||
|
a {
|
||||||
|
color: #F7F7F7;
|
||||||
|
&:hover {
|
||||||
|
background-color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
padding: 3px 20px;
|
||||||
|
background-color: #545454;
|
||||||
|
color: #B9B9B9;
|
||||||
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,3 +43,4 @@
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
class BlogsController < ApplicationController
|
class BlogsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@newest = Post.desc(:created_at).first
|
@newest = Post.order(created_at: :desc).first
|
||||||
@recent = Post.desc(:created_at).to_a[1..3]
|
@recent = Post.order(created_at: :desc).to_a[1..3]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.json
|
format.json
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
class ApplicationRecord < ActiveRecord::Base
|
||||||
|
self.abstract_class = true
|
||||||
|
end
|
|
@ -1,17 +1,10 @@
|
||||||
class Comment
|
class Comment < ApplicationRecord
|
||||||
include Mongoid::Document
|
|
||||||
include Mongoid::Timestamps
|
|
||||||
|
|
||||||
field :name, :type => String
|
|
||||||
field :content, :type => String
|
|
||||||
field :email, :type=>String
|
|
||||||
|
|
||||||
belongs_to :post
|
belongs_to :post
|
||||||
|
validates_presence_of :post_id
|
||||||
|
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :email, presence: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, message: I18n.t('comment_attributes.email') }
|
validates :email, presence: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, message: I18n.t('comment_attributes.email') }
|
||||||
validates :content, presence: true
|
validates :content, presence: true
|
||||||
validates_presence_of :post_id
|
|
||||||
|
|
||||||
def reply_emails
|
def reply_emails
|
||||||
Comment.where(post_id: self.post_id).collect(&:email).uniq - [ self.email ] - Subscribe.unsubscribe_list
|
Comment.where(post_id: self.post_id).collect(&:email).uniq - [ self.email ] - Subscribe.unsubscribe_list
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
class Label
|
class Label < ApplicationRecord
|
||||||
include Mongoid::Document
|
|
||||||
include Mongoid::Timestamps
|
|
||||||
|
|
||||||
field :name, :type => String
|
|
||||||
|
|
||||||
has_and_belongs_to_many :posts
|
has_and_belongs_to_many :posts
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
class Like
|
class Like < ApplicationRecord
|
||||||
include Mongoid::Document
|
|
||||||
|
|
||||||
belongs_to :post
|
belongs_to :post
|
||||||
validates_presence_of :post_id
|
validates_presence_of :post_id
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
class Photo
|
class Photo < ApplicationRecord
|
||||||
include Mongoid::Document
|
|
||||||
include Mongoid::Timestamps
|
|
||||||
field :image
|
|
||||||
|
|
||||||
mount_uploader :image, PhotoUploader
|
mount_uploader :image, PhotoUploader
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
# encoding : utf-8
|
|
||||||
#
|
|
||||||
require 'markdown'
|
require 'markdown'
|
||||||
class Post
|
class Post < ActiveRecord::Base
|
||||||
TECH = "技术"
|
|
||||||
LIFE = "生活"
|
|
||||||
CREATOR = "创业"
|
|
||||||
include Mongoid::Document
|
|
||||||
include Mongoid::Timestamps
|
|
||||||
include Mongoid::Pagination
|
|
||||||
field :title, :type => String
|
|
||||||
field :content, :type => String
|
|
||||||
field :type, :type=> String
|
|
||||||
field :visited_count, :type=>Integer, :default=>0
|
|
||||||
|
|
||||||
has_many :comments
|
has_many :comments
|
||||||
has_and_belongs_to_many :labels
|
has_and_belongs_to_many :labels
|
||||||
|
|
||||||
|
@ -20,7 +7,6 @@ class Post
|
||||||
|
|
||||||
validates :title, :presence=>true, :uniqueness=> true
|
validates :title, :presence=>true, :uniqueness=> true
|
||||||
validates :content, :presence=>true, :length => { :minimum=> 30 }
|
validates :content, :presence=>true, :length => { :minimum=> 30 }
|
||||||
validates :type, :presence=>true, :inclusion => { :in => [ TECH, LIFE, CREATOR ] }
|
|
||||||
|
|
||||||
after_create do
|
after_create do
|
||||||
if ENV['MAIL_SERVER'].present?
|
if ENV['MAIL_SERVER'].present?
|
||||||
|
@ -38,35 +24,21 @@ class Post
|
||||||
md.render(content)
|
md.render(content)
|
||||||
end
|
end
|
||||||
|
|
||||||
def type_en
|
|
||||||
map = {
|
|
||||||
'技术' => 'Tech',
|
|
||||||
'生活' => 'Life',
|
|
||||||
'创业' => 'Creator',
|
|
||||||
}
|
|
||||||
|
|
||||||
if I18n.locale == :en
|
|
||||||
map[type]
|
|
||||||
else
|
|
||||||
type
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def visited
|
def visited
|
||||||
self.visited_count += 1
|
self.visited_count += 1
|
||||||
self.save
|
self.save
|
||||||
self.visited_count
|
self.visited_count
|
||||||
end
|
end
|
||||||
|
|
||||||
# 显示给首页截断数据
|
# truncate content for home page display
|
||||||
def sub_content
|
def sub_content
|
||||||
HTML_Truncator.truncate(content_html, 300, length_in_chars: true)
|
HTML_Truncator.truncate(content_html, 300, length_in_chars: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
# 显示给 meta description
|
# truncate content for meta description display
|
||||||
def meta_content
|
def meta_content
|
||||||
html = HTML_Truncator.truncate(content_html, 100, :length_in_chars => true, ellipsis: '')
|
html = HTML_Truncator.truncate(content_html, 100, :length_in_chars => true, ellipsis: '')
|
||||||
# 加上 div 以方便 Nokogiri 获取 text()
|
# Easily get text for Nokogiri
|
||||||
html = '<div>' + html + '</div>'
|
html = '<div>' + html + '</div>'
|
||||||
Nokogiri.parse(html).text()
|
Nokogiri.parse(html).text()
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
class Subscribe
|
class Subscribe < ApplicationRecord
|
||||||
include Mongoid::Document
|
|
||||||
field :email, type: String
|
|
||||||
field :enable, type: Mongoid::Boolean, default: true
|
|
||||||
|
|
||||||
validates :email, presence: true, uniqueness: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, message: '地址无效' }
|
validates :email, presence: true, uniqueness: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, message: '地址无效' }
|
||||||
|
|
||||||
def self.subscribe_list
|
def self.subscribe_list
|
||||||
|
|
|
@ -8,41 +8,22 @@ html
|
||||||
= content_for?(:title) ? yield(:title) + " | #{ENV['SITE_NAME']}" : ENV['SITE_NAME']
|
= content_for?(:title) ? yield(:title) + " | #{ENV['SITE_NAME']}" : ENV['SITE_NAME']
|
||||||
= stylesheet_link_tag "application", media: 'all'
|
= stylesheet_link_tag "application", media: 'all'
|
||||||
= favicon_link_tag 'favicon.png', type: 'image/png'
|
= favicon_link_tag 'favicon.png', type: 'image/png'
|
||||||
= javascript_include_tag "vendor/modernizr"
|
|
||||||
= javascript_include_tag "application"
|
= javascript_include_tag "application"
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
body
|
body
|
||||||
- if content_for?(:main)
|
- if content_for?(:main)
|
||||||
= yield(:main)
|
= yield(:main)
|
||||||
- else
|
- else
|
||||||
.off-canvas-wrap data-offcanvas=''
|
.off-canvas-wrapper
|
||||||
.inner-wrap
|
.off-canvas-wrapper-inner data-off-canvas-wrapper=''
|
||||||
nav.tab-bar
|
.off-canvas.position-left id="offCanvas" data-off-canvas=''
|
||||||
section.left-small
|
ul.vertical.menu.mobile-ofc
|
||||||
a.left-off-canvas-toggle.menu-icon href="#"
|
|
||||||
span
|
|
||||||
h1.title.middle-text
|
|
||||||
= link_to ENV['SITE_NAME'], root_path
|
|
||||||
aslide.left-off-canvas-menu
|
|
||||||
ul.off-canvas-list
|
|
||||||
li
|
li
|
||||||
label Menu
|
label Menu
|
||||||
li
|
li
|
||||||
= link_to root_path do
|
= link_to root_path do
|
||||||
i.fi-home
|
i.fi-home
|
||||||
| #{t('head.home')}
|
| #{t('head.home')}
|
||||||
li
|
|
||||||
= link_to '/tech' do
|
|
||||||
i.fi-social-evernote
|
|
||||||
| #{t('head.tech')}
|
|
||||||
li
|
|
||||||
= link_to '/life' do
|
|
||||||
i.fi-torsos-male-female
|
|
||||||
| #{t('head.life')}
|
|
||||||
li
|
|
||||||
= link_to '/creator' do
|
|
||||||
i.fi-lightbulb
|
|
||||||
| #{t('head.creator')}
|
|
||||||
li
|
li
|
||||||
label Archive
|
label Archive
|
||||||
li
|
li
|
||||||
|
@ -54,7 +35,25 @@ html
|
||||||
= link_to about_path do
|
= link_to about_path do
|
||||||
i.fi-torso
|
i.fi-torso
|
||||||
| #{t('head.about')}
|
| #{t('head.about')}
|
||||||
section.main-section ng-app="app"
|
.off-canvas-content data-off-canvas-content=''
|
||||||
|
.title-bar.hide-for-medium.my-topbar
|
||||||
|
.title-bar-left
|
||||||
|
button.menu-icon type='button' data-open='offCanvas'
|
||||||
|
span.title-bar-title
|
||||||
|
= link_to ENV['SITE_NAME'], root_path
|
||||||
|
.top-bar.show-for-medium.my-topbar
|
||||||
|
.top-bar-left
|
||||||
|
ul.dropdown.menu data-dropdown-menu=''
|
||||||
|
li
|
||||||
|
= link_to ENV['SITE_NAME'], root_path, class: 'title'
|
||||||
|
.top-bar-right
|
||||||
|
ul.dropdown.menu data-dropdown-menu=''
|
||||||
|
li
|
||||||
|
a href='#' 首页
|
||||||
|
li
|
||||||
|
a href='#' 时间线
|
||||||
|
li
|
||||||
|
a href='#' 关于
|
||||||
- flash.each do |name, msg|
|
- flash.each do |name, msg|
|
||||||
- if msg.is_a?(String)
|
- if msg.is_a?(String)
|
||||||
div class=("alert-box #{name == :notice ? "success" : "alert"}") data-alert=""
|
div class=("alert-box #{name == :notice ? "success" : "alert"}") data-alert=""
|
||||||
|
@ -63,6 +62,5 @@ html
|
||||||
= render 'common/welcome_new_year'
|
= render 'common/welcome_new_year'
|
||||||
= yield
|
= yield
|
||||||
= render "layouts/footer"
|
= render "layouts/footer"
|
||||||
a.exit-off-canvas
|
|
||||||
|
|
||||||
= render 'layouts/google_analytics'
|
= render 'layouts/google_analytics'
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
require File.expand_path('../boot', __FILE__)
|
require File.expand_path('../boot', __FILE__)
|
||||||
|
|
||||||
# Pick the frameworks you want:
|
require 'rails/all'
|
||||||
require "active_model/railtie"
|
|
||||||
require "action_controller/railtie"
|
|
||||||
require "action_mailer/railtie"
|
|
||||||
require "action_view/railtie"
|
|
||||||
require "sprockets/railtie"
|
|
||||||
require "rails/test_unit/railtie"
|
|
||||||
Bundler.require(:default, Rails.env)
|
Bundler.require(:default, Rails.env)
|
||||||
|
|
||||||
module WBlog
|
module WBlog
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
|
|
||||||
# Configure sensitive parameters which will be filtered from the log file.
|
|
||||||
config.i18n.available_locales = [:en, :'zh-CN']
|
config.i18n.available_locales = [:en, :'zh-CN']
|
||||||
#I18n.config.enforce_available_locales = true
|
#I18n.config.enforce_available_locales = true
|
||||||
config.i18n.default_locale = (ENV['LOCALE'] || 'zh-CN').to_sym
|
config.i18n.default_locale = (ENV['LOCALE'] || 'zh-CN').to_sym
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
development:
|
||||||
|
adapter: postgresql
|
||||||
|
host: localhost
|
||||||
|
encoding: unicode
|
||||||
|
database: wblog_development
|
||||||
|
pool: 5
|
||||||
|
|
||||||
|
test:
|
||||||
|
adapter: postgresql
|
||||||
|
host: localhost
|
||||||
|
encoding: unicode
|
||||||
|
database: wblog_test
|
||||||
|
pool: 5
|
||||||
|
|
||||||
|
production:
|
||||||
|
adapter: postgresql
|
||||||
|
host: localhost
|
||||||
|
encoding: unicode
|
||||||
|
database: wblog_production
|
||||||
|
pool: 5
|
|
@ -0,0 +1,11 @@
|
||||||
|
class CreatePosts < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
create_table :posts do |t|
|
||||||
|
t.string :title
|
||||||
|
t.text :content
|
||||||
|
t.integer :visited_count
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,12 @@
|
||||||
|
class CreateComments < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
create_table :comments do |t|
|
||||||
|
t.string :name
|
||||||
|
t.string :email
|
||||||
|
t.text :conent
|
||||||
|
t.integer :post_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
class CreateLabels < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
create_table :labels do |t|
|
||||||
|
t.string :name
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
class CreateLikes < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
create_table :likes do |t|
|
||||||
|
t.integer :post_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
class CreatePhotos < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
create_table :photos do |t|
|
||||||
|
t.string :image
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,10 @@
|
||||||
|
class CreateSubscribes < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
create_table :subscribes do |t|
|
||||||
|
t.string :email
|
||||||
|
t.boolean :enable
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,61 @@
|
||||||
|
# encoding: UTF-8
|
||||||
|
# This file is auto-generated from the current state of the database. Instead
|
||||||
|
# of editing this file, please use the migrations feature of Active Record to
|
||||||
|
# incrementally modify your database, and then regenerate this schema definition.
|
||||||
|
#
|
||||||
|
# Note that this schema.rb definition is the authoritative source for your
|
||||||
|
# database schema. If you need to create the application database on another
|
||||||
|
# system, you should be using db:schema:load, not running all the migrations
|
||||||
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||||
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||||
|
#
|
||||||
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
|
ActiveRecord::Schema.define(version: 20160420082909) do
|
||||||
|
|
||||||
|
# These are extensions that must be enabled in order to support this database
|
||||||
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
|
create_table "comments", force: :cascade do |t|
|
||||||
|
t.string "name"
|
||||||
|
t.string "email"
|
||||||
|
t.text "conent"
|
||||||
|
t.integer "post_id"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "labels", force: :cascade do |t|
|
||||||
|
t.string "name"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "likes", force: :cascade do |t|
|
||||||
|
t.integer "post_id"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "photos", force: :cascade do |t|
|
||||||
|
t.string "image"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "posts", force: :cascade do |t|
|
||||||
|
t.string "title"
|
||||||
|
t.text "content"
|
||||||
|
t.integer "visited_count"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "subscribes", force: :cascade do |t|
|
||||||
|
t.string "email"
|
||||||
|
t.boolean "enable"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Comment, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Label, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Photo, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in New Issue