Skip to content

Commit a2a6ba5

Browse files
committed
Recently Added Herbs now displayed on home page
1 parent 7dc4aca commit a2a6ba5

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

app/assets/scss_frontend/4_custom.scss

+9
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@
7474
text-align: center;
7575
}
7676
}
77+
78+
.herbLIST {
79+
@include card1;
80+
padding: 15px;
81+
background: rgba(255, 255, 255, 0.95);
82+
.herbITEM {
83+
margin-bottom: 0;
84+
}
85+
}
7786
}
7887

7988
//////////////////////////////////////////////////////////////// Herb Show Page

app/controllers/herbs_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class HerbsController < ApplicationController
22
def index
33
@categories = Category.all
44
@herbs = Herb.all
5-
@recentlyAddedHerbs = Herb.last(6).reverse
5+
@recentlyAddedHerbs = Herb.where.not(draft_status: 'draft').last(3).reverse
66
end
77

88
def show

app/views/herbs/index.html.haml

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
%img{src: "#{public_path}/images/logo.png", alt: 'Company logo'}
88
%h6 An encyclopedia of the world's plant medicines
99
%p Here we aim to describe herbs and plants that have beneficial medicinal properties, focusing primarily on modern scientific investigations. We strive to provide accurate dosage information for ingestion methods such as teas, tinctures, and capsules.
10+
= render 'shared/recentlyAddedHerbs'
1011
.backdropIMG

gulpfile.js

+21
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ var config = {
2323
videoDestPath: './public/videos/'
2424
}
2525

26+
// var cache = function(name) {
27+
// return through.obj(function(file, enc, cb) {
28+
// log(+ new Date());
29+
// this.push(file); // We'll just pass this file along
30+
//
31+
// fs.stat(config.manifestPath, function(err) {
32+
// if (err == null) {
33+
// var json = JSON.parse(fs.readFileSync(config.manifestPath)),
34+
// oldFileName = json[name];
35+
// log(colors.red('DELETING'), oldFileName);
36+
// fs.unlink(config.publicPath + oldFileName, function(err) {
37+
// // TODO: emit an error if err
38+
// cb();
39+
// });
40+
// } else {
41+
// return cb(); // Nothing to remove :)
42+
// }
43+
// });
44+
// });
45+
// };
46+
2647
// Compiles Frontend SCSS in [assets/scss_frontend]
2748
gulp.task('scss_frontend', function() {
2849
return gulp.src([

public/frontend.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)