fuel 0.3.27 → 0.3.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/app/assets/stylesheets/fuel/base/_layout.scss +5 -0
  4. data/app/assets/stylesheets/fuel/components/_application-icons.scss +0 -1
  5. data/app/assets/stylesheets/fuel/components/_card.scss +14 -0
  6. data/app/assets/stylesheets/fuel/components/_editor.scss +29 -68
  7. data/app/assets/stylesheets/fuel/components/_forms.scss +18 -1
  8. data/app/assets/stylesheets/fuel/components/_sliding-panel.scss +10 -0
  9. data/app/models/fuel/author.rb +9 -1
  10. data/app/models/fuel/post.rb +5 -1
  11. data/app/views/fuel/admin/posts/_editor.html.erb +3 -4
  12. data/app/views/fuel/admin/posts/_form.html.erb +23 -22
  13. data/app/views/fuel/admin/posts/_post_preview.html.erb +4 -4
  14. data/lib/fuel/version.rb +1 -1
  15. data/spec/controllers/fuel/admin/posts_controller_spec.rb +133 -0
  16. data/spec/controllers/fuel/posts_controller_spec.rb +53 -0
  17. data/spec/dummy/README.rdoc +28 -0
  18. data/spec/dummy/Rakefile +6 -0
  19. data/spec/dummy/app/assets/images/headshots/brendan.jpg +0 -0
  20. data/spec/dummy/app/assets/images/headshots/dave.jpg +0 -0
  21. data/spec/dummy/app/assets/images/headshots/jack.jpg +0 -0
  22. data/spec/dummy/app/assets/images/headshots/katie.jpg +0 -0
  23. data/spec/dummy/app/assets/images/headshots/kurt.jpg +0 -0
  24. data/spec/dummy/app/assets/images/headshots/monique.jpg +0 -0
  25. data/spec/dummy/app/assets/images/headshots/rocket.png +0 -0
  26. data/spec/dummy/app/assets/images/headshots/ryan.jpg +0 -0
  27. data/spec/dummy/app/assets/images/headshots/scott.jpg +0 -0
  28. data/spec/dummy/app/assets/images/headshots/tom.jpg +0 -0
  29. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  30. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  31. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  32. data/spec/dummy/app/helpers/application_helper.rb +3 -0
  33. data/spec/dummy/app/views/layouts/_header.html.erb +1 -0
  34. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/spec/dummy/bin/bundle +3 -0
  36. data/spec/dummy/bin/rails +4 -0
  37. data/spec/dummy/bin/rake +4 -0
  38. data/spec/dummy/config.ru +4 -0
  39. data/spec/dummy/config/application.rb +23 -0
  40. data/spec/dummy/config/boot.rb +5 -0
  41. data/spec/dummy/config/database.yml +25 -0
  42. data/spec/dummy/config/environment.rb +5 -0
  43. data/spec/dummy/config/environments/development.rb +29 -0
  44. data/spec/dummy/config/environments/production.rb +80 -0
  45. data/spec/dummy/config/environments/test.rb +36 -0
  46. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/spec/dummy/config/initializers/friendly_id.rb +88 -0
  49. data/spec/dummy/config/initializers/fuel.rb +45 -0
  50. data/spec/dummy/config/initializers/inflections.rb +16 -0
  51. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  52. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  53. data/spec/dummy/config/initializers/session_store.rb +3 -0
  54. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  55. data/spec/dummy/config/locales/en.yml +23 -0
  56. data/spec/dummy/config/routes.rb +6 -0
  57. data/spec/dummy/db/development.sqlite3 +0 -0
  58. data/spec/dummy/db/migrate/20150616184608_create_fuel_posts.fuel.rb +16 -0
  59. data/spec/dummy/db/migrate/20150616184609_add_featured_image_field.fuel.rb +6 -0
  60. data/spec/dummy/db/migrate/20150616184610_add_teaser_to_posts.fuel.rb +6 -0
  61. data/spec/dummy/db/migrate/20150616184611_add_featured_image_to_posts.fuel.rb +11 -0
  62. data/spec/dummy/db/migrate/20150616184612_add_seo_fields_to_post.fuel.rb +7 -0
  63. data/spec/dummy/db/migrate/20150616184613_add_posted_at_to_posts.fuel.rb +6 -0
  64. data/spec/dummy/db/migrate/20150616184614_create_fuel_authors.fuel.rb +14 -0
  65. data/spec/dummy/db/migrate/20150616184615_add_author_id_to_posts.fuel.rb +6 -0
  66. data/spec/dummy/db/migrate/20150616184616_add_contact_methods_to_authors.fuel.rb +9 -0
  67. data/spec/dummy/db/migrate/20150616184617_add_published_at_to_fuel_posts.fuel.rb +6 -0
  68. data/spec/dummy/db/migrate/20150616184618_remove_posted_at_from_fuel_posts.fuel.rb +6 -0
  69. data/spec/dummy/db/migrate/20150616184619_add_start_date_to_authors.fuel.rb +6 -0
  70. data/spec/dummy/db/schema.rb +57 -0
  71. data/spec/dummy/db/test.sqlite3 +0 -0
  72. data/spec/dummy/lib/tasks/import_blog.rake +13 -0
  73. data/spec/dummy/log/development.log +0 -0
  74. data/spec/dummy/log/test.log +5441 -0
  75. data/spec/dummy/public/404.html +58 -0
  76. data/spec/dummy/public/422.html +58 -0
  77. data/spec/dummy/public/500.html +57 -0
  78. data/spec/dummy/public/favicon.ico +0 -0
  79. data/spec/dummy/tmp/cache/assets/development/sass/4105e5a1347506aa0bdf1d045b6c437eeeaa8594/admin.css.sassc +0 -0
  80. data/spec/dummy/tmp/cache/assets/development/sass/4105e5a1347506aa0bdf1d045b6c437eeeaa8594/application.css.scssc +0 -0
  81. data/spec/dummy/tmp/cache/assets/development/sass/4105e5a1347506aa0bdf1d045b6c437eeeaa8594/posts.css.sassc +0 -0
  82. data/spec/dummy/tmp/cache/assets/development/sass/4105e5a1347506aa0bdf1d045b6c437eeeaa8594/posts.css.scssc +0 -0
  83. data/spec/dummy/tmp/cache/assets/development/sprockets/014dac3985653ba3455824e5bdaf93bd +0 -0
  84. data/spec/dummy/tmp/cache/assets/development/sprockets/03ac2f751ed77389257433b768f934c3 +0 -0
  85. data/spec/dummy/tmp/cache/assets/development/sprockets/05c5819ebb446d33153d21337d3a20ad +0 -0
  86. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  87. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  88. data/spec/dummy/tmp/cache/assets/development/sprockets/308795da63b7e95bd0f55cecedd62d94 +0 -0
  89. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  90. data/spec/dummy/tmp/cache/assets/development/sprockets/3865b2b2d5132e0ea4ed29815b482dce +0 -0
  91. data/spec/dummy/tmp/cache/assets/development/sprockets/3a8a9a4ef7dd450b1cf686b461bb5245 +0 -0
  92. data/spec/dummy/tmp/cache/assets/development/sprockets/3ebee12608c20315d8de4675220e3d04 +0 -0
  93. data/spec/dummy/tmp/cache/assets/development/sprockets/4498ae7c9df269c897e3280835f07167 +0 -0
  94. data/spec/dummy/tmp/cache/assets/development/sprockets/5191f0a9c44f6502f1b23c4e717ea384 +0 -0
  95. data/spec/dummy/tmp/cache/assets/development/sprockets/5562fe0dd779e67464c82bf5f677b926 +0 -0
  96. data/spec/dummy/tmp/cache/assets/development/sprockets/70c9660e2c4d5e5a677d36620d59df7c +0 -0
  97. data/spec/dummy/tmp/cache/assets/development/sprockets/741e06bd7a3e5bc32d44a86b156237b4 +0 -0
  98. data/spec/dummy/tmp/cache/assets/development/sprockets/78148fb54f92bb724386c0cbf866bf8b +0 -0
  99. data/spec/dummy/tmp/cache/assets/development/sprockets/7cb8cf7fca54a9d0c860db5e7a874fa9 +0 -0
  100. data/spec/dummy/tmp/cache/assets/development/sprockets/89c5e5ef520aeb480b2c370cd95e4aa3 +0 -0
  101. data/spec/dummy/tmp/cache/assets/development/sprockets/9501761eef62112c4a992aa52331b52f +0 -0
  102. data/spec/dummy/tmp/cache/assets/development/sprockets/970522fbbd63cf689683466c5196857f +0 -0
  103. data/spec/dummy/tmp/cache/assets/development/sprockets/9e6bbc6ad4182b36488ed894b2cf25af +0 -0
  104. data/spec/dummy/tmp/cache/assets/development/sprockets/9f4599bbfc23ec621d87974b1cb749e3 +0 -0
  105. data/spec/dummy/tmp/cache/assets/development/sprockets/9f6c8d6fbf570cfe1a06179461b0de2d +0 -0
  106. data/spec/dummy/tmp/cache/assets/development/sprockets/a97bc057d70e3604312a80f169e9e6e9 +0 -0
  107. data/spec/dummy/tmp/cache/assets/development/sprockets/bc12f5ee1ab1f3f41620171e56218d6f +0 -0
  108. data/spec/dummy/tmp/cache/assets/development/sprockets/bfa298bb2836528bc682672f2a549707 +0 -0
  109. data/spec/dummy/tmp/cache/assets/development/sprockets/c0b400cdc41be57879274baf7d92b911 +0 -0
  110. data/spec/dummy/tmp/cache/assets/development/sprockets/c21e7a5dd39166b6f02a10131e7b60a5 +0 -0
  111. data/spec/dummy/tmp/cache/assets/development/sprockets/c78d634ffc32ae4fadbe52ac7ca08aac +0 -0
  112. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  113. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  114. data/spec/dummy/tmp/cache/assets/development/sprockets/d7fb93600298f6787c9defd51a75aeb5 +0 -0
  115. data/spec/dummy/tmp/cache/assets/development/sprockets/d85f307de0f4da9bd598243e1f505804 +0 -0
  116. data/spec/dummy/tmp/cache/assets/development/sprockets/d9ff247d231468f7dc28844500bc20aa +0 -0
  117. data/spec/dummy/tmp/cache/assets/development/sprockets/f089ae120c22843da39b636bfc4b8e01 +0 -0
  118. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  119. data/spec/factories.rb +18 -0
  120. data/spec/fixtures/fuel/posts.yml +17 -0
  121. data/spec/helpers/fuel/posts_helper_test.rb +6 -0
  122. data/spec/integration/navigation_test.rb +10 -0
  123. data/spec/models/fuel/post_spec.rb +44 -0
  124. data/spec/spec_helper.rb +63 -0
  125. metadata +236 -7
  126. data/README.rdoc +0 -3
  127. data/test/fixtures/fuel/authors.yml +0 -11
  128. data/test/models/fuel/author_test.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 716908b6931831ce1c0b87d0f101c9751ddcec49
