Skip to content

Commit

Permalink
more planet templating
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Schubert committed Dec 14, 2014
1 parent e740209 commit 7a1f4f4
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 10 deletions.
15 changes: 15 additions & 0 deletions app/assets/stylesheets/planet.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,18 @@
max-width: 100%;
}
}

.planet-page {
.col-md-3 {
padding-top: 30px;

h4 {
font-weight: normal;
margin-top: 35px;
}

ul {
padding-left: 20px;
}
}
}
1 change: 1 addition & 0 deletions app/controllers/planet_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class PlanetController < ApplicationController
def index
@entries = Planet::Models::Entry.order(:published_at => :desc)
.paginate(:page => params[:page], :per_page => 10)
@subscriptions = Planet::Models::Feed.order(:title => :asc)
end

def feed
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<%= auto_discovery_link_tag :atom, news_feed_url(subdomain: 'blog'), {:title => t('newsfeed')} %>
<%= auto_discovery_link_tag :atom, planet_feed_url(subdomain: 'planet'), {:title => t('planet_feed')} %>
<%= stylesheet_link_tag 'application', :media => 'all' %>
<%= javascript_include_tag 'application' %>
<%= csrf_meta_tags %>
Expand Down
37 changes: 29 additions & 8 deletions app/views/planet/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<%- content_for :page_title do %>
<%= t 'pages.planet.menu_title' %>
<% end %>
<% content_for :wrapper_class, 'planet-page' %>

<div class="page-header">
<h1><%= t 'pages.planet.headline' %> <small><%= t 'pages.planet.subline' %></small></h1>
<div class="hero" id="masthead">
<div class="container">
<h1><%= t 'pages.planet.headline' %></h1>
<h2 class="lead"><%= t 'pages.planet.subline' %></h2>
</div>
</div>

<div class="container-fluid">
<div class="container">
<div class="row">
<div class="col-md-8">
<div class="col-md-9">
<%- @entries.each do |entry| %>
<div class="blogcontent bloglist-item planet-item">
<div class="page-header clearfix">
<h1>
<%= entry.feed.title %> - <%= link_to entry.title, entry.url %>
<%= entry.feed.title %>: <%= link_to entry.title, entry.url %>
<small><%= l entry.published_at, format: :blog_headline %></small>
</h1>
</div>
Expand All @@ -22,10 +26,27 @@
</div>
<% end %>
</div>
<div class="col-md-4">
foo
<div class="col-md-3">
<h4><%= t 'pages.planet.disclaimer_headline' %></h4>
<p class="text-muted"><%= t 'pages.planet.disclaimer' %></p>

<h4><%= t 'pages.planet.subscribe_headline' %></h4>
<p class="text-muted"><%= t('pages.planet.subscribe', feed_link: link_to(t('pages.planet.feed_link_title'), planet_feed_path)).html_safe %></p>

<h4><%= t 'pages.planet.subscriptions_headline' %></h4>
<ul>
<%- @subscriptions.each do |subscription| %>
<li>
<%= link_to subscription.title, subscription.site_url %>
</li>
<% end %>
</ul>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<%= will_paginate @entries, renderer: BootstrapPagination::Rails %>
</div>
</div>
</div>

<%= will_paginate @entries, renderer: BootstrapPagination::Rails %>
12 changes: 10 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ en:
footer:
copyleft: "CC-BY The diaspora* Foundation"
title: "The diaspora* Project"
newsfeed: Newsfeed
newsfeed: "The diaspora* Blog (Atom)"
planet_feed: "The diaspora* Planet (Atom)"
layouts:
application:
wiki: Wiki
Expand Down Expand Up @@ -192,8 +193,15 @@ en:
subline: "official announcements"
menu_title: Blog
planet:
headline: Planet
headline: "The diaspora* planet"
subline: "blog posts by our community"
menu_title: Planet
disclaimer_headline: "The diaspora* planet"
disclaimer: "The planet is a collection of blog posts written by members of our community and represents the views of individual community members. All posts are owned by their authors, see the original posts for further information."
subscribe_headline: "Subscribe"
subscribe: "You can stay up-to-date by subscribing to the planets %{feed_link}."
feed_link_title: "Atom feed"
subscriptions_headline: "Subscriptions"
tutorials:
headline: "diaspora* tutorials"
byline: "Step-by-step guides to help you"
Expand Down

0 comments on commit 7a1f4f4

Please sign in to comment.