From 29f4ec7246ee1aa713ba5d158c7b854e9071864f Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Wed, 9 Apr 2014 01:50:07 +0100 Subject: [PATCH] Cleans up articles, comments and widget styling --- app/assets/stylesheets/application.css.scss | 1 + .../stylesheets/components/_comments.scss | 21 ++++ app/assets/stylesheets/components/_forms.scss | 10 +- app/assets/stylesheets/layout/_body.scss | 2 +- app/assets/stylesheets/layout/_sidebar.scss | 56 +++++++++- app/assets/stylesheets/pages/_news.scss | 31 ++++++ app/views/articles/_article.html.erb | 10 +- app/views/comments/_index.html.erb | 5 +- app/views/comments/_new.html.erb | 18 ++-- app/views/polls/_show.html.erb | 34 +++--- app/views/shoutmsgs/_new.html.erb | 8 +- app/views/widgets/_highlights.html.erb | 99 +++++++++--------- app/views/widgets/_poll.html.erb | 9 +- app/views/widgets/_posts.html.erb | 39 ++++--- app/views/widgets/_shoutbox.html.erb | 6 +- public/images/icons/poll.png | Bin 3920 -> 0 bytes 16 files changed, 225 insertions(+), 124 deletions(-) create mode 100644 app/assets/stylesheets/pages/_news.scss delete mode 100644 public/images/icons/poll.png diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index eab3368..4484d7e 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -40,4 +40,5 @@ Pages */ +@import "pages/news"; @import "pages/contests"; diff --git a/app/assets/stylesheets/components/_comments.scss b/app/assets/stylesheets/components/_comments.scss index 4297c16..1f1c6a2 100644 --- a/app/assets/stylesheets/components/_comments.scss +++ b/app/assets/stylesheets/components/_comments.scss @@ -1,3 +1,24 @@ +#comments { + @include span-columns(12); + + h3 { + margin: 1em 0; + } + + .comment-form { + @include span-columns(12); + margin-bottom: em(20); + + h3 { + margin-top: 0; + } + + .fields { + margin-bottom: em(20); + } + } +} + .comment { $comment-gutter: 1.4em; $comment-image-padding: .7em; diff --git a/app/assets/stylesheets/components/_forms.scss b/app/assets/stylesheets/components/_forms.scss index 12ac11b..fc04b13 100644 --- a/app/assets/stylesheets/components/_forms.scss +++ b/app/assets/stylesheets/components/_forms.scss @@ -12,7 +12,8 @@ form { > .field_with_errors { - input { + input, + textarea { border: $input-border-width solid $flash-error; &:hover, @@ -26,7 +27,8 @@ form { } } - input { + input, + textarea { background-color: $input-primary; color: $input-text; font-size: em(16); @@ -36,10 +38,12 @@ form { &:hover { border: $input-border-width solid lighten($input-secondary, 20%); + padding: $input-padding ($input-padding - $input-border-width); } &:focus { border: $input-border-width solid $input-secondary; + padding: $input-padding ($input-padding - $input-border-width); color: $input-secondary; outline: none; background: transparent; @@ -68,10 +72,12 @@ form.dark { &:hover { border: $input-dark-border-width solid $input-dark-border-hover-colour; + padding: $input-padding ($input-padding - $input-dark-border-width); } &:focus { border: $input-dark-border-width solid $input-dark-border-focus-colour; + padding: $input-padding ($input-padding - $input-dark-border-width); } &:-webkit-autofill { diff --git a/app/assets/stylesheets/layout/_body.scss b/app/assets/stylesheets/layout/_body.scss index 584c8fe..68a1117 100644 --- a/app/assets/stylesheets/layout/_body.scss +++ b/app/assets/stylesheets/layout/_body.scss @@ -37,4 +37,4 @@ img.flag { display: inline-block; vertical-align: - em(6); margin-right: em(10); -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/layout/_sidebar.scss b/app/assets/stylesheets/layout/_sidebar.scss index 1f6b5a1..1e0df86 100644 --- a/app/assets/stylesheets/layout/_sidebar.scss +++ b/app/assets/stylesheets/layout/_sidebar.scss @@ -1,6 +1,7 @@ #sidebar { .widget { + @include span-columns(12); margin-bottom: em(20); padding: em(20); background: $light-gray; @@ -10,13 +11,9 @@ } .widget-content-wrapper { + @include span-columns(12); font-size: em(14); } - } - - .calendar { - max-height: 500px; - overflow-x: scroll; .separator { color: white; @@ -26,4 +23,53 @@ margin-bottom: em(12); } } + + .calendar { + max-height: 500px; + overflow-x: scroll; + } + + .shoutbox { + .transcript { + margin-bottom: 20px; + } + + input { + @include span-columns(12); + margin-bottom: em(10); + } + } + + .highlights, + .posts { + + ol { + margin-bottom: em(20); + + &:last-child { + margin-bottom: 0; + } + } + } + + .poll { + .question { + @include span-columns(12); + margin-bottom: em(20); + + h5 { + margin-bottom: 1em; + } + } + + .bar { + display: block; + background: $green; + height: 10px; + } + + .button { + margin-bottom: 0; + } + } } \ No newline at end of file diff --git a/app/assets/stylesheets/pages/_news.scss b/app/assets/stylesheets/pages/_news.scss new file mode 100644 index 0000000..ce00f6b --- /dev/null +++ b/app/assets/stylesheets/pages/_news.scss @@ -0,0 +1,31 @@ +div.article { + @include span-columns(12); + border-bottom: 1px solid rgba(35, 35, 35, 0.1); + padding-bottom: em(20); + + h1 { + margin: 1em 0; + } + + .content { + @include span-columns(12); + margin-bottom: em(20); + } + + .author { + @include span-columns(6); + } + + .actions { + @include span-columns(6); + @include omega; + text-align: right; + } + + &:first-child { + + h1 { + margin-top: 0; + } + } +} \ No newline at end of file diff --git a/app/views/articles/_article.html.erb b/app/views/articles/_article.html.erb index 46fecbd..41cc1dc 100644 --- a/app/views/articles/_article.html.erb +++ b/app/views/articles/_article.html.erb @@ -1,7 +1,7 @@ -
+