4
- data.tar.gz: 6aae71a34dda5e288f75f00fe147b1f2dbd8d0ed
3
+ metadata.gz: 0505ce01882eba5d7556e4523d72a4ca3d638660
4
+ data.tar.gz: cfc3cf2c44738d67d15876691ba8429fdfb7f97e
5
5
  SHA512:
6
- metadata.gz: 5328b457d779933c1d6f3768212b8d17756016587ceddaee44312bd2525f581aa0c7e5c51ebb109867a87c1b41fdd8a7a474e7eb5b85066c22f40bdc4d3c99c5
7
- data.tar.gz: 4d3e59acfc149e5115705b5ac73e822810ae848926601213ed9bdf463f462238695b354c720d5c18486ca2f72e466b14a75fb83aaf333690b4e5de8563ae0b19
6
+ metadata.gz: 9bd796cc21130dec9b5436d38837350f14698119f17bc81df628976b0d7a6b7776208697be2b15a0ce085a80c0737c23aa96330fbfe16ab6cfc88c62c3f2faeb
7
+ data.tar.gz: b6c13a46b70585a82abd1fdb8628b85db257956dfdb120ecfa836b8708e12ac48c052bbc5d188a092faf6d6ca46bac31bca2b03894c35537c38892d6c3b5fa1a
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
17
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18
18
  load 'rails/tasks/engine.rake'
