Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Articles#index implemented to show list of blog entries

  • Loading branch information...
commit f96d6c16f60defe1cabaddbd13aff750bb5cd9d4 1 parent 1bc01d4
@naleksi naleksi authored
View
48 app/assets/stylesheets/articles.css.scss
@@ -1,3 +1,51 @@
// Place all the styles related to the Articles controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
+
+.blogs .blog .info .author {
+ font-weight: bold;
+ color: #29abe2;
+ text-transform: uppercase;
+}
+
+.blogs .blog .info .date {
+ margin-left: 15px;
+}
+
+.blogs .blog .info h2 a {
+ color: black;
+ text-decoration: none;
+ text-transform: none;
+}
+
+.author a{
+ font-weight: bold;
+ color: #29abe2;
+ text-transform: uppercase;
+}
+.author a:hover {
+ text-decoration: underline;
+}
+.author a:link {
+ text-decoration: none;
+}
+.author a:visited {
+ text-decoration: none;
+}
+
+.blogs > .blog > .content a{
+ color: black;
+}
+.blogs > .blog > .content a:hover {
+ text-decoration: underline;
+}
+.blogs > .blog > .content a:link {
+ text-decoration: none;
+}
+.blogs > .blog > .content a:visited {
+ text-decoration: none;
+}
+
+.blog {
+ margin-bottom: 50px;
+}
View
15 app/assets/stylesheets/typography.css.scss
@@ -162,3 +162,18 @@ input[type=submit], a.button {
font-family: $sans_serif;
}
+.news .news-item .datetime {
+ font-family: $sans_serif;
+ text-transform: uppercase;
+}
+
+.blogs .blog .info h2 a {
+ font-size: 24px;
+ font-family: $serif;
+}
+
+.blogs > .blog > .content {
+ font-size: 16px;
+ font-family: $serif;
+}
+
View
5 app/controllers/articles_controller.rb
@@ -3,6 +3,11 @@ class ArticlesController < ApplicationController
respond_to :html
+ def index
+ @published_blogs = Article.published.where(article_type: "blog").order("created_at DESC")
+ @blogs = @published_blogs.paginate(page: params[:page], per_page: 30)
+ end
+
def show
@article = Article.find(params[:id])
Please sign in to comment.
Something went wrong with that request. Please try again.