<%= namelink article %>

-
+
<% if article.text_coding == Article::CODING_HTML %> <%= article.text.html_safe %> <% else %> @@ -9,9 +9,9 @@ <% end %>
-

- <%= namelink article.user %> on <%= longtime article.created_at %> -

+
+ <%= flag(article.user.country) %> <%= namelink(article.user) %> on <%= longtime article.created_at %> +
<% if article.can_update? cuser %> diff --git a/app/views/comments/_index.html.erb b/app/views/comments/_index.html.erb index da480a4..5b03f74 100644 --- a/app/views/comments/_index.html.erb +++ b/app/views/comments/_index.html.erb @@ -1,6 +1,5 @@ -
+

Comments

<%= render partial: "comments/comment", collection: @comments %> + <%= render partial: "comments/new" %>
- -<%= render partial: "comments/new" %> diff --git a/app/views/comments/_new.html.erb b/app/views/comments/_new.html.erb index ea0eebb..f8f3d86 100644 --- a/app/views/comments/_new.html.erb +++ b/app/views/comments/_new.html.erb @@ -1,10 +1,8 @@ -
-

- New comment -

+
+

New comment

<% if cuser %> - <%= form_for(@comment, :remote => true) do |f| %> + <%= form_for(@comment, remote: true) do |f| %>
    <% @comment.errors.full_messages.each do |msg| %>
  • <%= msg %>
  • @@ -12,12 +10,12 @@
<%= f.hidden_field :commentable_id %> <%= f.hidden_field :commentable_type %> -

- <%= f.text_area :text, :rows => 5, :cols => 40, :id => "textArea" %> -

-

+

+ <%= f.text_area :text, rows: 5, cols: 40, id: "textArea" %> +
+
<%= f.submit 'Post Comment' %> -

+
<% end %> <% else %> Please log in or <%= link_to "register", new_user_path %> to post comments. diff --git a/app/views/polls/_show.html.erb b/app/views/polls/_show.html.erb index d1fa55c..273e90d 100644 --- a/app/views/polls/_show.html.erb +++ b/app/views/polls/_show.html.erb @@ -1,19 +1,21 @@ -
<%= @poll.question %>
+
+
+
<%= @poll.question %>
-
- <% @poll.options.all.each do |opt| %> -

- <% if cuser and !@poll.voted?(cuser) %> - <%= link_to (h opt), :controller => "votes", :action => "create", :vote => {:votable_id => opt.id, :votable_type => "Option"} %> - <% else %> - <%= opt.option %>
- <% end %> - <% if opt.votes > 0 %> - <%= image_tag "/images/icons/poll.png", :class => "bar", :height => 6, :width => opt.votes*100/@poll.votes %> - <% end %> - <%= opt.votes %> -