19
19
 
20
20
 
@@ -20,6 +20,11 @@ body {
20
20
  }
21
21
 
22
22
 
23
+ // Clears
24
+ .margin--clear { margin: 0 }
25
+ .padding--clear { margin: 0 }
26
+
27
+
23
28
  // Hide/Show Classes
24
29
  .mobile--show {
25
30
  display: block;
@@ -18,7 +18,6 @@ $application-icons: image-url('fuel/icons/application-icons.svg');
18
18
  display: inline-block;
19
19
  height: $application-height;
20
20
  width: $application-width;
21
-
22
21
  }
23
22
 
24
23
 
@@ -8,6 +8,11 @@ $card-border: 1px solid $grey-base;
8
8
  $card-border-radius: 3px;
9
9
  $card-padding: 20px;
10
10
 
11
+ $card-fixed-offset: -2px;
12
+ $card-fixed-spread: 0 5px 10px;
13
+ $card-fixed-shadow: rgba(0, 0, 0, 0.25);
14
+ $card-fixed-width: 400px;
15
+
11
16
  // Structure
12
17
  .card {
13
18
  @include rem(padding, $card-padding);
@@ -17,6 +22,15 @@ $card-padding: 20px;
17
22
  overflow: hidden;
18
23
  }
19
24
 
