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 @@ -
Comments
<%= render partial: "comments/comment", collection: @comments %> + <%= render partial: "comments/new" %>- 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" %> -
-+
<%= @poll.question %>
+<%= @poll.question %>
-- <% 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 %> + <% @poll.options.all.each do |opt| %> +- <% end %> - <% if opt.votes > 0 %> - <%= image_tag "/images/icons/poll.png", :class => "bar", :height => 6, :width => opt.votes*100/@poll.votes %> - <% end %> - <%= opt.votes %> -
+ <% 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 %> ++ <% end %> + <% if opt.votes > 0 %> + <%= content_tag :div, "", { class: "bar", style: "width: #{opt.votes*100/@poll.votes}%;" } %> + <% end %> + <%= opt.votes %> +
<%= 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 %> -+
<%= t('widget.highlights') %>
-- Your contests - <%= link_to "(More)", :controller => :matches, :matchesTab => "YourTab" %> -
-- <% cuser.active_contests.each do |contest| %> --
- <%= namelink contest %>
-
- <% 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| %> --
- <%= 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 %>
-
- <% end %>
-
- <% end %> +-
+ <% cuser.active_contests.each do |contest| %> +-
+ <%= namelink contest %>
+
+ <% end %>
+
+ <% end %> - <% if Match.future5.count != 0 then %> -+
- Upcoming matches - <%= link_to "(More)", :controller => :matches, :matchesTab => "UpcomingTab" %> -
-- <% Match.future5.chrono.each do |match| %> --
- <%= namelink match, 50 %> (<%= link_to match.contest.short_name, :controller => :contests, :action => :show, :id => match.contest.id %>)
- <% end %>
-
- <% end %> -- <%= shorttime match.match_time %> (<%= match.predictions.count %> preds : <%= match.preds(1) %>% - <%= match.preds(2) %>%) -
+ <% Match.realfinished.reverse_order.recent.chrono.each do |match| %> +-
+ <%= 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 %>
+
+ <% end %>
+
+ <% end %> + + <% if Match.future5.count != 0 then %> ++
+ <% Match.future5.chrono.each do |match| %> +-
+ <%= namelink match, 50 %>
+ <% end %>
+
+ <% end %>+ [<%= 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) %>% +
<%= t('widget.poll') %>
-<%= t('widget.posts') %>
-Latest forum posts -
- <% Topic.basic.recent.latest_page(1).each do |topic| %> --
- <%= link_to shorten(topic, 35), lastpost(topic) %>
-
- <% end %>
-
-Latest comments
-- <% Comment.recent.filtered.each do |comment| %> --
- <%= namelink comment.commentable, 15 %>
- by <%= namelink comment.user, 15 %>
-
- <% end %>
-
-+ <% Topic.basic.recent.latest_page(1).each do |topic| %> +-
+ <%= link_to shorten(topic, 28), lastpost(topic) %>
+
+ <% end %>
+
+ ++ <% Comment.recent.filtered.each do |comment| %> +-
+ <%= namelink comment.commentable, 15 %>
+ by <%= namelink comment.user, 10 %>
+
+ <% end %>
+
- <%= link_to "Shoutbox Recent History", :controller => :shoutmsgs, :action => "index" %>
+ <%= link_to "Shoutbox Recent History", :controller => :shoutmsgs, :action => "index" %>- <%= link_to "Shoutbox Rules", article_path(Article::SB_RULES) %> -
+ <%= link_to "Shoutbox Rules", article_path(Article::SB_RULES) %>