fuel 0.3.3 → 0.3.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -2
  3. data/app/assets/images/fuel/icon-test.png +0 -0
  4. data/app/assets/images/fuel/icons/application-icons.svg +1 -0
  5. data/app/assets/images/fuel/icons/calendar-icon.svg +1 -0
  6. data/app/assets/images/fuel/icons/dropdown-arrow-icon.svg +10 -0
  7. data/app/assets/images/fuel/icons/navigation-icons.svg +1 -0
  8. data/app/assets/javascripts/fuel/admin.js.erb +17 -17
  9. data/app/assets/javascripts/fuel/application.js +8 -0
  10. data/app/assets/javascripts/fuel/datepicker.js +11 -0
  11. data/app/assets/javascripts/fuel/facebook.js +12 -0
  12. data/app/assets/javascripts/fuel/posts.js.erb +16 -0
  13. data/app/assets/javascripts/fuel/rich-text.js +9 -0
  14. data/app/assets/javascripts/fuel/sliding-panel.js +11 -0
  15. data/app/assets/stylesheets/fuel/_page-layout.scss +61 -0
  16. data/app/assets/stylesheets/fuel/_post-list.scss +70 -0
  17. data/app/assets/stylesheets/fuel/application.css.scss +27 -2
  18. data/app/assets/stylesheets/fuel/base/_base.scss +5 -0
  19. data/app/assets/stylesheets/fuel/base/_layout.scss +54 -0
  20. data/app/assets/stylesheets/fuel/base/_typography.scss +102 -0
  21. data/app/assets/stylesheets/fuel/components/_alerts.scss +27 -0
  22. data/app/assets/stylesheets/fuel/components/_animations.scss +26 -0
  23. data/app/assets/stylesheets/fuel/components/_application-icons.scss +42 -0
  24. data/app/assets/stylesheets/fuel/components/_buttons.scss +106 -0
  25. data/app/assets/stylesheets/fuel/components/_card.scss +39 -0
  26. data/app/assets/stylesheets/fuel/components/_components.scss +13 -0
  27. data/app/assets/stylesheets/fuel/components/_forms.scss +90 -0
  28. data/app/assets/stylesheets/fuel/components/_navbar.scss +45 -0
  29. data/app/assets/stylesheets/fuel/components/_navigation-icons.scss +41 -0
  30. data/app/assets/stylesheets/fuel/components/_page-sidebar.scss +60 -0
  31. data/app/assets/stylesheets/fuel/components/_sliding-panel.scss +59 -0
  32. data/app/assets/stylesheets/fuel/settings/_reset.scss +46 -0
  33. data/app/assets/stylesheets/fuel/settings/_settings.scss +19 -0
  34. data/app/assets/stylesheets/fuel/settings/mixins/_layout.scss +20 -0
  35. data/app/assets/stylesheets/fuel/settings/mixins/_misc.scss +27 -0
  36. data/app/assets/stylesheets/fuel/settings/mixins/_rem.scss +46 -0
  37. data/app/assets/stylesheets/fuel/settings/mixins/_typography.scss +64 -0
  38. data/app/assets/stylesheets/fuel/settings/variables/_alerts.scss +9 -0
  39. data/app/assets/stylesheets/fuel/settings/variables/_buttons.scss +8 -0
  40. data/app/assets/stylesheets/fuel/settings/variables/_colors.scss +55 -0
  41. data/app/assets/stylesheets/fuel/settings/variables/_typography.scss +25 -0
  42. data/app/controllers/fuel/admin/admin_controller.rb +7 -0
  43. data/app/controllers/fuel/admin/authors_controller.rb +80 -0
  44. data/app/controllers/fuel/admin/posts_controller.rb +68 -54
  45. data/app/controllers/fuel/fuel_controller.rb +5 -0
  46. data/app/controllers/fuel/posts_controller.rb +13 -7
  47. data/app/controllers/fuel_controller.rb +5 -0
  48. data/app/helpers/fuel/posts_helper.rb +28 -1
  49. data/app/models/fuel.rb +5 -0
  50. data/app/models/fuel/author.rb +18 -0
  51. data/app/models/fuel/post.rb +32 -2
  52. data/app/views/fuel/admin/authors/_authors.html.erb +24 -0
  53. data/app/views/fuel/admin/authors/_form.html.erb +52 -0
  54. data/app/views/fuel/admin/authors/edit.html.erb +9 -0
  55. data/app/views/fuel/admin/authors/index.html.erb +7 -0
  56. data/app/views/fuel/admin/authors/new.html.erb +6 -0
  57. data/app/views/fuel/admin/posts/_content.html.erb +5 -0
  58. data/app/views/fuel/admin/posts/_form.html.erb +56 -0
  59. data/app/views/fuel/admin/posts/_post_preview.html.erb +12 -0
  60. data/app/views/fuel/admin/posts/_posts.html.erb +23 -0
  61. data/app/views/fuel/admin/posts/edit.html.erb +11 -0
  62. data/app/views/fuel/admin/posts/index.html.erb +6 -0
  63. data/app/views/fuel/admin/posts/new.html.erb +9 -0
  64. data/app/views/fuel/components/_navbar.html.erb +22 -0
  65. data/app/views/fuel/posts/_additional_info.html.erb +7 -0
  66. data/app/views/fuel/posts/_facebook_sdk.html.erb +17 -0
  67. data/app/views/fuel/posts/_tweet.html.erb +1 -1
  68. data/app/views/fuel/posts/index.html.erb +27 -6
  69. data/app/views/fuel/posts/show.html.erb +19 -2
  70. data/app/views/layouts/fuel/application.html.erb +19 -12
  71. data/config/routes.rb +18 -10
  72. data/db/migrate/20141114201953_add_featured_image_field.rb +5 -0
  73. data/db/migrate/20141118162158_add_teaser_to_posts.rb +5 -0
  74. data/db/migrate/20141217174229_add_featured_image_to_posts.rb +10 -0
  75. data/db/migrate/20150414220732_add_seo_fields_to_post.rb +6 -0
  76. data/db/migrate/20150529201715_add_posted_at_to_posts.rb +5 -0
  77. data/db/migrate/20150529202105_create_fuel_authors.rb +13 -0
  78. data/db/migrate/20150530180444_add_author_id_to_posts.rb +5 -0
  79. data/db/migrate/20150603205232_add_contact_methods_to_authors.rb +8 -0
  80. data/db/migrate/20150604155028_add_published_at_to_fuel_posts.rb +5 -0
  81. data/db/migrate/20150604161900_remove_posted_at_from_fuel_posts.rb +5 -0
  82. data/lib/blog_importer.rb +82 -0
  83. data/lib/example_author.rb +108 -0
  84. data/lib/fuel.rb +7 -1
  85. data/lib/fuel/configuration.rb +16 -1
  86. data/lib/fuel/engine.rb +13 -1
  87. data/lib/fuel/version.rb +1 -1
  88. data/lib/generators/fuel/install_generator.rb +4 -0
  89. data/lib/generators/fuel/views_generator.rb +1 -1
  90. data/lib/generators/templates/fuel.rb +22 -0
  91. data/lib/kaminari/helpers/tag.rb +16 -0
  92. data/lib/tasks/fuel_tasks.rake +35 -4
  93. data/test/fixtures/fuel/authors.yml +11 -0
  94. data/test/models/fuel/author_test.rb +7 -0
  95. metadata +191 -15
  96. data/app/assets/stylesheets/fuel/admin.css.sass +0 -91
  97. data/app/assets/stylesheets/fuel/posts.css.sass +0 -23
  98. data/app/controllers/fuel/application_controller.rb +0 -4
  99. data/app/helpers/fuel/application_helper.rb +0 -34
  100. data/app/views/fuel/admin/posts/_content.html.slim +0 -3
  101. data/app/views/fuel/admin/posts/_form.html.slim +0 -28
  102. data/app/views/fuel/admin/posts/edit.html.slim +0 -4
  103. data/app/views/fuel/admin/posts/index.html.slim +0 -18
  104. data/app/views/fuel/admin/posts/new.html.slim +0 -4
  105. data/app/views/fuel/posts/_post.html.erb +0 -19