25
+ .card__fixed {
26
+ @include animation(fade-in 0.3s linear);
27
+ @include box-shadow($card-fixed-spread, $card-fixed-shadow);
28
+ @include position(absolute, null null null 100px);
29
+ @include rem(margin-top, $card-fixed-offset);
30
+ @include rem(width, $card-fixed-width);
31
+ z-index: 1000;
32
+ }
33
+
20
34
  .card-image {
21
35
  @include rem(margin, 20px auto);
22
36
  border: $card-border;
@@ -1,84 +1,45 @@
1
+ // Editor Component
2
+ // ========================================
1
3
 
2
- $editor-border: thin solid $grey-base;
3
4
 
4
- #toolbar {
5
+ // Variables
6
+ $editor-background-color: $white-dark;
7
+ $editor-border: 1px solid $grey-base;
8
+ $editor-border-radius: 3px;
9
+ $editor-margin: 0 0 -2px;
10
+
11
+ $editor-button-color: $black-base;
12
+ $editor-button-padding: 5px 12px;
13
+ $editor-button-transition: all 0.2s ease-in-out;
14
+
15
+
16
+ // Structure
17
+ #editor {
5
18
  @include clearfix;
6
- background-color: $white-dark;
19
+ @include position(relative);
20
+ @include rem(margin, $editor-margin);
21
+ background-color: $editor-background-color;
7
22
  border: $editor-border;
8
- border-bottom: none;
23
+ border-top-left-radius: $editor-border-radius;
24
+ border-top-right-radius: $editor-border-radius;
9
25
  padding: 0;
10
- position: relative;
11
- margin: 0;
12
26
  }
13
27
 