- <% end %> + <% @poll.options.all.each do |opt| %> +

+ <% if cuser and !@poll.voted?(cuser) %> + <%= link_to (h opt), controller: "votes", action: "create", vote: { votable_id: opt.id, votable_type: "Option" } %> + <% else %> + <%= opt.option %>
+ <% end %> + <% if opt.votes > 0 %> + <%= content_tag :div, "", { class: "bar", style: "width: #{opt.votes*100/@poll.votes}%;" } %> + <% end %> + <%= opt.votes %> +

+ <% end %> +
-

<%= link_to "Archive..", polls_path %>

+<%= link_to "Archive", polls_path, class: "button" %> diff --git a/app/views/shoutmsgs/_new.html.erb b/app/views/shoutmsgs/_new.html.erb index 6552ff0..af89121 100644 --- a/app/views/shoutmsgs/_new.html.erb +++ b/app/views/shoutmsgs/_new.html.erb @@ -3,15 +3,17 @@ You have been muted. <% else %> <% scroll = shoutmsg.domain == "shoutbox" ? "" : "$('#{shoutmsg.domain}').scrollTop = $('#{shoutmsg.domain}').scrollHeight;" %> - <%= form_for(shoutmsg, :remote => true, :html => {:id => "new_#{shoutmsg.domain}"}) do |f| %> + <%= form_for(shoutmsg, remote: true, html: { id: "new_#{shoutmsg.domain}" }) do |f| %> <% if shoutmsg.shoutable %> <%= f.hidden_field :shoutable_type %> <%= f.hidden_field :shoutable_id %> <% end %> -

+

<%= f.text_field :text, size: 12, id: "#{shoutmsg.domain}_text", class: "shout_input" %> +
+
<%= submit_tag "Shout!" %> -

+
<% end %> <% end %> <% end %> diff --git a/app/views/widgets/_highlights.html.erb b/app/views/widgets/_highlights.html.erb index c85c6e7..fa4b1d4 100644 --- a/app/views/widgets/_highlights.html.erb +++ b/app/views/widgets/_highlights.html.erb @@ -1,55 +1,56 @@

<%= t('widget.highlights') %>

-
-
- <% if cuser and cuser.active_contests.count != 0 then %> -

- Your contests - <%= link_to "(More)", :controller => :matches, :matchesTab => "YourTab" %> -

-
    - <% cuser.active_contests.each do |contest| %> -
  1. - <%= namelink contest %> -
    -
  2. - <% end %> -
- <% end %> - <% if Match.recent.count != 0 then %> -
- Latest Matches - <%= link_to "(More)", :controller => :matches, :matchesTab => "RecentTab" %> -
-
    - <% Match.realfinished.reverse_order.recent.chrono.each do |match| %> -
  1. - <%= link_to match, :class => "bold #{match.score_color}" do %> - <%= h match.score1 %> - <%= h match.score2 %> - <%= link_to match.contester1.team.tag, :controller => :contesters, :action => :show, :id => match.contester1 %> <%= if match.score1 > match.score2 then ">>" elsif match.score2 > match.score1 then "<<" else "==" end %> <%= link_to match.contester2.team.tag, :controller => :contesters, :action => :show, :id => match.contester2 %> - (<%= link_to match.contest.short_name, :controller => :contests, :action => :show, :id => match.contest.id %>) - <% end %> -
    -
  2. - <% end %> -
- <% end %> +
+ <% if cuser and cuser.active_contests.count != 0 then %> +
+ Your contests + <%= link_to "(More)", controller: :matches, matchesTab: "YourTab" %> +
+
    + <% cuser.active_contests.each do |contest| %> +
  1. + <%= namelink contest %> +
    +
  2. + <% end %> +
+ <% end %> - <% if Match.future5.count != 0 then %> -
- Upcoming matches - <%= link_to "(More)", :controller => :matches, :matchesTab => "UpcomingTab" %> -
-
    - <% Match.future5.chrono.each do |match| %> -
  1. - <%= namelink match, 50 %> (<%= link_to match.contest.short_name, :controller => :contests, :action => :show, :id => match.contest.id %>)
    - <%= shorttime match.match_time %> (<%= match.predictions.count %> preds : <%= match.preds(1) %>% - <%= match.preds(2) %>%) -
  2. - <% end %> -