@@ -0,0 +1,59 @@
1
+ // Sliding Panel Component
2
+ // ========================================
3
+
4
+ // Variables
5
+ $sliding-panel-background: $white-base;
6
+
7
+ $sliding-panel-header-background: $green-base;
8
+
9
+ $sliding-panel-background-active: $black-base;
10
+ $sliding-panel-shadow-active: rgba(0, 0, 0, 0.35);
11
+ $sliding-panel-spread-active: 5px 0 10px;
12
+
13
+ // Structure
14
+ .sliding-panel-content {
15
+ @include position(fixed, 0 auto 0 0);
16
+ @include size(90% 100%);
17
+ @include transform(translateX(-100%));
18
+ @include transition(all 0.5s ease-in);
19
+ background: $sliding-panel-background;
20
+ z-index: 999999;
21
+ overflow-y: auto;
22
+ -webkit-overflow-scrolling: touch;
23
+
24
+ &.is-visible {
25
+ @include box-shadow($sliding-panel-spread-active, $sliding-panel-shadow-active);
26
+ @include transform(translateX(0));
27
+ }
28
+ }
29
+
30
+ .sliding-panel-header {
31
+ @include rem(margin-bottom, 20px);
32
+ @include rem(padding, 20px);
33
+ background-color: $sliding-panel-header-background;
34
+
35
+ .title {
36
+ @include s-foxtrot;
37
+ margin: 0;
38
+ text-transform: uppercase;
39
+ }
40
+ }
41
+
42
+ .sliding-panel-body {
43
+ margin: 0 auto;
44
+ width: 65%;
45
+ }
46
+
47
+ .sliding-panel-fade-screen {
48
+ @include position(fixed, 0 0 0 0);
49
+ @include transition();
50
+ background: $sliding-panel-background-active;
51
+ opacity: 0;
52
+ visibility: hidden;
53
+ z-index: 999998;
54
+
55
+ &.is-visible {
56
+ opacity: 0.8;
57
+ visibility: visible;
58
+ }
59
+ }
@@ -0,0 +1,46 @@
1
+ // http://meyerweb.com/eric/tools/css/reset/
2
+ // v2.0 | 20110126
3
+ // License: none (public domain)
4
+
5
+ @mixin meyer-reset {
6
+ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
7
+ margin: 0;
8
+ padding: 0;
9
+ border: 0;
10
+ font-size: 100%;
11
+ font: inherit;
12
+ vertical-align: baseline;
13
+ }
14
+
15
+ // HTML5 display-role reset for older browsers
16
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
17
+ display: block;
18
+ }
19
+ body {
20
+ line-height: 1;
21
+ }
22
+ ol, ul {
23
+ list-style: none;
24
+ }
25
+ blockquote, q {
26
+ quotes: none;
27
+ }
28
+ blockquote {
29
+ &:before, &:after {
30
+ content: "";
31
+ content: none;
32
+ }
33
+ }
34
+ q {
35
+ &:before, &:after {
36
+ content: "";
37
+ content: none;
38
+ }
39
+ }
40
+ table {
41
+ border-collapse: collapse;
42
+ border-spacing: 0;
43
+ }
44
+ }
45
+
46
+ @include meyer-reset;
@@ -0,0 +1,19 @@
1
+ // Settings Directory
2
+ // ========================================
3
+
4
+ // Reset
5
+ @import "reset";
6
+
7
+
8
+ // Variables
9
+ @import "variables/colors";
10
+ @import "variables/alerts";
11
+ @import "variables/buttons";
12
+ @import "variables/typography";
13
+
14
+
15
+ // Mixins
16
+ @import "mixins/layout";
17
+ @import "mixins/misc";
18
+ @import "mixins/rem";
19
+ @import "mixins/typography";
@@ -0,0 +1,20 @@
1
+ @import "neat-helpers";
2
+
3
+ //GRID SETTINGS
4
+ $grid-columns: 12;
5
+
6
+ //MEDIA QUERIES
7
+
8
+ //DEFINED VARIABLES
9
+ $mobile-size:em(320);
10
+ $tablet-size:em(720);
11
+ $desktop-size:em(1200);
12
+
13
+ // SPECIAL VARIABLES
14
+ $tablet-landscape: em(1024);
15
+
16
+ // Bourbon Neat Breakpoints
17
+ $mobile: new-breakpoint(min-width $mobile-size 4);
18
+ $tablet: new-breakpoint(min-width $tablet-size 9);
19
+ $tablet-landscape: new-breakpoint(min-width $tablet-landscape orientation landscape 9); //LPL Added
20
+ $desktop: new-breakpoint(min-width $desktop-size 12);
@@ -0,0 +1,27 @@
1
+ // Misc. Stylesheet
2
+ // ========================================
3
+
4
+
5
+ // Background Image
6
+ @mixin background-size($size){
7
+ -webkit-background-size: $size;
8
+ -moz-background-size: $size;
9
+ -o-background-size: $size;
10
+ background-size: $size;
11
+ }
12
+
13
+
14
+ // Box Shadow
15
+ @mixin box-shadow($dim: 0 0 0 0, $color: $black-base){
16
+ -webkit-box-shadow: $dim $color;
17
+ -moz-box-shadow: $dim $color;
18
+ -o-box-shadow: $dim $color;
19
+ box-shadow: $dim $color;
20
+ }
21
+
22
+ // Vertical Center
23
+ @mixin vertical-center {
24
+ @include transform(translateY(-50%));
25
+ position: absolute;
26
+ top: 50%;
27
+ }
@@ -0,0 +1,46 @@
1
+ //REM MIXIN FROM ROLODEX - BELLYCARD
2
+
3
+ // Strip the unit from a value
4
+
5
+ @function remove-unit($num) {
6
+ @return $num / ($num * 0 + 1);
7
+ }
8
+
9
+ // Mixin
10
+
11
+ @mixin rem($property, $values) {
12
+ $root: remove-unit($font-size-base);
13
+ $px-values: ();
14
+ $rem-values: ();
15
+
16
+ @each $value in $values {
17
+ @if $value == 0 or type-of($value) != "number" {
18
+ $px-values: append($px-values, $value);
19
+ $rem-values: append($rem-values, $value);
20
+ }
21
+
22
+ @else {
23
+ $unit: unit($value);
24
+ $val: remove-unit($value);
25
+
26
+ @if $unit == "px" {
27
+ $px-values: append($px-values, $val + px);
28
+ $rem-values: append($rem-values, $val / $root + rem);
29
+ }
30
+
31
+ @if $unit == "rem" {
32
+ $px-values: append($px-values, $val * $root + px);
33
+ $rem-values: append($rem-values, $val + rem);
34
+ }
35
+ }
36
+ }
37
+
38
+ @if $rem-values == $px-values {
39
+ #{$property}: $rem-values;
40
+ }
41
+
42
+ @else {
43
+ #{$property}: $px-values;
44
+ #{$property}: $rem-values;
45
+ }
46
+ }
@@ -0,0 +1,64 @@
1
+ // Typography Mixin
2
+ // ========================================
3
+
4
+
5
+ // Font Sizes
6
+ @mixin s-giga{
7
+ @include rem(font-size, $s-giga);
8
+ }
9
+
10
+ @mixin s-mega{
11
+ @include rem(font-size, $s-mega);
12
+ }
13
+
14
+ @mixin s-alpha{
15
+ @include rem(font-size, $s-alpha);
16
+ }
17
+
18
+ @mixin s-bravo{
19
+ @include rem(font-size, $s-bravo);
20
+ @include rem(line-height, $base-line-height);
21
+ }
22
+
23
+ @mixin s-charlie{
24
+ @include rem(font-size, $s-charlie);
25
+ @include rem(line-height, $base-line-height);
26
+ }
27
+
28
+ @mixin s-delta{
29
+ @include rem(font-size, $s-delta);
30
+ }
31
+
32
+ @mixin s-echo{
33
+ @include rem(font-size, $s-echo);
34
+ }
35
+
36
+ @mixin s-foxtrot{
37
+ @include rem(font-size, $s-foxtrot);
38
+ }
39
+
40
+ @mixin s-golf{
41
+ @include rem(font-size, $s-golf);
42
+ @include rem(line-height, $base-line-small);
43
+ }
44
+
45
+ @mixin s-hotel{
46
+ @include rem(font-size, $s-hotel);
47
+ @include rem(line-height, $base-line-small);
48
+ }
49
+
50
+
51
+ // Font Styles
52
+ @mixin font-type($type, $style, $weight){
53
+ font-family: $type;
54
+ font-style: $style;
55
+ font-weight: $weight;
56
+ }
57
+
58
+ // Text Shadow
59
+ @mixin text-shadow($dim: 0 0 0 0, $color: $black-base){
60
+ -webkit-text-shadow: $dim $color;
61
+ -moz-text-shadow: $dim $color;
62
+ -o-text-shadow: $dim $color;
63
+ text-shadow: $dim $color;
64
+ }
@@ -0,0 +1,9 @@
1
+ // Alert Variables
2
+ // ========================================
3
+
4
+ $alerts: (
5
+ success $green-base $green-dark,
6
+ danger $yellow-base $yellow-dark,
7
+ warning $red-base $red-dark,
8
+ default $blue-base $blue-dark
9
+ );
@@ -0,0 +1,8 @@
1
+ // Buttons
2
+ // ========================================
3
+
4
+ $buttons: (
5
+ (primary, $blue-base, $white-base)
6
+ (secondary, $green-base, $white-base)
7
+ ('white', $white-base, $black-base)
8
+ )
@@ -0,0 +1,55 @@
1
+ // Colors
2
+ // ========================================
3
+
4
+ // Black
5
+ $black-base: #4A4A4A;
6
+ $black-dark: #333333;
7
+
8
+ // Blue
9
+ $blue-base: #00ADEF;
10
+ $blue-medium: #0094CC;
11
+ $blue-dark: #024E6E;
12
+
13
+ // Green
14
+ $green-base: #C4DC6E;
15
+ $green-dark: #89C540;
16
+
17
+ // Grey
18
+ $grey-light: #EBEBEB;
19
+ $grey-base: #DEDEDE;
20
+ $grey-dark: #9B9B9B;
21
+
22
+ // Red
23
+ $red-base: #F7917C;
24
+ $red-dark: #DF4F32;
25
+
26
+ // Yellow
27
+ $yellow-base: #F3C859;
28
+ $yellow-dark: #FFC107;
29
+
30
+ // White
31
+ $white-light: #FAFAFA;
32
+ $white-base: #FFFFFF;
33
+ $white-dark: #F1F1F1;
34
+
35
+
36
+ //MAIN PALETTE LIST
37
+ $colors: (
38
+ black-base $black-base,
39
+ black-dark $black-dark,
40
+ blue-base $blue-base,
41
+ blue-medium $blue-medium,
42
+ blue-dark $blue-dark,
43
+ grey-light $grey-light,
44
+ grey-base $grey-base,
45
+ grey-dark $grey-dark,
46
+ green-base $green-base,
47
+ green-dark $green-dark,
48
+ red-base $red-base,
49
+ red-dark $red-dark,
50
+ yellow-base $yellow-base,
51
+ yellow-dark $yellow-dark,
52
+ white-light $white-light,
53
+ white-base $white-base,
54
+ white-dark $white-dark
55
+ );
@@ -0,0 +1,25 @@
1
+ // Typography Variables
2
+ // ========================================
3
+
4
+ // Font Families
5
+ $primary-sans-serif: "proxima-nova", Helvetica, sans-serif;
6
+ $primary-serif: "museo-slab", Georgia, serif;
7
+
8
+ // Sizes
9
+ $font-size-base: 14px;
10
+
11
+ $s-giga: 60px;
12
+ $s-mega: 42px;
13
+
14
+ $s-alpha: 30px;
15
+ $s-bravo: 24px;
16
+ $s-charlie: 21px;
17
+ $s-delta: 18px;
18
+ $s-echo: 16px;
19
+ $s-foxtrot: $font-size-base;
20
+ $s-golf: 12px;
21
+ $s-hotel: 11px;
22
+
23
+ // Line Heights
24
+ $base-line-height: $font-size-base * 1.5;
25
+ $base-line-small: $font-size-base;
@@ -0,0 +1,7 @@
1
+ module Fuel
2
+ module Admin
3
+ class AdminController < ::FuelController
4
+ http_basic_authenticate_with name: Fuel.configuration.username, password: Fuel.configuration.password
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,80 @@
1
+ module Fuel
2
+ module Admin
3
+ class AuthorsController < AdminController
4
+ layout "fuel/application"
5
+ before_filter :find_authors
6
+ before_filter :find_author, only: [:edit, :update, :destroy]
7
+ before_filter :set_url, only: [:new, :create, :edit, :update]
8
+
9
+ def index
10
+ end
11
+
12
+ def new
13
+ @author = Fuel::Author.new
14
+ end
15
+
16
+ def create
17
+ if Rails.version[0].to_i < 4
18
+ @author = Fuel::Author.new(params[:fuel_author])
19
+ else
20
+ @author = Fuel::Author.new(author_params)
21
+ end
22
+
23
+ if @author.save
24
+ redirect_to fuel.admin_authors_path, notice: "Your author was successfully #{@message}."
25
+ else
26
+ render action: "new"
27
+ end
28
+ end
29
+
30
+ def edit
31
+
32
+ end
33
+
34
+ def update
35
+ if Rails.version[0].to_i < 4
36
+ @author.attributes = params[:fuel_author]
37
+ else
38
+ @author.attributes = author_params
39
+ end
40
+
41
+ if @author.save
42
+ redirect_to fuel.admin_authors_path, notice: "Author was updated and #{@message}"
43
+ else
44
+ render action: "edit"
45
+ end
46
+ end
47
+
48
+ def destroy
49
+ @author.posts.each do |post|
50
+ post.author_id = nil
51
+ post.save
52
+ end
53
+ @author.destroy
54
+ redirect_to fuel.admin_authors_path, notice: "Author was successfully deleted"
55
+ end
56
+
57
+ def show
58
+ end
59
+
60
+ private
61
+
62
+ def author_params
63
+ params.require(:fuel_author).permit(:first_name, :last_name, :title, :bio, :avatar, :email, :twitter, :github, :dribbble)
64
+ end
65
+
66
+ def find_author
67
+ @author = Fuel::Author.find_by_id(params[:id])
68
+ end
69
+
70
+ def find_authors
71
+ @authors = Fuel::Author.order("first_name ASC")
72
+ end
73
+
74
+ def set_url
75
+ @url = ["new", "create"].include?(action_name) ? fuel.admin_authors_path : fuel.admin_author_path(@author)
76
+ end
77
+
78
+ end
79
+ end
80
+ end