14
28
  .editor-button{
15
- @include rem(padding, 5px 12px);
16
- color: $black-base;
29
+ @include rem(padding, $editor-button-padding);
30
+ @include transition($editor-button-transition);
31
+ color: $editor-button-color;
17
32
  display: inline-block;
18
33
  margin: 0;
19
34
 
20
- // &:nth-child(even) {
21
- // border-left: $editor-border;
22
- // border-right: $editor-border;
23
- // }
24
-
25
- &:hover, &.wysihtml5-command-dialog-opened {
26
- cursor: pointer;
27
- color: $blue-base;
35
+ &:nth-child(even) {
36
+ border-left: $editor-border;
37
+ border-right: $editor-border;
28
38
  }
29
39
 
30
- }
31
-
32
- .dropdown-window {
33
- background-color: $white-base;
34
- border: thin solid $grey-dark;
35
- position: absolute;
36
- width: 400px;
37
- }
38
-
39
- .dropdown-body {
40
- padding: 20px;
41
- border-bottom: thin solid $grey-dark;
42
- }
43
-
44
- .dropdown-footer {
45
- background-color: $white-dark;
46
- height: 48px;
47
- padding: 10px 22px;
48
- font-weight: bold;
49
-
50
- a {
40
+ &:hover,
41
+ &.wysihtml5-command-dialog-opened {
51
42
  cursor: pointer;
52
- float: right;
53
- }
54
-
55
- .button {
56
- margin-left: 20px;
57
- margin-bottom: 0px;
58
- }
59
-
60
- }
61
-
62
-
63
- .dropdown--createLink {
64
- left: 100px;
65
- }
66
-
67
- .dropdown--image {
68
- left: 200px;
69
-
70
- label {
71
- margin-top: 20px;
72
- }
73
-
74
- .progress {
75
- max-width: 600px;
76
- margin: 0.2em 0 0.2em 0;
77
- }
78
-
79
- .progress .bar {
80
- @include rem(padding, 5px 10px);
81
- color: white;
82
- display: none;
43
+ color: $blue-base;
83
44
  }
84
45
  }
@@ -11,7 +11,11 @@ label {
11
11
  text-transform: uppercase;
12
12
  }
13
13
 
14
- fieldset { @include rem(margin-bottom, 30px); }
14
+ fieldset {
15
+ @include rem(margin-bottom, 30px);
16
+
17
+ &.small { @include rem(margin-bottom, 15px); }
18
+ }
15
19
 
16
20
  // Inputs
17
21
  #{$all-text-inputs},
@@ -92,4 +96,17 @@ select{
92
96
  a.delete-post {
93
97
  float: right;
94
98
  @include s-golf;
99
+ }
100
+
101
+
102
+ // Progresss Bars
103
+ .progress {
104
+ @include rem(margin, 10px 0);
105
+ width: 100%;
106
+ }
107
+
108
+ .progress .bar {
109
+ @include rem(padding, 5px 10px);
110
+ color: $white-base;
111
+ display: none;
95
112
  }
@@ -28,6 +28,7 @@ $sliding-panel-spread-active: 5px 0 10px;
28
28
  }
29
29
 
30
30
  .sliding-panel-header {
31
+ @include position(relative);
31
32
  @include rem(margin-bottom, 20px);
32
33
  @include rem(padding, 20px);
33
34
  background-color: $sliding-panel-header-background;
@@ -39,9 +40,18 @@ $sliding-panel-spread-active: 5px 0 10px;
39
40
  }
40
41
  }
41
42
 
43
+ .sliding-panel-header--close {
44
+ @include position(absolute, 15px 15px null null);
45
+ @include transform(rotate(45deg));
46
+ }
47
+
42
48
  .sliding-panel-body {
43
49
  margin: 0 auto;
44
50
  width: 65%;
51
+
52
+ img,
53
+ iframe,
54
+ video { width: 100%; }
45
55
  }
46
56
 
47
57
  .sliding-panel-fade-screen {
@@ -11,8 +11,16 @@ module Fuel
11
11
  [first_name, last_name].compact.join(" ")
12
12
  end
13
13
 
14
- has_attached_file :avatar, :styles => { :medium => Fuel.configuration.avatar_settings[:styles][:medium], :thumb => Fuel.configuration.avatar_settings[:styles][:thumb] }, :default_url => "fuel/default-img.jpg"
14
+ if Fuel.configuration.aws_bucket
15
+ has_attached_file :avatar, :styles => { :medium => Fuel.configuration.avatar_settings[:styles][:medium], :thumb => Fuel.configuration.avatar_settings[:styles][:thumb] }, :default_url => "fuel/default-img.jpg", :storage => :s3, :s3_credentials => Proc.new{|a| a.instance.s3_credentials }
16
+ else
17
+ has_attached_file :avatar, :styles => { :medium => Fuel.configuration.avatar_settings[:styles][:medium], :thumb => Fuel.configuration.avatar_settings[:styles][:thumb] }, :default_url => "fuel/default-img.jpg"
18
+ end
19
+
15
20
  validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
16
21
 
22
+ def s3_credentials
23
+ {:bucket => Fuel.configuration.aws_bucket, :access_key_id => Fuel.configuration.aws_access_key, :secret_access_key => Fuel.configuration.aws_secret_access_key}
24
+ end
17
25
  end
18
26
  end
@@ -11,7 +11,11 @@ module Fuel
11
11
  attr_accessible :tag, :author_id, :content, :title, :teaser, :featured_image, :seo_title, :seo_description, :published_at
12
12
  end
13
13
 
14
- has_attached_file :featured_image, :styles => { :medium => Fuel.configuration.featured_image_settings[:styles][:medium], :thumb => Fuel.configuration.featured_image_settings[:styles][:thumb] }, :default_url => "fuel/default-img.jpg", :storage => :s3, :s3_credentials => Proc.new{|a| a.instance.s3_credentials }
14
+ if Fuel.configuration.aws_bucket
15
+ has_attached_file :featured_image, :styles => { :medium => Fuel.configuration.featured_image_settings[:styles][:medium], :thumb => Fuel.configuration.featured_image_settings[:styles][:thumb] }, :default_url => "fuel/default-img.jpg", :storage => :s3, :s3_credentials => Proc.new{|a| a.instance.s3_credentials }
16
+ else
17
+ has_attached_file :featured_image, :styles => { :medium => Fuel.configuration.featured_image_settings[:styles][:medium], :thumb => Fuel.configuration.featured_image_settings[:styles][:thumb] }, :default_url => "fuel/default-img.jpg"
18
+ end
15
19
  validates_attachment_content_type :featured_image, :content_type => /\Aimage\/.*\Z/
16
20
 
17
21
  validates_presence_of :title, :content, :author_id, if: :is_published
@@ -4,7 +4,7 @@
4
4
 
5
5
  if ($("body").hasClass("posts-controller")){
6
6
  var editor = new wysihtml5.Editor("fuel_post_content", { // id of textarea element
7
- toolbar: "toolbar", // id of toolbar element
7
+ toolbar: "editor", // id of toolbar element
8
8
  parserRules: wysihtml5ParserRules,
9
9
  stylesheets: "<%= stylesheet_path('fuel/wysihtml') %>"
10
10
  });
@@ -38,9 +38,8 @@
38
38
  submitButton.prop('disabled', true);
39
39
 
40
40
  progressBar.
41
- css('background', 'green').
41
+ css('background', '#C4DC6E').
42
42
  css('display', 'block').
43
- css('width', '0%').
44
43
  text("Loading...");
45
44
  },
46
45
  done: function(e, data) {
@@ -60,7 +59,7 @@
60
59
  submitButton.prop('disabled', false);
61
60
 
62
61
  progressBar.
63
- css("background", "red").
62
+ css("background", "#F7917C").
64
63
  text("Failed");
65
64
  }
66
65
  });
