Sha256: 94f67c6bf46f8d36503bb82c5f9cee252a909b9a39f8a309b9b919e26f228b66

Contents?: true

Size: 1.99 KB

Versions: 4

Compression:

Stored size: 1.99 KB

Contents

<% if policy(Proclaim::Post).new? %>
	<%= link_to 'New Post', new_post_path %>
<% end %>

<% if @posts.empty? %>
	<p>No posts have been made, yet.</p>
<% else %>
	<table style = "width: 100%;">
		<tr>
			<td id = "published_posts">
				<% @posts.published.each do |post| %>
				<h1><%= link_to post.title, post %></h1>
				<div id = "post_<%= post.id %>">
					<% excerpt = post.excerpt %>
					<span class = "excerpt"><%= excerpt %></span>

					<% if excerpt.length < post.body.length %>
						. . . <%= link_to "(more)", post %>
					<% end %>
				</div>
				<div class = "post_excerpt_information">
					<div style = "float: right;">
						<% if policy(post).edit? %>
							<%= link_to 'Edit', edit_post_path(post) %>
						<% end %>
						<% if policy(post).destroy? %>
							<% if policy(post).edit? %>
								|
							<% end %>
							<%= link_to 'Delete', post, method: :delete, data: { confirm: 'Are you sure?' } %>
						<% end %>
					</div>
					<%= post.author.send(Proclaim.author_name_method) %><br />
					<%= timeago_tag post.published_at, format: "%B %d, %Y" %>
				</div>
			<% end %>
			</td>

			<% drafts = @posts.draft %>
			<% unless drafts.blank? %>
				<td id = "draft_posts">
					<div id = "draft_list">
						<h2>Drafts</h2>
						<% drafts.each do |post| %>
							<h3 class = "draft_list_item">
								<%= link_to post.title, post %>
							</h3>
							<div class = "post_excerpt_information">
								<div style = "float: right;">
									<% if policy(post).edit? %>
										<%= link_to 'Edit', edit_post_path(post) %>
									<% end %>
									<% if policy(post).destroy? %>
										<% if policy(post).edit? %>
											|
										<% end %>
										<%= link_to 'Delete', post, method: :delete, data: { confirm: 'Are you sure?' } %>
									<% end %>
								</div>
								<%= post.author.send(Proclaim.author_name_method) %><br />
								<%= timeago_tag post.updated_at, format: "%B %d, %Y" %>
							</div>
						<% end %>
					</div>
				</td>
			<% end %>
		</tr>
	</table>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
proclaim-0.3.1 app/views/proclaim/posts/index.html.erb
proclaim-0.3.0 app/views/proclaim/posts/index.html.erb
proclaim-0.2.4 app/views/proclaim/posts/index.html.erb
proclaim-0.2.2 app/views/proclaim/posts/index.html.erb