diff --git a/app/assets/stylesheets/components/_tables.scss b/app/assets/stylesheets/components/_tables.scss index 35eef7c..4213b22 100644 --- a/app/assets/stylesheets/components/_tables.scss +++ b/app/assets/stylesheets/components/_tables.scss @@ -25,6 +25,11 @@ tr, td, th { vertical-align: middle; } +/* + Striped Tables +*/ + + table.striped > tbody { > tr { td:first-child, @@ -39,7 +44,7 @@ table.striped > tbody { } > tr:nth-child(2n) td { - background-color: transparentize($light-blue, 0.8); + background-color: transparentize($light-blue, 0.9); } .actions { diff --git a/app/assets/stylesheets/layout/_body.scss b/app/assets/stylesheets/layout/_body.scss index e596cce..7db6d4f 100644 --- a/app/assets/stylesheets/layout/_body.scss +++ b/app/assets/stylesheets/layout/_body.scss @@ -47,10 +47,13 @@ body#tinymce { box-shadow: $content-shadow; background: white; padding: 20px; -} -#main_nobody { - @include span-columns(9 of 12); + &.no-body { + box-shadow: none; + border-radius: 0; + background: transparent; + padding: 0; + } } #sidebar { diff --git a/app/assets/stylesheets/pages/_forums.scss b/app/assets/stylesheets/pages/_forums.scss index bf59dfd..f3195bf 100644 --- a/app/assets/stylesheets/pages/_forums.scss +++ b/app/assets/stylesheets/pages/_forums.scss @@ -120,8 +120,9 @@ div#categories { @include span-columns(12); padding: 20px; margin-bottom: 20px; - background: transparentize($light-gray, 0.5); + background: transparentize($light-gray, 0.75); border-radius: 5px; + box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.2); &:last-child { margin-bottom: 40px; diff --git a/app/assets/stylesheets/pages/_news.scss b/app/assets/stylesheets/pages/_news.scss index 31ef3a2..70d5430 100644 --- a/app/assets/stylesheets/pages/_news.scss +++ b/app/assets/stylesheets/pages/_news.scss @@ -45,11 +45,13 @@ div.article { } &.preview { + @include span-columns(12); border-radius: $base-border-radius; background: white; padding: 20px; margin-bottom: 20px; box-shadow: $light-shadow; + border: 0; .content { margin-bottom: 10px; diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index d36f11d..d0509e3 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -8,7 +8,6 @@ class ArticlesController < ApplicationController def news_index @news = Article.with_comments.ordered.nodrafts.onlynews.limit(10) @categories = Category.ordered.domain(Category::DOMAIN_NEWS) - @nobody = true end def news_archive diff --git a/app/helpers/articles_helper.rb b/app/helpers/articles_helper.rb new file mode 100644 index 0000000..105f8c5 --- /dev/null +++ b/app/helpers/articles_helper.rb @@ -0,0 +1,12 @@ +module ArticlesHelper + def preview_text(article, full) + if article.text_coding == Article::CODING_HTML + content = article.text.html_safe + else + content = article.text_parsed.html_safe + end + + content = truncate(raw(strip_tags(content)), length: 200) if !full + content + end +end diff --git a/app/views/articles/_article.html.erb b/app/views/articles/_article.html.erb index 05a24f0..57df68a 100644 --- a/app/views/articles/_article.html.erb +++ b/app/views/articles/_article.html.erb @@ -13,12 +13,6 @@ <%= namelink(article.user) %> on <%= longtime article.created_at %> -