@@ -47,7 +47,7 @@
47
47
  <div class="form-container--full">
48
48
  <fieldset>
49
49
  <%= f.label :content, 'Your Post' %>
50
- <ul id="toolbar" style="display: none;">
50
+ <ul id="editor" style="display: none;">
51
51
  <li class="editor-button" data-wysihtml5-command="bold" title="CTRL+B"><i class="fa fa-bold"></i></li>
52
52
  <li class="editor-button" data-wysihtml5-command="italic" title="CTRL+I"><i class="fa fa-italic"></i></li>
53
53
  <li class="editor-button" data-wysihtml5-command="insertUnorderedList"><i class="fa fa-list-ul"></i></li>
@@ -61,25 +61,26 @@
61
61
  <li class="editor-button" data-wysihtml5-command="undo"><i class="fa fa-undo"></i></li>
62
62
  <li class="editor-button" data-wysihtml5-action="change_view">HTML</li>
63
63
 
64
- <div data-wysihtml5-dialog="createLink" style="display: none;" class="dropdown-window dropdown--createLink">
65
- <div class="dropdown-body">
64
+ <div data-wysihtml5-dialog="createLink" style="display: none;" class="card card__fixed">
65
+ <fieldset class="small">
66
+ <label>Link URL:</label>
66
67
  <input data-wysihtml5-dialog-field="href" value="http://">
