Skip to content

Commit

Permalink
Contents page redisign
Browse files Browse the repository at this point in the history
  • Loading branch information
arugin authored and arugin committed Dec 3, 2013
1 parent 9bb5d60 commit 9b92aa4
Show file tree
Hide file tree
Showing 25 changed files with 89 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ h4.random-news{
padding-left: 0px;
}

#index-contents{
@extend #articles;
}

#users{
@extend #articles;
}
Expand Down
14 changes: 7 additions & 7 deletions app/assets/stylesheets/articles.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.article-wrapper{
.item-wrapper{
border-radius: 9px;
background: #eee;
padding: 4px;
margin-bottom: 20px;
clear: both;
.article-card{
.item-card{
overflow: hidden;
border-radius: 6px;
border: 1px solid #ddd;
position: relative;
background-color: #fff;
padding: 5px;
height: 390px;
.article-thumb {
.item-thumb {
width: 212px;
height: 150px;
margin: 0;
Expand Down Expand Up @@ -61,7 +61,7 @@
padding-top: 2px;
}
}
.article-meta{
.item-meta{
list-style: none;
width: 190px;
bottom: 68px;
Expand All @@ -71,7 +71,7 @@
font-size: 11px;
}
}
ul.article-stats{
ul.item-stats{
margin: 0;
padding: 0;
border: 0;
Expand All @@ -95,7 +95,7 @@
}
}
}
ul.articles-card-list{
ul.items-card-list{
width: 760px;
background: #fff;
list-style: none;
Expand All @@ -104,7 +104,7 @@ ul.articles-card-list{
z-index: 2;
display: block;
float: left;
li.article{
li.item{
display: inline;
float: left;
margin-left: 10px;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/controllers/contents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def approve
end
#TODO: move to model
def index
@contents = Content::BaseContent.search_for(current_user,params).where(approved_to_news: true, reviewed: true).page(params[:page]).per(10)
@contents = Content::BaseContent.search_for(current_user,params).where(approved_to_news: true, reviewed: true).page(params[:page]).per(9)
end

def create
Expand Down
6 changes: 6 additions & 0 deletions app/models/content/base_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class BaseContent
include Concerns::Ownerable
include Concerns::Taggable
include Mongo::Voteable
include ActionView::Helpers::TextHelper

is_impressionable counter_cache: true, :unique => :ip_address

Expand Down Expand Up @@ -38,6 +39,8 @@ class BaseContent
search_for(user,params).where(reviewed: false)
}

alias :content :description

voteable self, :up => +1, :down => -1

def youtube_or_vimeo_url
Expand All @@ -46,6 +49,9 @@ def youtube_or_vimeo_url
errors.add(:src, :invalid)
end

def tiny_content
strip_tags self.description
end

end
end
4 changes: 2 additions & 2 deletions app/views/articles/_article_block.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
= article.cycle.correct_title
%span.divider /
= link_to article_path(article), itemprop:"url" do
%span= title article.title
%span{itemprop:"name"}= title article.title
.news-user-avatar
- if article.author.avatar.nil?
= image_tag("/images/main/profile/stub-user-middle.gif", :title => "user avatar")
Expand All @@ -20,7 +20,7 @@
%span{itemprop:'name'}
= article.author.name
.publishDate
%span{itemprop:'datePublished',content:article.created_at}
%span{itemprop:'datePublished', content:article.created_at}
= l article.created_at.in_time_zone, format: :short
.clear
.views
Expand Down
32 changes: 0 additions & 32 deletions app/views/articles/_article_cool_block.html.haml

This file was deleted.

20 changes: 7 additions & 13 deletions app/views/articles/_article_short_block.html.haml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
.row-fluid{itemscope:true, itemtype:'http://schema.org/Article'}
.row-fluid
%h4
- if article.is_garbage
= link_to draft_article_path(article) do
%span= article.title
- else
= link_to article_path(article) do
%span= article.title
= render partial: 'title', locals: {item: article}
.author
= link_to user_profile_path(article.author) do
%span{itemprop:'author', itemscope:true, itemtype:'http://schema.org/Person'}
%span{itemprop:'name'}
= article.author.name
%span
= article.author.name
.publishDate
%span{itemprop:'datePublished',content:article.created_at}
%span
= l article.created_at.in_time_zone, format: :short
.clear
.description{itemprop:'articleBody'}
.description
- unless article.content.nil?
= article.short_content.html_safe
- else
Expand All @@ -27,5 +21,5 @@
= link_to article_path(article) do
=t 'READ_MORE'
.more-info
= link_to article_path(article), itemprop:"url" do
= link_to article_path(article) do
=t 'COMMENTS', count: article.comments.size, comment: Russian::pluralize(article.comments.size, 'комментарий','комментария','комментариев')
12 changes: 6 additions & 6 deletions app/views/articles/_article_tiny_block.html.haml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
.row-fluid{itemscope:true, itemtype:'http://schema.org/Article'}
.row-fluid
%h4.random-news
= link_to article_path(article) do
%span= article.title
.author
= link_to user_profile_path(article.author) do
%span{itemprop:'author', itemscope:true, itemtype:'http://schema.org/Person'}
%span{itemprop:'name'}
%span
%span
= article.author.name
.publishDate
%span{itemprop:'datePublished',content:article.created_at}
%span
= l article.created_at.in_time_zone, format: :short
.clear
.description{itemprop:'articleBody'}
.description
- unless article.content.nil?
%p
= article.tiny_content
Expand All @@ -20,5 +20,5 @@
= link_to article_path(article) do
=t 'READ_MORE'
.more-info
= link_to article_path(article), itemprop:"url" do
= link_to article_path(article) do
=t 'COMMENTS', count: article.comments.size, comment: Russian::pluralize(article.comments.size, 'комментарий','комментария','комментариев')
6 changes: 3 additions & 3 deletions app/views/articles/_index_articles_block.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
- if @articles.blank?
%p= t("NO_ARTICLES_FOUND")
- else
%ul.articles-card-list
%ul.items-card-list
- @articles.each do |article|
%li.article
= render :partial => 'article_cool_block', :locals => { :article => article }
%li.item
= render :partial => 'common/cool_block', locals: { item: article, collection: 'articles' }

= paginate @articles, :remote => true
2 changes: 2 additions & 0 deletions app/views/articles/_thumb.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
= link_to article_path(item) do
= image_tag(item.get_logo_url.nil? ? '/images/common/filer.png': item.get_logo_url, title: item.title)
6 changes: 6 additions & 0 deletions app/views/articles/_title.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- if item.is_garbage
= link_to draft_article_path(item) do
%strong= item.title
- else
= link_to article_path(item) do
%strong= item.title
2 changes: 2 additions & 0 deletions app/views/articles/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- keywords "киноиндустрия статьи, статьи про кино, режиссура, актерское мастерство, операторское дело, сценарное мастерство, как попасть в киноиндустрию"
- description "unbe - независимое творческое сообщество, цель которого - сделать систему кинопроизводства в России открытой, а также поднять уровень компетенции и качество работ и роликов на новый уровень"
.row-fluid
.span4
- unless @article_area.nil?
Expand Down
2 changes: 2 additions & 0 deletions app/views/articles/news.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- keywords "новости кино, новости сериалов, киноиндустрия статьи, новости сообщества unbe, статьи про кино"
- description "unbe - независимое творческое сообщество, цель которого - сделать систему кинопроизводства в России открытой, а также поднять уровень компетенции и качество работ и роликов на новый уровень"
.row-fluid
.span4
%h4.section=title 'Новости'
Expand Down
27 changes: 27 additions & 0 deletions app/views/common/_cool_block.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.item-wrapper
.item-card
.item-thumb
= render partial: "#{collection}/thumb", locals: {item: item}
%h4
= render partial: "#{collection}/title", locals: {item: item}
%span
= link_to user_profile_path(item.author) do
= "от автора #{item.author.name}"
.clear
- unless item.content.nil?
%p
= item.tiny_content.html_safe
%ul.item-meta
%li.publishDate
%span
%i.icon-leaf{title: t(:PUBLISH_FULL)}
= item.created_at.nil? ? 'До начала времен': l(item.created_at.in_time_zone, format: :short)

%ul.item-stats
%li.long
= render partial: 'common/views_count', locals: {subject: item, growth: true}
%li.views-wrapper
= render partial: 'common/comments_count', locals: {subject: item}
%li.floated-vote
= render partial: 'common/rate_count', locals: {subject: item}

1 change: 1 addition & 0 deletions app/views/contents/_content_block.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- keywords content.tag_list
- description content.tiny_content
.row-fluid
%h4
= link_to gallery_path(content.contentable) do
Expand Down
21 changes: 0 additions & 21 deletions app/views/contents/_content_short_block.html.haml

This file was deleted.

6 changes: 4 additions & 2 deletions app/views/contents/_contents_short_block.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
- if @contents.blank?
%p= t("NO_CONTENTS_FOUND")
- else
- @contents.each do |content|
= render :partial => 'content_short_block', :locals => { :content => content }
%ul.items-card-list
- @contents.each do |content|
%li.item
= render :partial => 'common/cool_block', locals: { item: content, collection: 'contents' }

= paginate @contents, :remote => true

Expand Down
2 changes: 2 additions & 0 deletions app/views/contents/_thumb.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.fotorama{data:{width:'210px',ratio:"800/600", keyboard: 'true'}}
%a{href: item.src}
2 changes: 2 additions & 0 deletions app/views/contents/_title.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
= link_to content_base_content_path(item) do
%strong= item.title
2 changes: 2 additions & 0 deletions app/views/contents/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- keywords "опубликовать ролик, опубликовать видеоролик, раскрутить видео, поделиться своей работой, обсудить свою работу"
- description "На unbe вы можете поделиться своими видео работами и роликами, получить конструктивную критику и помощь в выполнении своих работ"
.row-fluid
.span4
%h4.section=title 'Работы'
Expand Down
2 changes: 2 additions & 0 deletions app/views/projects/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- keywords "реализовать свой видеопроект, найти людей на свой проект, найти единомышленников в кино, найти режиссера, найти оператора, найти сценариста"
- description "На unbe, в будущем, вы можете создать свой проект и привлечь к его реализации заинтересованных людей и единомышленников, которым интересна индустрия кино"
%h4.section= title 'Проекты'
%br
.projects
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module MySite
class Application
VERSION = "1.0.2"
VERSION = "1.0.3"

def self.version
"v. #{VERSION}"
Expand Down

0 comments on commit 9b92aa4

Please sign in to comment.