diff --git a/app/assets/javascripts/feeds.js.coffee b/app/assets/javascripts/feeds.js.coffee index 92b0402..9e59633 100644 --- a/app/assets/javascripts/feeds.js.coffee +++ b/app/assets/javascripts/feeds.js.coffee @@ -1,11 +1,15 @@ $(document).ready -> $("#feed_list > li > a").on("ajax:success", (event, data) -> $("#feed_content").html(data) + false ) $("#feed_content").on("ajax:success", ".item > a", (event, data) -> item = $(this).parent() $("article", item).html(data) + .addClass("expanded") + .append($('
')) $("a", item).live() + false ) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3b5cc66..2d20be4 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -9,5 +9,6 @@ * compiled file, but it's generally better to create a new file per style scope. * *= require_self + *= require config *= require_tree . */ diff --git a/app/assets/stylesheets/config.css.scss b/app/assets/stylesheets/config.css.scss new file mode 100644 index 0000000..d643359 --- /dev/null +++ b/app/assets/stylesheets/config.css.scss @@ -0,0 +1,7 @@ + +// http://www.colourlovers.com/palette/126030/Cruel_Water_at_Night +$main_color1: #030C22; +$main_color2: #20293F; +$main_color3: #404749; +$main_color4: #A9B0B3; + diff --git a/app/assets/stylesheets/feeds.css.coffee b/app/assets/stylesheets/feeds.css.scss similarity index 100% rename from app/assets/stylesheets/feeds.css.coffee rename to app/assets/stylesheets/feeds.css.scss diff --git a/app/assets/stylesheets/items.css.scss b/app/assets/stylesheets/items.css.scss index 49e8648..574a089 100644 --- a/app/assets/stylesheets/items.css.scss +++ b/app/assets/stylesheets/items.css.scss @@ -1,3 +1,24 @@ -// Place all the styles related to the items controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ +@import "config"; + +li.item { + overflow: auto; + + em.date_published, em.author { + font-size: 0.8em; + } + + em.author { + font-weight: bold; + } + + article { + // TODO: Some more default stuff for incomming HTML + p { + margin: 0; + padding: 0; + } + } + article.expanded { + padding: 10px 5px 10px 20px; + } +} diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss new file mode 100644 index 0000000..cfa8c8f --- /dev/null +++ b/app/assets/stylesheets/layout.css.scss @@ -0,0 +1,27 @@ +@import "config"; + +aside { + width: 250px; + float: left; + + ul { + list-style-type: none; + padding: 0 5px; + //background-color: $main_color4; + } +} + +section#feed_content { + float: left; + max-width: 750px; + + ul { + list-style-type: none; + padding: 0 10px; + } +} + +.clearing { + clear: both; +} + diff --git a/app/views/feeds/index.html.erb b/app/views/feeds/index.html.erb index e50a807..5a63482 100644 --- a/app/views/feeds/index.html.erb +++ b/app/views/feeds/index.html.erb @@ -7,5 +7,6 @@ <%= render :partial => "navigation" %> -
-
+
+
+ diff --git a/app/views/feeds/show.html.erb b/app/views/feeds/show.html.erb index f7b8d45..d7a051f 100644 --- a/app/views/feeds/show.html.erb +++ b/app/views/feeds/show.html.erb @@ -2,7 +2,7 @@ <% @items.each do |item| %>
  • <%= link_to raw(item.title), item_path(item), :remote => true %> - <%= time_ago_in_words(item.published_at) %> by <%= item.author %> + <%= time_ago_in_words(item.published_at) %> by <%= item.author %>
  • <% end %>