67
- </div>
68
- <footer class="dropdown-footer">
69
- <a data-wysihtml5-dialog-action="save" class="save-link button button--primary button--small">Insert</a>
70
- </footer>
68
+ </fieldset>
69
+ <fieldset class="margin--clear right">
70
+ <a data-wysihtml5-dialog-action="save" class="save-link button button--primary button--small margin--clear">Insert</a>
71
+ </fieldset>
71
72
  </div>
72
73
 
73
- <div data-wysihtml5-dialog="insertImage" style="display: none;" class="dropdown-window dropdown--image">
74
- <div class="dropdown-body">
75
- <label>
76
- Upload Image:
77
- <%= file_field_tag :image, id: "image-upload", class: "directUpload" %>
78
- </label>
79
- <label>
80
- Image URL:
81
- <input data-wysihtml5-dialog-field="src" value="http://" id="imageUrl">
82
- </label>
74
+ <div data-wysihtml5-dialog="insertImage" style="display: none;" class="card card__fixed">
75
+ <fieldset class="small">
76
+ <div class="half-group">
77
+ <label> Upload Image: <%= file_field_tag :image, id: "image-upload", class: "directUpload" %> </label>
78
+ </div>
79
+ <div class="half-group">
80
+ <label> Or Image URL: <input data-wysihtml5-dialog-field="src" value="http://" id="imageUrl"> </label>
81
+ </div>
82
+ </fieldset>
83
+ <fieldset class="small">
83
84
  <label>
84
85
  Align:
85
86
  <select data-wysihtml5-dialog-field="className">
@@ -88,11 +89,11 @@
88
89
  <option value="wysiwyg-float-right">right</option>
89
90
  </select>
90
91
  </label>
91
- </div>
92
- <footer class="dropdown-footer">
93
- <a data-wysihtml5-dialog-action="save" class="save-link button button--primary button--small">Insert</a>
94
- <a data-wysihtml5-dialog-action="cancel" class="button button--danger button--small">Cancel</a>
95
- </footer>
92
+ </fieldset>
93
+ <fieldset class="right margin--clear">
94
+ <a data-wysihtml5-dialog-action="save" class="save-link button button--primary button--small margin--clear">Insert</a>
95
+ <a data-wysihtml5-dialog-action="cancel" class="button button--danger button--small margin--clear">Cancel</a>
96
+ </fieldset>
96
97
  </div>
97
98
  </ul>
98
99
  <%= f.text_area :content, class: 'post' %>
@@ -1,9 +1,9 @@
1
- <%#= form_tag('preview', method: "post", id: "preview_form") do %>
2
- <%#= hidden_field_tag :content %>
3
- <%# end %>
4
1
  <div class="js-menu sliding-panel-content">
5
2
  <header class="sliding-panel-header">
6
- <h5 class="inverse title">You are currently previewing this post.</h5>
3
+ <h5 class="inverse title">You are currently previewing this post</h5>
4
+ <%= link_to '#', class: "js-menu-trigger" do %>
5
+ <i class="add-icon sliding-panel-header--close"></i>
6
+ <% end %>
7
7
  </header>
8
8
  <div class="sliding-panel-body">
9
9
  <%= render 'content', content: @post.content %>
data/lib/fuel/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fuel
2
- VERSION = "0.3.27"
2
+ VERSION = "0.3.28"
3
3
  end