- <% end %> -
+ <% if Match.recent.count != 0 then %> +
+ Latest Matches + <%= link_to "(More)", controller: :matches, matchesTab: "RecentTab" %> +
+
    + <% Match.realfinished.reverse_order.recent.chrono.each do |match| %> +
  1. + <%= link_to match, :class => "bold #{match.score_color}" do %> + <%= h match.score1 %> - <%= h match.score2 %> + <%= link_to match.contester1.team.tag, controller: :contesters, action: :show, id: match.contester1 %> <%= if match.score1 > match.score2 then ">>" elsif match.score2 > match.score1 then "<<" else "==" end %> <%= link_to match.contester2.team.tag, controller: :contesters, action: :show, id: match.contester2 %> + (<%= link_to match.contest.short_name, :controller => :contests, :action => :show, :id => match.contest.id %>) + <% end %> +
    +
  2. + <% end %> +
+ <% end %> + + <% if Match.future5.count != 0 then %> +
+ Upcoming matches + <%= link_to "(More)", controller: :matches, matchesTab: "UpcomingTab" %> +
+
    + <% Match.future5.chrono.each do |match| %> +
  1. + <%= namelink match, 50 %>
    + [<%= link_to match.contest.short_name, controller: :contests, action: :show, id: match.contest.id %>] + <%= shorttime match.match_time %>
    + <%= match.predictions.count %> preds : <%= match.preds(1) %>% - <%= match.preds(2) %>% +
  2. + <% end %> +
+ <% end %>
\ No newline at end of file diff --git a/app/views/widgets/_poll.html.erb b/app/views/widgets/_poll.html.erb index e41402c..74907ce 100644 --- a/app/views/widgets/_poll.html.erb +++ b/app/views/widgets/_poll.html.erb @@ -1,11 +1,8 @@ <% if @current_action == "news_index" %>

<%= t('widget.poll') %>

-
-
- <% @poll = Poll.first(order: "created_at DESC") %> - <%= render(partial: "polls/show") if @poll %> -
-
+ + <% @poll = Poll.first(order: "created_at DESC") %> + <%= render(partial: "polls/show") if @poll %>
<% end %> \ No newline at end of file diff --git a/app/views/widgets/_posts.html.erb b/app/views/widgets/_posts.html.erb index d27869e..9a333cf 100644 --- a/app/views/widgets/_posts.html.erb +++ b/app/views/widgets/_posts.html.erb @@ -1,25 +1,24 @@

<%= t('widget.posts') %>

-
-
-
Latest forum posts
-
    - <% Topic.basic.recent.latest_page(1).each do |topic| %> -
  1. - <%= link_to shorten(topic, 35), lastpost(topic) %> -
  2. - <% end %> -
-
Latest comments
-
    - <% Comment.recent.filtered.each do |comment| %> -
  1. - <%= namelink comment.commentable, 15 %> - by <%= namelink comment.user, 15 %> -
  2. - <% end %> -
-
+
+
Latest forum posts
+
    + <% Topic.basic.recent.latest_page(1).each do |topic| %> +
  1. + <%= link_to shorten(topic, 28), lastpost(topic) %> +
  2. + <% end %> +
+ +
Latest comments
+
    + <% Comment.recent.filtered.each do |comment| %> +
  1. + <%= namelink comment.commentable, 15 %> + by <%= namelink comment.user, 10 %> +
  2. + <% end %> +
\ No newline at end of file diff --git a/app/views/widgets/_shoutbox.html.erb b/app/views/widgets/_shoutbox.html.erb index d871a91..23525c1 100644 --- a/app/views/widgets/_shoutbox.html.erb +++ b/app/views/widgets/_shoutbox.html.erb @@ -6,8 +6,6 @@
<%= render :partial => "shoutmsgs/new", :locals => { :shoutmsg => Shoutmsg.new } %> -

- <%= link_to "Shoutbox Recent History", :controller => :shoutmsgs, :action => "index" %>
- <%= link_to "Shoutbox Rules", article_path(Article::SB_RULES) %> -

+ <%= link_to "Shoutbox Recent History", :controller => :shoutmsgs, :action => "index" %>
+ <%= link_to "Shoutbox Rules", article_path(Article::SB_RULES) %>
\ No newline at end of file diff --git a/public/images/icons/poll.png b/public/images/icons/poll.png deleted file mode 100644 index eb2120ab5e5e047ea78a1f20641dfc3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