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 eb2120a..0000000 Binary files a/public/images/icons/poll.png and /dev/null differ