Skip to content

Commit cec9139

Browse files
committed
added proper page title for creating a new post in category
1 parent 072a25c commit cec9139

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

app/views/posts/new.html.erb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
<h1 class="has-margin-bottom-2">
2-
New Post
3-
<% if @category.present? %>
4-
in <%= @category.name %>
5-
<% end %>
6-
</h1>
1+
<% title = "New Post#{ " in #{@category.name}" if @category.present? }" %>
2+
3+
<% content_for :title, title %>
4+
5+
<h1 class="has-margin-bottom-2"><%= title %></h1>
76
<% unless @category.present? && @category.min_trust_level.present? && @category.min_trust_level > current_user.trust_level %>
87
<% if @category.present? %>
98
<p class="has-color-tertiary-500">Not where you meant to post? See <%= link_to 'Categories', categories_path %></p>
@@ -32,7 +31,7 @@
3231

3332
<% else %>
3433
<div class="notice is-danger is-filled">
35-
You don't have a high enough trust level to post in the <%= @category.name %> category.
34+
You don't have a high enough trust level to post in the <%= @category.name %> category.
3635
</div>
3736
<p>Not where you meant to post? See <%= link_to 'Categories', categories_path %></p>
3837

0 commit comments

Comments
 (0)