@@ -0,0 +1,133 @@
1
+ require 'spec_helper'
2
+
3
+ describe Fuel::Admin::PostsController do
4
+
5
+ routes { Fuel::Engine.routes }
6
+
7
+ before(:each) do
8
+ credentials = ActionController::HttpAuthentication::Basic.encode_credentials Fuel.configuration.username, Fuel.configuration.password
9
+ request.env['HTTP_AUTHORIZATION'] = credentials
10
+ end
11
+
12
+ describe 'GET #index' do
13
+ it "populates an array of posts" do
14
+ get :index
15
+ expect(assigns(:posts).count).to eq(Post.count)
16
+ end
17
+ it "renders the :index view" do
18
+ get :index
19
+ expect(response).to render_template(:index)
20
+ end
21
+ end
22
+
23
+ describe 'GET #new' do
24
+ it "it assigns a new Post to @post" do
25
+ get :new
26
+ expect(assigns(:post)).to be_a_new(Post)
27
+ end
28
+ it "renders the :new view" do
29
+ get :new
30
+ expect(response).to render_template(:new)
31
+ end
32
+ end
33
+
34
+ describe 'GET #edit' do
35
+ before(:each) do
36
+ @post = create(:post)
37
+ end
38
+ it "assigns the requested post to @post" do
39
+ get :edit, id: @post
40
+ expect(assigns(:post)).to eq(@post)
41
+ end
42
+
43
+ it "renders the :edit template" do
44
+ get :edit, id: @post
45
+ expect(response).to render_template(:edit)
46
+ end
47
+ end
48
+
49
+ describe 'POST #create' do
50
+ context "with valid attributes" do
51
+ before(:each) do
52
+ @original_count = Post.count
53
+ post :create, post: attributes_for(:post)
54
+ end
55
+ it "saves the new post in the database" do
56
+ new_count = Post.count
57
+ expect(new_count - @original_count).to eq(1)
58
+ end
59
+ it "redirects to the show page" do
60
+ expect(response).to redirect_to(fuel.admin_posts_path)
61
+ end
62
+ end
63
+ context "with invalid attributes" do
64
+ before(:each) do
65
+ @original_count = Post.count
66
+ post :create, post: attributes_for(:invalid_post)
67
+ end
68
+ it "does not save the new post in the database" do
69
+ new_count = Post.count
70
+ expect(new_count - @original_count).to eq(0)
71
+ end
72
+ it "re-renders the :new template" do
73
+ expect(response).to render_template(:new)
74
+ end
75
+ end
76
+ end
77
+
78
+ describe 'PUT #update' do
79
+ before(:each) do
80
+ @post = create(:post)
81
+ end
82
+ context "with valid attributes" do
83
+ it "updates the post in the database" do
84
+ test_title = "Is this thing on?"
85
+ put :update, id: @post, post: attributes_for(:post, title: test_title)
86
+ @post.reload
87
+ expect(@post.title).to eq(test_title)
88
+ end
89
+ it "redirects to the post" do
90
+ put :update, id: @post, post: attributes_for(:post)
91
+ expect(response).to redirect_to(fuel.admin_posts_path)
92
+ end
93
+ end
94
+ context "with invalid attributes" do
95
+ it "does not update the post" do
96
+ author = "Tom Cullen"
97
+ put :update, id: @post, post: attributes_for(:post, title: nil, author: author)
98
+ @post.reload
99
+ expect(@post.author).to_not eq(author)
100
+ end
101
+ it "re-renders the #edit template" do
102
+ put :update, id: @post, post: attributes_for(:post, title: nil)
103
+ expect(response).to render_template(:edit)
104
+ end
105
+ end
106
+ end
107
+
108
+ describe 'DELETE #destroy' do
109
+ before(:each) do
110
+ @post = create(:post)
111
+ end
112
+ it "deletes the posts" do
113
+ original_count = Post.count
114
+ delete :destroy, id: @post
115
+ new_count = Post.count
116
+ expect(original_count - new_count).to eq(1)
117
+ end
118
+ it "redirects to admin/posts#index" do
119
+ delete :destroy, id: @post
120
+ expect(response).to redirect_to(fuel.admin_posts_path)
121
+ end
122
+ end
123
+
124
+ end
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+