×
- <%= form_tag search_path, method: :get do %>
+ <%= form_tag main_app.search_path, method: :get do %>
Search everything
<% end %>
diff --git a/app/views/layouts/_sidenav.html.erb b/app/views/layouts/_sidenav.html.erb
index 12749e96..6cf9e841 100644
--- a/app/views/layouts/_sidenav.html.erb
+++ b/app/views/layouts/_sidenav.html.erb
@@ -31,6 +31,31 @@
<% end %>
+
+ <%= link_to thredded_path do %>
+
+ forum
+
+ Discussions
+ <%
+ unread_threads = Thredded::Topic
+ .followed_by(current_user)
+ .unread(current_user)
+ .count
+
+ private_messages = Thredded::PrivateTopic
+ .for_user(current_user)
+ .unread(current_user)
+ .count
+ %>
+ <% if unread_threads > 0 || private_messages > 0 %>
+
+ <%= unread_threads %><%= "/#{private_messages}" if private_messages > 0 %>
+
+ <% end %>
+ <% end %>
+
+
<%= link_to notes_path do %>
@@ -147,4 +172,4 @@
$(document).ready(function () {
$(".button-collapse").sideNav();
})
-
\ No newline at end of file
+
diff --git a/app/views/layouts/forum.html.erb b/app/views/layouts/forum.html.erb
new file mode 100644
index 00000000..bacd5032
--- /dev/null
+++ b/app/views/layouts/forum.html.erb
@@ -0,0 +1,23 @@
+
+
+
+ <%= yield :thredded_page_title %> | Notebook.ai
+
+ <%= stylesheet_link_tag 'thredded', 'data-turbolinks-track': 'reload' %>
+ <%= csrf_meta_tag %>
+ <%= javascript_include_tag 'thredded',
+ async: !Rails.application.config.assets.debug,
+ defer: true,
+ 'data-turbolinks-track': 'reload'%>
+ <%== Gravatar.prefetch_dns %>
+
+
+
+
+ <%= render 'thredded/shared/nav/bar' %>
+
+ <%= yield %>
+
+ <%= render 'layouts/ganalytics' %>
+
+
diff --git a/app/views/subscriptions/new.html.erb b/app/views/subscriptions/new.html.erb
index b0911a57..5f478141 100644
--- a/app/views/subscriptions/new.html.erb
+++ b/app/views/subscriptions/new.html.erb
@@ -14,27 +14,6 @@
Subscription Plan
-
-
-
You've been upgraded to a free Premium account for the month of October!
-
- Notebook.ai just hit 10,000 users! To celebrate, every single user is free to create any kind of Notebook.ai page for the entire month of October.
-
-
-
- Whatever you create is yours forever — you'll never lose access to it, even after October.
- Get ready for National Novel Writing Month and worldbuild away!
-
-
-
- Users that have paid for a premium membership in October will have the full amount credited back for use on any other month they choose.
-
-
-
-
-
<% if free_for_life_user %>
diff --git a/app/views/thredded/categories/_category.html.erb b/app/views/thredded/categories/_category.html.erb
new file mode 100644
index 00000000..344c3a57
--- /dev/null
+++ b/app/views/thredded/categories/_category.html.erb
@@ -0,0 +1 @@
+
<%= category.name %>
diff --git a/app/views/thredded/error_pages/forbidden.html.erb b/app/views/thredded/error_pages/forbidden.html.erb
new file mode 100644
index 00000000..ac554df3
--- /dev/null
+++ b/app/views/thredded/error_pages/forbidden.html.erb
@@ -0,0 +1,6 @@
+<% content_for :thredded_page_title, @message %>
+<% content_for :thredded_page_id, 'thredded--error-forbidden' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+<%= thredded_page do %>
+
<%= @message %>
+<% end %>
diff --git a/app/views/thredded/error_pages/not_found.html.erb b/app/views/thredded/error_pages/not_found.html.erb
new file mode 100644
index 00000000..d745413a
--- /dev/null
+++ b/app/views/thredded/error_pages/not_found.html.erb
@@ -0,0 +1,6 @@
+<% content_for :thredded_page_title, @message %>
+<% content_for :thredded_page_id, 'thredded--error-not-found' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+<%= thredded_page do %>
+
<%= @message %>
+<% end %>
diff --git a/app/views/thredded/kaminari/_first_page.html.erb b/app/views/thredded/kaminari/_first_page.html.erb
new file mode 100644
index 00000000..2682d341
--- /dev/null
+++ b/app/views/thredded/kaminari/_first_page.html.erb
@@ -0,0 +1,11 @@
+<%# Link to the "First" page
+ - available local variables
+ url: url to the first page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
+ <%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, :remote => remote %>
+
diff --git a/app/views/thredded/kaminari/_gap.html.erb b/app/views/thredded/kaminari/_gap.html.erb
new file mode 100644
index 00000000..bbb0f983
--- /dev/null
+++ b/app/views/thredded/kaminari/_gap.html.erb
@@ -0,0 +1,8 @@
+<%# Non-link tag that stands for skipped pages...
+ - available local variables
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
<%= t('views.pagination.truncate').html_safe %>
diff --git a/app/views/thredded/kaminari/_last_page.html.erb b/app/views/thredded/kaminari/_last_page.html.erb
new file mode 100644
index 00000000..53d61307
--- /dev/null
+++ b/app/views/thredded/kaminari/_last_page.html.erb
@@ -0,0 +1,11 @@
+<%# Link to the "Last" page
+ - available local variables
+ url: url to the last page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
+ <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, :remote => remote %>
+
diff --git a/app/views/thredded/kaminari/_next_page.html.erb b/app/views/thredded/kaminari/_next_page.html.erb
new file mode 100644
index 00000000..4fc20712
--- /dev/null
+++ b/app/views/thredded/kaminari/_next_page.html.erb
@@ -0,0 +1,11 @@
+<%# Link to the "Next" page
+ - available local variables
+ url: url to the next page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
+ <%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, :rel => 'next', :remote => remote %>
+
diff --git a/app/views/thredded/kaminari/_page.html.erb b/app/views/thredded/kaminari/_page.html.erb
new file mode 100644
index 00000000..582af7bc
--- /dev/null
+++ b/app/views/thredded/kaminari/_page.html.erb
@@ -0,0 +1,12 @@
+<%# Link showing page number
+ - available local variables
+ page: a page object for "this" page
+ url: url to this page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
+ <%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
+
diff --git a/app/views/thredded/kaminari/_paginator.html.erb b/app/views/thredded/kaminari/_paginator.html.erb
new file mode 100644
index 00000000..88451781
--- /dev/null
+++ b/app/views/thredded/kaminari/_paginator.html.erb
@@ -0,0 +1,23 @@
+<%# The container tag
+ - available local variables
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+ paginator: the paginator that renders the pagination tags inside
+-%>
+<%= paginator.render do -%>
+
+<% end -%>
diff --git a/app/views/thredded/kaminari/_prev_page.html.erb b/app/views/thredded/kaminari/_prev_page.html.erb
new file mode 100644
index 00000000..9c4aff49
--- /dev/null
+++ b/app/views/thredded/kaminari/_prev_page.html.erb
@@ -0,0 +1,11 @@
+<%# Link to the "Previous" page
+ - available local variables
+ url: url to the previous page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
+ <%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, :rel => 'prev', :remote => remote %>
+
diff --git a/app/views/thredded/messageboard_groups/new.html.erb b/app/views/thredded/messageboard_groups/new.html.erb
new file mode 100644
index 00000000..ffad52ed
--- /dev/null
+++ b/app/views/thredded/messageboard_groups/new.html.erb
@@ -0,0 +1,28 @@
+<% content_for :thredded_page_title, t('thredded.messageboard_group.create') %>
+<% content_for :thredded_page_id, 'thredded--messageboard-groups-new' %>
+<% content_for :thredded_breadcrumbs do %>
+
+
+ <%= t('thredded.messageboard_group.create') %>
+
+
+<% end %>
+
+<%= thredded_page do %>
+
+ <%= form_for @messageboard_group, html: { class: 'thredded--form' } do |f| %>
+
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/messageboards/_form.html.erb b/app/views/thredded/messageboards/_form.html.erb
new file mode 100644
index 00000000..a50a9c34
--- /dev/null
+++ b/app/views/thredded/messageboards/_form.html.erb
@@ -0,0 +1,24 @@
+<%= form_for messageboard, html: { class: 'thredded--form' } do |f| %>
+
+<% end %>
diff --git a/app/views/thredded/messageboards/_messageboard.html.erb b/app/views/thredded/messageboards/_messageboard.html.erb
new file mode 100644
index 00000000..c9335acd
--- /dev/null
+++ b/app/views/thredded/messageboards/_messageboard.html.erb
@@ -0,0 +1,24 @@
+<% if policy(messageboard).read? %>
+ <%= view_hooks.messageboards_index.messageboard.render self, messageboard: messageboard do %>
+ <%= link_to messageboard_topics_path(messageboard), class: 'thredded--messageboard' do %>
+
+
+
<%= messageboard.description %>
+
+ <% if messageboard.last_topic %>
+
+ <%= t 'thredded.messageboard.last_updated_by_html',
+ time_ago: time_ago(messageboard.last_topic.last_post_at),
+ user: messageboard.last_user.thredded_display_name %>
+
+ <% end %>
+ <% end %>
+ <% end %>
+<% end %>
diff --git a/app/views/thredded/messageboards/edit.html.erb b/app/views/thredded/messageboards/edit.html.erb
new file mode 100644
index 00000000..27790eb4
--- /dev/null
+++ b/app/views/thredded/messageboards/edit.html.erb
@@ -0,0 +1,15 @@
+<% content_for :thredded_page_title, t('thredded.nav.edit_messageboard') %>
+<% content_for :thredded_page_id, 'thredded--messageboard-edit' %>
+<% content_for :thredded_breadcrumbs do %>
+
+
+ <%= t('thredded.nav.edit_messageboard') %>
+
+
+<% end %>
+
+<%= thredded_page do %>
+
+ <%= render 'form', messageboard: @messageboard %>
+
+<% end %>
diff --git a/app/views/thredded/messageboards/index.html.erb b/app/views/thredded/messageboards/index.html.erb
new file mode 100644
index 00000000..8267d616
--- /dev/null
+++ b/app/views/thredded/messageboards/index.html.erb
@@ -0,0 +1,34 @@
+<% content_for :thredded_page_title, t('thredded.messageboard.index.page_title') %>
+<% content_for :thredded_page_id, 'thredded--messageboards-index' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+<%= thredded_page do %>
+ <%= view_hooks.messageboards_index.container.render self, groups: @groups do %>
+
+ <%= view_hooks.messageboards_index.list.render self, groups: @groups do %>
+ <% @groups.each do |group| %>
+ <% if group.name.present? %>
+ <%= group.name %>
+ <% end %>
+
+ <%= view_hooks.messageboards_index.group.render self, group: group do %>
+ <%= render group.messageboards %>
+ <% end %>
+
+ <% end %>
+ <% end %>
+
+
+
+ <% end %>
+<% end %>
diff --git a/app/views/thredded/messageboards/new.html.erb b/app/views/thredded/messageboards/new.html.erb
new file mode 100644
index 00000000..404a2dd7
--- /dev/null
+++ b/app/views/thredded/messageboards/new.html.erb
@@ -0,0 +1,15 @@
+<% content_for :thredded_page_title, t('thredded.messageboard.create') %>
+<% content_for :thredded_page_id, 'thredded--messageboards-new' %>
+<% content_for :thredded_breadcrumbs do %>
+
+
+ <%= t('thredded.messageboard.create') %>
+
+
+<% end %>
+
+<%= thredded_page do %>
+
+ <%= render 'form', messageboard: @messageboard %>
+
+<% end %>
diff --git a/app/views/thredded/moderation/_nav.html.erb b/app/views/thredded/moderation/_nav.html.erb
new file mode 100644
index 00000000..5bfebc29
--- /dev/null
+++ b/app/views/thredded/moderation/_nav.html.erb
@@ -0,0 +1,19 @@
+<% content_for :thredded_main_navigation do %>
+
+
+
+ <%= link_to t('thredded.nav.moderation_pending'), pending_moderation_path %>
+
+
+ <%= link_to t('thredded.nav.moderation_history'), moderation_history_path %>
+
+
+ <%= link_to t('thredded.nav.moderation_activity'), moderation_activity_path %>
+
+
+ <%= link_to t('thredded.nav.moderation_users'), users_moderation_path %>
+
+
+ <%= render 'users_search_form' %>
+
+<% end %>
diff --git a/app/views/thredded/moderation/_post.html.erb b/app/views/thredded/moderation/_post.html.erb
new file mode 100644
index 00000000..4a91d80e
--- /dev/null
+++ b/app/views/thredded/moderation/_post.html.erb
@@ -0,0 +1,19 @@
+<% post, content = post_and_content if local_assigns.key?(:post_and_content) %>
+<%= content_tag :article, id: dom_id(post), class: 'thredded--post thredded--post-moderation' do %>
+ <%= render 'thredded/posts_common/actions', post: post %>
+ <%= render 'thredded/posts_common/header_with_user_and_topic',
+ post: post,
+ post_user_link: if post.user
+ link_to(post.user.thredded_display_name, user_moderation_path(post.user.id))
+ else
+ content_tag :em, t('thredded.null_user_name')
+ end
+ %>
+ <%= content || render('thredded/posts/content', post: post) %>
+ <% if post.blocked? %>
+
+ <%= render 'thredded/shared/content_moderation_blocked_state', moderation_record: post.last_moderation_record %>
+
+ <% end %>
+ <%= render 'post_moderation_actions', post: post %>
+<% end %>
diff --git a/app/views/thredded/moderation/_post_moderation_actions.html.erb b/app/views/thredded/moderation/_post_moderation_actions.html.erb
new file mode 100644
index 00000000..0f3f5bee
--- /dev/null
+++ b/app/views/thredded/moderation/_post_moderation_actions.html.erb
@@ -0,0 +1,12 @@
+
+ <% unless post.approved? %>
+ <%= button_to t('thredded.moderation.approve_btn'), moderate_post_path,
+ class: 'thredded--button',
+ params: { id: post.to_model.id, moderation_state: 'approved' } %>
+ <% end %>
+ <% unless post.blocked? %>
+ <%= button_to t('thredded.moderation.block_btn'), moderate_post_path,
+ class: 'thredded--button',
+ params: { id: post.to_model.id, moderation_state: 'blocked' } %>
+ <% end %>
+
diff --git a/app/views/thredded/moderation/_post_moderation_record.html.erb b/app/views/thredded/moderation/_post_moderation_record.html.erb
new file mode 100644
index 00000000..1baf9bcf
--- /dev/null
+++ b/app/views/thredded/moderation/_post_moderation_record.html.erb
@@ -0,0 +1,46 @@
+<%
+ record = post_moderation_record
+ post = record.post
+ if post
+ post_view = Thredded::PostView.new(post, policy(post))
+ end
+ moderation_state_notice_args = {
+ moderator: user_link(record.moderator),
+ time_ago: time_ago(record.created_at)
+ }
+%>
+
+
+
+ <% post_user_link = capture do %>
+ <% if record.post_user %>
+ <%= link_to record.post_user.thredded_display_name, user_moderation_path(record.post_user.id) %>
+ <% else %>
+ <%= safe_join [record.post_user_name, content_tag(:em, t('thredded.null_user_name'))].compact, ', ' %>
+ <% end %>
+ <% end %>
+ <% if post %>
+ <%= render 'thredded/posts_common/header_with_user_and_topic', post: post_view, post_user_link: post_user_link %>
+ <% else %>
+
+ <% end %>
+
+ <%= Thredded::ContentFormatter.new(self).format_content(record.post_content) %>
+
+
+ <%= render 'post_moderation_actions', post: post if post %>
+
diff --git a/app/views/thredded/moderation/_user_moderation_state.html.erb b/app/views/thredded/moderation/_user_moderation_state.html.erb
new file mode 100644
index 00000000..6ef07cce
--- /dev/null
+++ b/app/views/thredded/moderation/_user_moderation_state.html.erb
@@ -0,0 +1,3 @@
+<% user_detail = user.thredded_user_detail %>
+<%= user_detail.moderation_state.to_s.humanize %>
+<%= time_ago user_detail.moderation_state_changed_at, default: '' %>
diff --git a/app/views/thredded/moderation/_user_post.html.erb b/app/views/thredded/moderation/_user_post.html.erb
new file mode 100644
index 00000000..7bfad672
--- /dev/null
+++ b/app/views/thredded/moderation/_user_post.html.erb
@@ -0,0 +1,12 @@
+<% post, content = post_and_content if local_assigns.key?(:post_and_content) %>
+<%= content_tag :article, id: dom_id(post), class: 'thredded--post thredded--post-moderation' do %>
+ <%= render 'thredded/posts_common/actions', post: post %>
+ <%= render 'thredded/posts_common/header_with_topic', post: post %>
+ <%= content || render('thredded/posts/content', post: post) %>
+ <% if post.blocked? %>
+
+ <%= render 'thredded/shared/content_moderation_blocked_state', moderation_record: post.last_moderation_record %>
+
+ <% end %>
+ <%= render 'post_moderation_actions', post: post %>
+<% end %>
diff --git a/app/views/thredded/moderation/_users_search_form.html.erb b/app/views/thredded/moderation/_users_search_form.html.erb
new file mode 100644
index 00000000..1ee61172
--- /dev/null
+++ b/app/views/thredded/moderation/_users_search_form.html.erb
@@ -0,0 +1,13 @@
+<%= form_tag users_moderation_path,
+ method: 'get',
+ class: 'thredded--form thredded--navigation--search thredded--navigation--search--right',
+ 'data-thredded-turboform' => true do %>
+ <%= label_tag :q, t('thredded.moderation.search_users.form_label') %>
+ <%= text_field_tag :q, @query,
+ type: 'search',
+ required: true,
+ # If there are no results the user will likely want to change the query, so auto-focus.
+ autofocus: @query.presence && !@users.presence,
+ placeholder: t('thredded.moderation.search_users.form_placeholder') %>
+
<%= t 'thredded.search.form.btn_submit' %>
+<% end %>
diff --git a/app/views/thredded/moderation/activity.html.erb b/app/views/thredded/moderation/activity.html.erb
new file mode 100644
index 00000000..083deade
--- /dev/null
+++ b/app/views/thredded/moderation/activity.html.erb
@@ -0,0 +1,20 @@
+<% content_for :thredded_page_title, t('thredded.nav.moderation') %>
+<% content_for :thredded_page_id, 'thredded--moderation-activity' %>
+<%= render 'nav' %>
+
+<%= thredded_page do %>
+
+ <%= t 'thredded.recent_activity' %>
+ <% if @last_moderated_record %>
+
+ <%= render 'post_moderation_record', post_moderation_record: @last_moderated_record %>
+
+ <% end %>
+ <% if @posts.present? %>
+ <%= render_posts @posts,
+ partial: 'thredded/moderation/post',
+ content_partial: 'thredded/posts/content' %>
+ <%= paginate @posts %>
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/moderation/history.html.erb b/app/views/thredded/moderation/history.html.erb
new file mode 100644
index 00000000..2e678c98
--- /dev/null
+++ b/app/views/thredded/moderation/history.html.erb
@@ -0,0 +1,13 @@
+<% content_for :thredded_page_title,
+ safe_join([t('thredded.nav.moderation'), t('thredded.nav.moderation_history')], ': ') %>
+<% content_for :thredded_page_id, 'thredded--moderation-history' %>
+<%= render 'nav' %>
+
+<%= thredded_page do %>
+
+ <% if @post_moderation_records.present? %>
+ <%= render partial: 'post_moderation_record', collection: @post_moderation_records %>
+ <%= paginate @post_moderation_records %>
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/moderation/pending.html.erb b/app/views/thredded/moderation/pending.html.erb
new file mode 100644
index 00000000..8653715e
--- /dev/null
+++ b/app/views/thredded/moderation/pending.html.erb
@@ -0,0 +1,24 @@
+<% content_for :thredded_page_title, t('thredded.nav.moderation') %>
+<% content_for :thredded_page_id, 'thredded--pending-moderation' %>
+<%= render 'nav' %>
+
+<%= thredded_page do %>
+
+ <% if @last_moderated_record %>
+
+ <%= render 'post_moderation_record', post_moderation_record: @last_moderated_record %>
+
+ <% end %>
+ <% if @posts.present? %>
+ <%= render_posts @posts,
+ partial: 'thredded/moderation/post',
+ content_partial: 'thredded/posts/content' %>
+ <%= paginate @posts %>
+ <% else %>
+
+
<%= t 'thredded.moderation.pending.empty.title' %>
+
<%= t 'thredded.moderation.pending.empty.content' %>
+
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/moderation/user.html.erb b/app/views/thredded/moderation/user.html.erb
new file mode 100644
index 00000000..d7b7c10d
--- /dev/null
+++ b/app/views/thredded/moderation/user.html.erb
@@ -0,0 +1,54 @@
+<%
+ user = @user
+ user_detail = user.thredded_user_detail
+%>
+<% content_for :thredded_page_title, t('thredded.nav.moderation') %>
+<% content_for :thredded_page_id, 'thredded--moderation-user' %>
+<%= render 'nav' %>
+<%= thredded_page do %>
+
+ <%= view_hooks.moderation_user_page.user_title.render self, user: user do %>
+
+ <%= image_tag Thredded.avatar_url.call(user), class: 'thredded--user--avatar' %><%= user.thredded_display_name %>
+
+ <% end %>
+ <%= view_hooks.moderation_user_page.user_info.render self, user: user do %>
+
+ <%= view_hooks.moderation_user_page.user_info_list_items.render self, user: user do %>
+ <%= t 'thredded.users.user_since_html', time_ago: time_ago(user.created_at) %>
+ <% if user_detail.last_seen_at %>
+ <%= t 'thredded.users.last_active_html', time_ago: time_ago(user_detail.last_seen_at) %>
+ <% end %>
+ <% if user_detail.topics_count > 0 %>
+ <%= t 'thredded.users.started_topics_count', count: user_detail.topics_count %>
+ <% end %>
+ <% if user_detail.posts_count > 0 %>
+ <%= t 'thredded.users.posts_count', count: user_detail.posts_count %>
+ <% end %>
+ <%= render 'user_moderation_state', user: @user %>
+ <% end %>
+
+ <% end %>
+ <%= view_hooks.moderation_user_page.user_moderation_actions.render self, user: user do %>
+
+ <% unless user_detail.approved? %>
+ <%= button_to t('thredded.moderation.approve_btn'), moderate_user_path,
+ class: 'thredded--button',
+ params: { id: user.to_model.id, moderation_state: 'approved' } %>
+ <% end %>
+ <% unless user_detail.blocked? %>
+ <%= button_to t('thredded.moderation.block_btn'), moderate_user_path,
+ class: 'thredded--button',
+ params: { id: user.to_model.id, moderation_state: 'blocked' } %>
+ <% end %>
+
+ <% end %>
+ <% if @posts.present? %>
+ <%= t 'thredded.users.recent_activity' %>
+ <%= render_posts @posts,
+ partial: 'thredded/moderation/user_post',
+ content_partial: 'thredded/posts/content' %>
+ <%= paginate @posts %>
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/moderation/users.html.erb b/app/views/thredded/moderation/users.html.erb
new file mode 100644
index 00000000..7ec691be
--- /dev/null
+++ b/app/views/thredded/moderation/users.html.erb
@@ -0,0 +1,41 @@
+<% content_for :thredded_page_title, t('thredded.nav.moderation') %>
+<% content_for :thredded_page_id, 'thredded--moderation-users' %>
+<%= render 'nav' %>
+
+<%= thredded_page do %>
+
+ <% if @users.present? %>
+ <% if @query.present? %>
+
+ <%= t 'thredded.moderation.search_users.results_message', query: "'#{@query}'" %>
+
+ <% end %>
+
+ <%= page_entries_info @users %>
+
+
+ User
+ Moderation state
+
+
+
+ <% @users.each do |user| %>
+
+
+ <%= link_to user.thredded_display_name, user_moderation_path(user.id), class: 'thredded--link' %>
+
+
+ <%= render 'user_moderation_state', user: user %>
+
+
+ <% end %>
+
+
+ <%= paginate @users %>
+ <% else %>
+
+ <%= t 'thredded.moderation.search_users.no_results_message', query: "'#{@query}'" %>
+
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/post_mailer/post_notification.html.erb b/app/views/thredded/post_mailer/post_notification.html.erb
new file mode 100644
index 00000000..657f4b62
--- /dev/null
+++ b/app/views/thredded/post_mailer/post_notification.html.erb
@@ -0,0 +1,23 @@
+
+
+
+ <%= @post.user.thredded_display_name %> <%= link_to 'said', post_permalink_url(@post) %>:
+
+ <% cache [@post, 'content-onebox-placeholders'] do %>
+ <%= render partial: 'thredded/posts/content',
+ locals: { post: @post, options: {onebox_placeholders: true} } %>
+ <% end %>
+
+
+
+
+ This email was sent to you because you are following this topic
+ "<%= link_to @post.postable.title, post_permalink_url(@post.id) %>".
+ <%= link_to 'View the conversation here', topic_url(@post.postable) %>.
+
+
+
+ To unsubscribe from these emails, update your
+ <%= link_to 'preferences', edit_messageboard_preferences_url(@post.messageboard) %>.
+
+
diff --git a/app/views/thredded/post_mailer/post_notification.text.erb b/app/views/thredded/post_mailer/post_notification.text.erb
new file mode 100644
index 00000000..0a226443
--- /dev/null
+++ b/app/views/thredded/post_mailer/post_notification.text.erb
@@ -0,0 +1,10 @@
+<%= @post.content %>
+
+---
+
+This email was sent to you because you are following this topic
+"<%= @post.postable.title %>". Go here to view the conversation:
+<%= post_permalink_url @post %>
+
+To unsubscribe from these emails, update your preferences here:
+ <%= edit_messageboard_preferences_url @post.messageboard %>
diff --git a/app/views/thredded/post_previews/preview.html.erb b/app/views/thredded/post_previews/preview.html.erb
new file mode 100644
index 00000000..fa2dc28d
--- /dev/null
+++ b/app/views/thredded/post_previews/preview.html.erb
@@ -0,0 +1 @@
+<%= @post.filtered_content(self) %>
diff --git a/app/views/thredded/post_previews/update.html.erb b/app/views/thredded/post_previews/update.html.erb
new file mode 100644
index 00000000..fa2dc28d
--- /dev/null
+++ b/app/views/thredded/post_previews/update.html.erb
@@ -0,0 +1 @@
+<%= @post.filtered_content(self) %>
diff --git a/app/views/thredded/posts/_content.html.erb b/app/views/thredded/posts/_content.html.erb
new file mode 100644
index 00000000..e7e97058
--- /dev/null
+++ b/app/views/thredded/posts/_content.html.erb
@@ -0,0 +1 @@
+<%= render 'thredded/posts_common/content', post: post, options: local_assigns[:options] || {} %>
diff --git a/app/views/thredded/posts/_form.html.erb b/app/views/thredded/posts/_form.html.erb
new file mode 100644
index 00000000..09f0d31d
--- /dev/null
+++ b/app/views/thredded/posts/_form.html.erb
@@ -0,0 +1,5 @@
+<%= render 'thredded/posts_common/form',
+ post: post,
+ content_label: t('thredded.posts.form.content_label'),
+ button_text: button_text,
+ button_submitting_text: local_assigns.key?(:button_submitting_text) ? button_submitting_text : nil %>
diff --git a/app/views/thredded/posts/_post.html.erb b/app/views/thredded/posts/_post.html.erb
new file mode 100644
index 00000000..0bdf18a9
--- /dev/null
+++ b/app/views/thredded/posts/_post.html.erb
@@ -0,0 +1,13 @@
+<% post, content = post_and_content if local_assigns.key?(:post_and_content) %>
+<%= content_tag :article, id: dom_id(post), class: "thredded--post thredded--#{post.read_state}--post" do %>
+ <%= render 'thredded/posts_common/actions', post: post, actions: local_assigns[:actions] %>
+ <%= render 'thredded/posts_common/header', post: post %>
+ <%= content || render('thredded/posts/content', post: post) %>
+ <% if post.pending_moderation? && !Thredded.content_visible_while_pending_moderation %>
+
<%= t 'thredded.posts.pending_moderation_notice' %>
+ <% elsif post.blocked? && post.can_moderate? %>
+
+ <%= render 'thredded/shared/content_moderation_blocked_state', moderation_record: post.last_moderation_record %>
+
+ <% end %>
+<% end %>
diff --git a/app/views/thredded/posts/_user.html.erb b/app/views/thredded/posts/_user.html.erb
new file mode 100644
index 00000000..b401c5f2
--- /dev/null
+++ b/app/views/thredded/posts/_user.html.erb
@@ -0,0 +1,3 @@
+
+ <%= post.user_posts_count %> posts
+
diff --git a/app/views/thredded/posts/edit.html.erb b/app/views/thredded/posts/edit.html.erb
new file mode 100644
index 00000000..89c8e419
--- /dev/null
+++ b/app/views/thredded/posts/edit.html.erb
@@ -0,0 +1,16 @@
+<% content_for :thredded_page_title, t('thredded.nav.edit_post') %>
+<% content_for :thredded_page_id, 'thredded--edit-post' %>
+<% content_for :thredded_breadcrumbs do %>
+
+ <%= link_to t('thredded.nav.edit_post'), edit_post_path(@post_form.post) %>
+
+<% end %>
+
+<%= thredded_page do %>
+
+ <%= render 'thredded/posts/form',
+ post: @post_form,
+ button_text: t('thredded.posts.form.update_btn'),
+ button_submitting_text: t('thredded.posts.form.update_btn_submitting')%>
+
+<% end %>
diff --git a/app/views/thredded/posts/new.html.erb b/app/views/thredded/posts/new.html.erb
new file mode 100644
index 00000000..bcb533a1
--- /dev/null
+++ b/app/views/thredded/posts/new.html.erb
@@ -0,0 +1,15 @@
+<% content_for :thredded_page_title, @post_form.topic.title %>
+<% content_for :thredded_page_id, 'thredded--topic--new-post' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+
+<%= thredded_page do %>
+
+
+
<%= t('thredded.posts.form.title_label') %>
+ <%= render 'thredded/posts/form',
+ post: @post_form,
+ button_text: t('thredded.posts.form.create_btn'),
+ button_submitting_text: t('thredded.posts.form.create_btn_submitting') %>
+
+
+<% end %>
diff --git a/app/views/thredded/posts_common/_actions.html.erb b/app/views/thredded/posts_common/_actions.html.erb
new file mode 100644
index 00000000..98751421
--- /dev/null
+++ b/app/views/thredded/posts_common/_actions.html.erb
@@ -0,0 +1,28 @@
+<% actions ||= {} %>
+<% actions_html = capture do %>
+ <%= view_hooks.post_common.actions.render self, post: post do %>
+ <% if actions[:quote] && post.can_reply? %>
+ <%= render 'thredded/posts_common/actions/quote', post: post %>
+ <% end %>
+ <% if post.can_update? %>
+ <%= render 'thredded/posts_common/actions/edit', post: post %>
+ <% end %>
+ <% if post.can_destroy? %>
+ <%= render 'thredded/posts_common/actions/delete', post: post %>
+ <% end %>
+ <% if post.read_state %>
+ <%= view_hooks.post_common.mark_as_unread.render self, post: post do %>
+ <%= render 'thredded/posts_common/actions/mark_as_unread', post: post %>
+ <% end %>
+ <% end %>
+ <% end %>
+<% end %>
+
+<%- if actions_html.present? %>
+
+ <%= inline_svg 'thredded/three-dot-menu.svg', class: 'thredded--post--dropdown--toggle' %>
+
+ <%= actions_html %>
+
+
+<% end %>
diff --git a/app/views/thredded/posts_common/_content.html.erb b/app/views/thredded/posts_common/_content.html.erb
new file mode 100644
index 00000000..fff36c61
--- /dev/null
+++ b/app/views/thredded/posts_common/_content.html.erb
@@ -0,0 +1,3 @@
+
+ <%= post.filtered_content(self, local_assigns[:options] || {}) %>
+
diff --git a/app/views/thredded/posts_common/_form.html.erb b/app/views/thredded/posts_common/_form.html.erb
new file mode 100644
index 00000000..cae0fdf0
--- /dev/null
+++ b/app/views/thredded/posts_common/_form.html.erb
@@ -0,0 +1,22 @@
+<%# locals: post, content_label, button_text, button_submitting_text. %>
+<%= form_for post,
+ url: post.submit_path,
+ as: :post,
+ html: {
+ class: 'thredded--form thredded--post-form',
+ 'data-thredded-post-form' => true,
+ 'data-autocomplete-url' => autocomplete_users_path,
+ 'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
+ } do |form| %>
+
+<% end %>
diff --git a/app/views/thredded/posts_common/_header.html.erb b/app/views/thredded/posts_common/_header.html.erb
new file mode 100644
index 00000000..67cbc0eb
--- /dev/null
+++ b/app/views/thredded/posts_common/_header.html.erb
@@ -0,0 +1,8 @@
+<%# @param post [Thredded::PostView] %>
+
diff --git a/app/views/thredded/posts_common/_header_with_topic.html.erb b/app/views/thredded/posts_common/_header_with_topic.html.erb
new file mode 100644
index 00000000..f1b0f781
--- /dev/null
+++ b/app/views/thredded/posts_common/_header_with_topic.html.erb
@@ -0,0 +1,15 @@
+<%# @param post [Thredded::PostView] %>
+<% topic = post.to_model.postable %>
+
diff --git a/app/views/thredded/posts_common/_header_with_user_and_topic.html.erb b/app/views/thredded/posts_common/_header_with_user_and_topic.html.erb
new file mode 100644
index 00000000..2077a409
--- /dev/null
+++ b/app/views/thredded/posts_common/_header_with_user_and_topic.html.erb
@@ -0,0 +1,18 @@
+<%# @param post [Thredded::PostView] %>
+<%# @param post_user_link [String] optional %>
+<% topic = post.to_model.postable %>
+<% post_user_link ||= user_link(post.user) %>
+
diff --git a/app/views/thredded/posts_common/actions/_delete.html.erb b/app/views/thredded/posts_common/actions/_delete.html.erb
new file mode 100644
index 00000000..06b646f5
--- /dev/null
+++ b/app/views/thredded/posts_common/actions/_delete.html.erb
@@ -0,0 +1,4 @@
+<%= button_to t('thredded.posts.delete'), post.destroy_path,
+ method: :delete,
+ class: 'thredded--post--delete thredded--post--dropdown--actions--item',
+ data: {confirm: I18n.t('thredded.posts.delete_confirm')} %>
diff --git a/app/views/thredded/posts_common/actions/_edit.html.erb b/app/views/thredded/posts_common/actions/_edit.html.erb
new file mode 100644
index 00000000..98b1eee7
--- /dev/null
+++ b/app/views/thredded/posts_common/actions/_edit.html.erb
@@ -0,0 +1,3 @@
+<%= link_to t('thredded.posts.edit'), post.edit_path,
+ class: 'thredded--post--edit thredded--post--dropdown--actions--item',
+ rel: 'nofollow' %>
diff --git a/app/views/thredded/posts_common/actions/_mark_as_unread.html.erb b/app/views/thredded/posts_common/actions/_mark_as_unread.html.erb
new file mode 100644
index 00000000..413c53a1
--- /dev/null
+++ b/app/views/thredded/posts_common/actions/_mark_as_unread.html.erb
@@ -0,0 +1,2 @@
+<%= button_to(t('thredded.topics.mark_as_unread'), post.mark_unread_path, method: :post, class:
+ 'thredded--post--mark-as-unread thredded--post--dropdown--actions--item') %>
diff --git a/app/views/thredded/posts_common/actions/_quote.html.erb b/app/views/thredded/posts_common/actions/_quote.html.erb
new file mode 100644
index 00000000..3644b39a
--- /dev/null
+++ b/app/views/thredded/posts_common/actions/_quote.html.erb
@@ -0,0 +1,4 @@
+<%= link_to t('thredded.posts.quote_btn'), url_for(post.quote_url_params),
+ 'data-thredded-quote-post' => post.quote_path,
+ class: 'thredded--post--quote thredded--post--dropdown--actions--item',
+ rel: 'nofollow' %>
diff --git a/app/views/thredded/posts_common/form/_after_content.html.erb b/app/views/thredded/posts_common/form/_after_content.html.erb
new file mode 100644
index 00000000..e69de29b
diff --git a/app/views/thredded/posts_common/form/_before_content.html.erb b/app/views/thredded/posts_common/form/_before_content.html.erb
new file mode 100644
index 00000000..e69de29b
diff --git a/app/views/thredded/posts_common/form/_content.html.erb b/app/views/thredded/posts_common/form/_content.html.erb
new file mode 100644
index 00000000..dbc86392
--- /dev/null
+++ b/app/views/thredded/posts_common/form/_content.html.erb
@@ -0,0 +1,7 @@
+<%= render 'thredded/posts_common/form/content_field',
+ form: form,
+ content_label: content_label %>
+
+<%= render 'thredded/posts_common/form/preview_area',
+ form: form,
+ preview_url: preview_url %>
diff --git a/app/views/thredded/posts_common/form/_content_field.html.erb b/app/views/thredded/posts_common/form/_content_field.html.erb
new file mode 100644
index 00000000..9d7b0dfb
--- /dev/null
+++ b/app/views/thredded/posts_common/form/_content_field.html.erb
@@ -0,0 +1,8 @@
+
+ <%= form.label :content, content_label %>
+ <%= view_hooks.post_form.content_text_area.render self, form: form, content_label: content_label do %>
+ <%= render 'thredded/posts_common/form/before_content', form: form %>
+ <%= form.text_area :content, {rows: 5, required: true} %>
+ <%= render 'thredded/posts_common/form/after_content', form: form %>
+ <% end %>
+
diff --git a/app/views/thredded/posts_common/form/_preview_area.html.erb b/app/views/thredded/posts_common/form/_preview_area.html.erb
new file mode 100644
index 00000000..9f0a23e6
--- /dev/null
+++ b/app/views/thredded/posts_common/form/_preview_area.html.erb
@@ -0,0 +1,16 @@
+<%= view_hooks.post_form.preview_area.render self, form: form, preview_url: preview_url do %>
+
+
+
+ <%= t 'thredded.form.preview' %>
+
+
+
+
+
<%= t 'thredded.form.preview' %>
+
+
+
+<% end %>
diff --git a/app/views/thredded/preferences/_form.html.erb b/app/views/thredded/preferences/_form.html.erb
new file mode 100644
index 00000000..e50b78fb
--- /dev/null
+++ b/app/views/thredded/preferences/_form.html.erb
@@ -0,0 +1,95 @@
+<%# @type preferences [Thredded::UserPreferencesForm] %>
+<%= form_for(preferences, method: :patch, url: preferences.update_path, html: {
+ class: 'thredded--form thredded--notification-preferences-form',
+ 'data-thredded-user-preferences-form' => true
+}) do |f| %>
+
+ <% if preferences.messageboard %>
+
+ <%= t 'thredded.preferences.messageboard_preferences_title_html', messageboard: messageboard.name %>
+
+
+ <% end %>
+
+ <%= t 'thredded.preferences.form.submit_btn' %>
+
+<% end %>
diff --git a/app/views/thredded/preferences/_messageboards_nav.html.erb b/app/views/thredded/preferences/_messageboards_nav.html.erb
new file mode 100644
index 00000000..953012ef
--- /dev/null
+++ b/app/views/thredded/preferences/_messageboards_nav.html.erb
@@ -0,0 +1,8 @@
+<% preferences.messageboard_groups.each do |group| %>
+
<%= group.name %>
+
+ <%= render partial: 'thredded/preferences/messageboards_nav_item',
+ collection: group.messageboards,
+ as: :messageboard %>
+
+<% end %>
diff --git a/app/views/thredded/preferences/_messageboards_nav_item.html.erb b/app/views/thredded/preferences/_messageboards_nav_item.html.erb
new file mode 100644
index 00000000..6deb96b3
--- /dev/null
+++ b/app/views/thredded/preferences/_messageboards_nav_item.html.erb
@@ -0,0 +1,2 @@
+<%= link_to messageboard.name, edit_messageboard_preferences_path(messageboard),
+ class: 'thredded--preferences--messageboards-nav--item thredded--messageboard' %>
diff --git a/app/views/thredded/preferences/edit.html.erb b/app/views/thredded/preferences/edit.html.erb
new file mode 100644
index 00000000..5388b824
--- /dev/null
+++ b/app/views/thredded/preferences/edit.html.erb
@@ -0,0 +1,20 @@
+<% content_for :thredded_page_title, t('thredded.preferences.edit.page_title') %>
+<% content_for :thredded_page_id, 'thredded--preferences' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+
+<%= thredded_page do %>
+
+
+ <% unless preferences.messageboard %>
+
+
+ <%= t 'thredded.preferences.messageboard_preferences_nav_title' %>
+
+ <%= render 'thredded/preferences/messageboards_nav', preferences: @preferences %>
+
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/private_post_previews/preview.html.erb b/app/views/thredded/private_post_previews/preview.html.erb
new file mode 100644
index 00000000..4bc2d273
--- /dev/null
+++ b/app/views/thredded/private_post_previews/preview.html.erb
@@ -0,0 +1 @@
+<%= @private_post.filtered_content(self) %>
diff --git a/app/views/thredded/private_post_previews/update.html.erb b/app/views/thredded/private_post_previews/update.html.erb
new file mode 100644
index 00000000..4bc2d273
--- /dev/null
+++ b/app/views/thredded/private_post_previews/update.html.erb
@@ -0,0 +1 @@
+<%= @private_post.filtered_content(self) %>
diff --git a/app/views/thredded/private_posts/_content.html.erb b/app/views/thredded/private_posts/_content.html.erb
new file mode 100644
index 00000000..e7e97058
--- /dev/null
+++ b/app/views/thredded/private_posts/_content.html.erb
@@ -0,0 +1 @@
+<%= render 'thredded/posts_common/content', post: post, options: local_assigns[:options] || {} %>
diff --git a/app/views/thredded/private_posts/_form.html.erb b/app/views/thredded/private_posts/_form.html.erb
new file mode 100644
index 00000000..1f2fbf8c
--- /dev/null
+++ b/app/views/thredded/private_posts/_form.html.erb
@@ -0,0 +1,6 @@
+<%# TODO: For private topics, only autocomplete users in this private topic %>
+<%= render 'thredded/posts_common/form',
+ post: post,
+ button_text: t('thredded.private_posts.form.create_btn'),
+ button_submitting_text: t('thredded.private_posts.form.create_btn_submitting'),
+ content_label: t('thredded.private_posts.form.content_label') %>
diff --git a/app/views/thredded/private_posts/_private_post.html.erb b/app/views/thredded/private_posts/_private_post.html.erb
new file mode 100644
index 00000000..6595cb36
--- /dev/null
+++ b/app/views/thredded/private_posts/_private_post.html.erb
@@ -0,0 +1,6 @@
+<% private_post, content = post_and_content if local_assigns.key?(:post_and_content) %>
+<%= content_tag :article, id: dom_id(private_post), class: 'thredded--post' do %>
+ <%= render 'thredded/posts_common/actions', post: private_post, actions: local_assigns[:actions] %>
+ <%= render 'thredded/posts_common/header', post: private_post %>
+ <%= content || render('thredded/private_posts/content', post: post) %>
+<% end %>
diff --git a/app/views/thredded/private_posts/edit.html.erb b/app/views/thredded/private_posts/edit.html.erb
new file mode 100644
index 00000000..89c8e419
--- /dev/null
+++ b/app/views/thredded/private_posts/edit.html.erb
@@ -0,0 +1,16 @@
+<% content_for :thredded_page_title, t('thredded.nav.edit_post') %>
+<% content_for :thredded_page_id, 'thredded--edit-post' %>
+<% content_for :thredded_breadcrumbs do %>
+
+ <%= link_to t('thredded.nav.edit_post'), edit_post_path(@post_form.post) %>
+
+<% end %>
+
+<%= thredded_page do %>
+
+ <%= render 'thredded/posts/form',
+ post: @post_form,
+ button_text: t('thredded.posts.form.update_btn'),
+ button_submitting_text: t('thredded.posts.form.update_btn_submitting')%>
+
+<% end %>
diff --git a/app/views/thredded/private_posts/new.html.erb b/app/views/thredded/private_posts/new.html.erb
new file mode 100644
index 00000000..22e47e4e
--- /dev/null
+++ b/app/views/thredded/private_posts/new.html.erb
@@ -0,0 +1,11 @@
+<% private_topic = @post_form.topic %>
+<% content_for :thredded_page_title, private_topic.title %>
+<% content_for :thredded_page_id, 'thredded--private-topic--new_post' %>
+<% content_for :thredded_breadcrumbs, render('thredded/private_topics/breadcrumbs') %>
+
+<%= thredded_page do %>
+
+ <%= render 'thredded/private_posts/form',
+ post: @post_form %>
+
+<% end %>
diff --git a/app/views/thredded/private_topic_mailer/message_notification.html.erb b/app/views/thredded/private_topic_mailer/message_notification.html.erb
new file mode 100644
index 00000000..bd43d36c
--- /dev/null
+++ b/app/views/thredded/private_topic_mailer/message_notification.html.erb
@@ -0,0 +1,20 @@
+
+
+
+ <%= @post.user.thredded_display_name %> <%= link_to 'said', private_post_permalink_url(@post) %>:
+
+ <% cache [@post, 'content-onebox-placeholders'] do %>
+ <%= render partial: 'thredded/private_posts/content',
+ locals: { post: @post, options: {onebox_placeholders: true} } %>
+ <% end %>
+
+
+
+ This email was sent to you because <%= @topic.user.thredded_display_name %> included you in a
+ private topic, "<%= link_to @topic.title, private_topic_url(@topic) %>".
+
+
+
+ To unsubscribe from these emails, update your <%= link_to 'preferences', edit_preferences_url %>.
+
+
diff --git a/app/views/thredded/private_topic_mailer/message_notification.text.erb b/app/views/thredded/private_topic_mailer/message_notification.text.erb
new file mode 100644
index 00000000..1aeb6959
--- /dev/null
+++ b/app/views/thredded/private_topic_mailer/message_notification.text.erb
@@ -0,0 +1,12 @@
+<%= @post.user.thredded_display_name %> said:
+<%= @post.content %>
+---
+
+This email was sent to you because <%= @topic.user.thredded_display_name %>
+included you in the private topic "<%= @topic.title %>".
+
+Go here to view the conversation:
+ <%= private_post_permalink_url(@post) %>
+
+To unsubscribe from these emails, update your preferences here:
+ <%= edit_preferences_url %>
diff --git a/app/views/thredded/private_topic_previews/preview.html.erb b/app/views/thredded/private_topic_previews/preview.html.erb
new file mode 100644
index 00000000..4bc2d273
--- /dev/null
+++ b/app/views/thredded/private_topic_previews/preview.html.erb
@@ -0,0 +1 @@
+<%= @private_post.filtered_content(self) %>
diff --git a/app/views/thredded/private_topics/_breadcrumbs.html.erb b/app/views/thredded/private_topics/_breadcrumbs.html.erb
new file mode 100644
index 00000000..9475c271
--- /dev/null
+++ b/app/views/thredded/private_topics/_breadcrumbs.html.erb
@@ -0,0 +1,4 @@
+
+ <%= link_to t('thredded.nav.all_messageboards'), messageboards_path -%>
+ <%= link_to t('thredded.nav.private_topics'), private_topics_path -%>
+
diff --git a/app/views/thredded/private_topics/_form.html.erb b/app/views/thredded/private_topics/_form.html.erb
new file mode 100644
index 00000000..59713acb
--- /dev/null
+++ b/app/views/thredded/private_topics/_form.html.erb
@@ -0,0 +1,39 @@
+<%= form_for private_topic,
+ url: private_topic.submit_path,
+ html: {
+ class: "thredded--form thredded--new-private-topic-form #{local_assigns[:css_class]}",
+ 'data-thredded-topic-form' => true,
+ # TODO: only autocomplete users in this private topic
+ 'data-autocomplete-url' => autocomplete_users_path,
+ 'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
+ } do |form| %>
+
+
+<% end %>
+
diff --git a/app/views/thredded/private_topics/_header.html.erb b/app/views/thredded/private_topics/_header.html.erb
new file mode 100644
index 00000000..9fe042cd
--- /dev/null
+++ b/app/views/thredded/private_topics/_header.html.erb
@@ -0,0 +1,17 @@
+
diff --git a/app/views/thredded/private_topics/_no_private_topics.html.erb b/app/views/thredded/private_topics/_no_private_topics.html.erb
new file mode 100644
index 00000000..8c1eb892
--- /dev/null
+++ b/app/views/thredded/private_topics/_no_private_topics.html.erb
@@ -0,0 +1,6 @@
+
diff --git a/app/views/thredded/private_topics/_private_topic.html.erb b/app/views/thredded/private_topics/_private_topic.html.erb
new file mode 100644
index 00000000..5c4938ab
--- /dev/null
+++ b/app/views/thredded/private_topics/_private_topic.html.erb
@@ -0,0 +1,23 @@
+<%= content_tag :article,
+ id: dom_id(private_topic),
+ class: ['thredded--topics--topic', *topic_css_classes(private_topic)] do %>
+
<%= private_topic.posts_count %>
+
+
+ <%= link_to private_topic.title, private_topic.path %>
+
+
+
+ <%= time_ago private_topic.last_post_at %>
+
+ <%= render partial: 'thredded/private_topics/private_topic/participant',
+ collection: [private_topic.last_user, *(private_topic.users - [private_topic.last_user])] %>
+
+
+
+
+ <%= time_ago private_topic.created_at %>
+ <%= user_link private_topic.user %>
+
+<% end %>
+
diff --git a/app/views/thredded/private_topics/edit.html.erb b/app/views/thredded/private_topics/edit.html.erb
new file mode 100644
index 00000000..89e7a3ce
--- /dev/null
+++ b/app/views/thredded/private_topics/edit.html.erb
@@ -0,0 +1,35 @@
+<% content_for :thredded_page_title, t('thredded.nav.edit_private_topic') %>
+<% content_for :thredded_page_id, 'thredded--edit-private-topic' %>
+<% content_for :thredded_breadcrumbs do %>
+
+ <%= link_to t('thredded.nav.all_messageboards'), messageboards_path %>
+ <%= link_to t('thredded.nav.private_topics'), private_topics_path %>
+ <%= link_to @private_topic.title, topic_path(@private_topic) %>
+ <%= link_to t('thredded.nav.edit_private_topic'), edit_private_topic_path(@private_topic) %>
+
+<% end %>
+
+
+<%= thredded_page do %>
+
+ <%= form_for @private_topic,
+ url: private_topic_path(@private_topic),
+ html: { class: 'thredded--form', 'data-thredded-topic-form' => true } do |form| %>
+
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/private_topics/header/_participant.html.erb b/app/views/thredded/private_topics/header/_participant.html.erb
new file mode 100644
index 00000000..cc8d4f26
--- /dev/null
+++ b/app/views/thredded/private_topics/header/_participant.html.erb
@@ -0,0 +1 @@
+
diff --git a/app/views/thredded/private_topics/index.html.erb b/app/views/thredded/private_topics/index.html.erb
new file mode 100644
index 00000000..6f8a926d
--- /dev/null
+++ b/app/views/thredded/private_topics/index.html.erb
@@ -0,0 +1,32 @@
+<% content_for :thredded_page_title, t('thredded.nav.private_topics') %>
+<% content_for :thredded_page_id, 'thredded--private-topics-index' %>
+<% content_for :thredded_breadcrumbs, render('thredded/private_topics/breadcrumbs') %>
+
+<%= thredded_page do %>
+ <%= content_tag :section,
+ class: 'thredded--main-section thredded--private-topics',
+ 'data-thredded-topics' => true do %>
+
+ <% if @private_topics.empty? -%>
+ <%= render 'thredded/private_topics/no_private_topics' %>
+ <% else -%>
+ <%= render 'thredded/private_topics/form',
+ private_topic: @new_private_topic,
+ css_class: 'thredded--is-compact',
+ placeholder: t('thredded.private_topics.form.title_placeholder_start') if @new_private_topic %>
+
+ <%= render @private_topics %>
+
+ <% unless unread_private_topics_count.zero? %>
+ <%= link_to t('thredded.nav.mark_all_read'),
+ mark_all_private_topics_read_path,
+ class: 'thredded--button thredded--button-light thredded--button-wide',
+ method: :put -%>
+ <% end %>
+ <% end -%>
+ <% end %>
+
+
+<% end %>
diff --git a/app/views/thredded/private_topics/new.html.erb b/app/views/thredded/private_topics/new.html.erb
new file mode 100644
index 00000000..89c935ce
--- /dev/null
+++ b/app/views/thredded/private_topics/new.html.erb
@@ -0,0 +1,11 @@
+<% content_for :thredded_page_title, 'Create a New Private Topic' %>
+<% content_for :thredded_page_id, 'thredded--new-private-topic' %>
+<% content_for :thredded_breadcrumbs, render('thredded/private_topics/breadcrumbs') %>
+
+<%= thredded_page do %>
+
+ <%= render 'thredded/private_topics/form',
+ private_topic: @private_topic,
+ placeholder: t('thredded.private_topics.form.title_placeholder_new') if @private_topic %>
+
+<% end %>
diff --git a/app/views/thredded/private_topics/private_topic/_participant.html.erb b/app/views/thredded/private_topics/private_topic/_participant.html.erb
new file mode 100644
index 00000000..14624fe4
--- /dev/null
+++ b/app/views/thredded/private_topics/private_topic/_participant.html.erb
@@ -0,0 +1 @@
+
<%= user_link participant %>
diff --git a/app/views/thredded/private_topics/show.html.erb b/app/views/thredded/private_topics/show.html.erb
new file mode 100644
index 00000000..8a2309de
--- /dev/null
+++ b/app/views/thredded/private_topics/show.html.erb
@@ -0,0 +1,28 @@
+<% private_topic = @posts.topic %>
+<% content_for :thredded_page_title, private_topic.title %>
+<% content_for :thredded_page_id, 'thredded--private-topic-show' %>
+<% content_for :thredded_breadcrumbs, render('thredded/private_topics/breadcrumbs') %>
+
+<%= thredded_page do %>
+ <%= content_tag :section,
+ id: dom_id(private_topic),
+ class: ['thredded--main-section', 'thredded--topic', *topic_css_classes(private_topic)] do %>
+ <%= render 'thredded/private_topics/header', topic: private_topic %>
+ <%= view_hooks.posts_common.pagination_top.render(self, posts: @posts) do %>
+
+ <% end %>
+ <%= render_posts @posts,
+ partial: 'thredded/private_posts/private_post',
+ content_partial: 'thredded/private_posts/content',
+ locals: { actions: { quote: true } } %>
+ <%= view_hooks.posts_common.pagination_bottom.render(self, posts: @posts) do %>
+
+ <% end %>
+
+ <% if policy(@new_post.post).create? %>
+ <%= render 'thredded/private_posts/form',
+ topic: private_topic,
+ post: @new_post %>
+ <% end %>
+ <% end %>
+<% end %>
diff --git a/app/views/thredded/search/_form.html.erb b/app/views/thredded/search/_form.html.erb
new file mode 100644
index 00000000..a35db94e
--- /dev/null
+++ b/app/views/thredded/search/_form.html.erb
@@ -0,0 +1,13 @@
+<%= form_tag search_path(messageboard),
+ method: 'get',
+ class: 'thredded--form thredded--navigation--search thredded--navigation--search-topics',
+ 'data-thredded-turboform' => true do %>
+ <%= label_tag :q, t('thredded.search.form.label') %>
+ <%= text_field_tag :q, @query,
+ type: 'search',
+ required: true,
+ # If there are no results the user will likely want to change the query, so auto-focus.
+ autofocus: @query.presence && !@topics.presence,
+ placeholder: t('thredded.search.form.placeholder') %>
+
<%= t 'thredded.search.form.btn_submit' %>
+<% end %>
diff --git a/app/views/thredded/shared/_breadcrumbs.html.erb b/app/views/thredded/shared/_breadcrumbs.html.erb
new file mode 100644
index 00000000..a39bc580
--- /dev/null
+++ b/app/views/thredded/shared/_breadcrumbs.html.erb
@@ -0,0 +1,6 @@
+
+ <%= link_to t('thredded.nav.all_messageboards'), messageboards_path %>
+ <% if messageboard_or_nil.try(:persisted?) %>
+ <%= link_to messageboard.name, messageboard_topics_path(messageboard) %>
+ <% end %>
+
diff --git a/app/views/thredded/shared/_content_moderation_blocked_state.html.erb b/app/views/thredded/shared/_content_moderation_blocked_state.html.erb
new file mode 100644
index 00000000..7bae4425
--- /dev/null
+++ b/app/views/thredded/shared/_content_moderation_blocked_state.html.erb
@@ -0,0 +1,8 @@
+<% # @param moderation_record [Thredded::PostModerationRecord, nil] %>
+<% if moderation_record %>
+ <%= t 'thredded.content_moderation_states.content_blocked_notice_with_record_html',
+ moderator: user_link(moderation_record.moderator),
+ time_ago: time_ago(moderation_record.created_at) %>
+<% else %>
+ <%= t 'thredded.content_moderation_states.content_blocked_notice' %>
+<% end %>
diff --git a/app/views/thredded/shared/_currently_online.html.erb b/app/views/thredded/shared/_currently_online.html.erb
new file mode 100644
index 00000000..80069fc2
--- /dev/null
+++ b/app/views/thredded/shared/_currently_online.html.erb
@@ -0,0 +1,18 @@
+<% if (users = active_users).present? %>
+
+
+
+ <%= t "thredded.users.currently_online" %>
+
+
+
+
+ <% users.each do |user| %>
+
+
+ <%= user.thredded_display_name %>
+
+ <% end %>
+
+
+<% end %>
diff --git a/app/views/thredded/shared/_flash_messages.html.erb b/app/views/thredded/shared/_flash_messages.html.erb
new file mode 100644
index 00000000..09dbd2bc
--- /dev/null
+++ b/app/views/thredded/shared/_flash_messages.html.erb
@@ -0,0 +1,7 @@
+<% [:success, :error, :notice, :alert].each do |key| %>
+ <% if flash[key] %>
+
+ <%= flash[key] %>
+
+ <% end %>
+<% end %>
diff --git a/app/views/thredded/shared/_header.html.erb b/app/views/thredded/shared/_header.html.erb
new file mode 100644
index 00000000..cee228a6
--- /dev/null
+++ b/app/views/thredded/shared/_header.html.erb
@@ -0,0 +1,3 @@
+
+ <%= render 'thredded/shared/nav' %>
+
diff --git a/app/views/thredded/shared/_nav.html.erb b/app/views/thredded/shared/_nav.html.erb
new file mode 100644
index 00000000..3ae70124
--- /dev/null
+++ b/app/views/thredded/shared/_nav.html.erb
@@ -0,0 +1,17 @@
+
+
+ <%= render 'thredded/shared/nav/moderation' %>
+ <%= render 'thredded/shared/nav/notification_preferences', messageboard: messageboard_or_nil %>
+ <%= render 'thredded/shared/nav/private_topics' %>
+ <%= render 'thredded/shared/nav/standalone_profile' if thredded_signed_in? %>
+ <%= render 'thredded/shared/nav/standalone' %>
+
+ <% if content_for? :thredded_main_navigation %>
+ <%= yield :thredded_main_navigation %>
+ <% else %>
+
+ <%= yield :thredded_breadcrumbs %>
+ <%= render 'thredded/search/form', messageboard: messageboard_or_nil %>
+
+ <% end %>
+
diff --git a/app/views/thredded/shared/_page.html.erb b/app/views/thredded/shared/_page.html.erb
new file mode 100644
index 00000000..d9f5a7e6
--- /dev/null
+++ b/app/views/thredded/shared/_page.html.erb
@@ -0,0 +1,15 @@
+<%= content_tag(:div, id: 'thredded--container', class: thredded_container_classes, data: thredded_container_data) do %>
+ <%= render 'thredded/shared/header' %>
+ <%= render 'thredded/shared/flash_messages' %>
+ <%= yield :thredded_page_content %>
+ <%= render 'thredded/shared/currently_online' %>
+<%- end %>
+
+<%# If thredded JS is loaded via an [async] script, the JS may
+run before or after DOMContentLoaded. Expose a flag to Thredded
+so it can initialize correctly. %>
+
diff --git a/app/views/thredded/shared/nav/_bar.html.erb b/app/views/thredded/shared/nav/_bar.html.erb
new file mode 100644
index 00000000..ba3530d8
--- /dev/null
+++ b/app/views/thredded/shared/nav/_bar.html.erb
@@ -0,0 +1,37 @@
+
+
+ <%= link_to main_app.root_path do %>
+ ‹ Back to Notebook.ai
+
+ <%= link_to 'Discussions Home', main_app.thredded_path %>
+ <% end %>
+
+
+ <% if user_signed_in? %>
+ <% if thredded_current_user.username.blank? %>
+ <%= link_to 'Claim your username!', main_app.edit_user_registration_path(thredded_current_user) %>
+ <% else %>
+ Hello,
+ <%= link_to thredded_current_user.thredded_display_name, current_user %>!
+ <% end %>
+ <% end %>
+
+
+
+
+
+
diff --git a/app/views/thredded/shared/nav/_moderation.html.erb b/app/views/thredded/shared/nav/_moderation.html.erb
new file mode 100644
index 00000000..bd5dda12
--- /dev/null
+++ b/app/views/thredded/shared/nav/_moderation.html.erb
@@ -0,0 +1,14 @@
+<% if moderatable_messageboards_ids.present? %>
+ <% current = current_page_moderation? %>
+
+ <%= link_to (current ? messageboards_path : pending_moderation_path), rel: 'nofollow' do %>
+ <%= inline_svg 'thredded/moderation.svg',
+ class: 'thredded--icon',
+ title: t('thredded.nav.moderation') %>
+ <%= t 'thredded.nav.moderation' %>
+ <% if posts_pending_moderation_count > 0 %>
+ <%= posts_pending_moderation_count %>
+ <% end %>
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/shared/nav/_notification_preferences.html.erb b/app/views/thredded/shared/nav/_notification_preferences.html.erb
new file mode 100644
index 00000000..1fa97f93
--- /dev/null
+++ b/app/views/thredded/shared/nav/_notification_preferences.html.erb
@@ -0,0 +1,8 @@
+<% current = current_page_preferences? %>
+
+ <%= link_to current ? (messageboard ? messageboard_topics_path(messageboard) : messageboards_path)
+ : edit_preferences_path(messageboard), rel: 'nofollow' do %>
+ <%= inline_svg 'thredded/settings.svg', class: 'thredded--icon', title: t('thredded.nav.settings') %>
+ <%= t('thredded.nav.settings') %>
+ <% end %>
+
diff --git a/app/views/thredded/shared/nav/_private_topics.html.erb b/app/views/thredded/shared/nav/_private_topics.html.erb
new file mode 100644
index 00000000..8944acac
--- /dev/null
+++ b/app/views/thredded/shared/nav/_private_topics.html.erb
@@ -0,0 +1,12 @@
+<% current = current_page_private_topics? %>
+
+ <%= link_to (current ? messageboards_path : private_topics_path), rel: 'nofollow' do %>
+ <%= inline_svg 'thredded/private-messages.svg',
+ class: 'thredded--icon',
+ title: t('thredded.nav.private_topics') %>
+ <%= t('thredded.nav.private_topics') %>
+ <% if unread_private_topics_count > 0 -%>
+ <%= unread_private_topics_count %>
+ <% end -%>
+ <% end -%>
+
diff --git a/app/views/thredded/shared/nav/_standalone.html.erb b/app/views/thredded/shared/nav/_standalone.html.erb
new file mode 100644
index 00000000..543eb762
--- /dev/null
+++ b/app/views/thredded/shared/nav/_standalone.html.erb
@@ -0,0 +1,12 @@
+
+ <% resource_name = Thredded.user_class_name.underscore %>
+ <% if thredded_signed_in? %>
+ <%= link_to main_app.send(:"destroy_#{resource_name}_session_path") do %>
+ Sign Out
+ <% end %>
+ <% else %>
+ <%= link_to main_app.send(:"new_#{resource_name}_session_path") do %>
+ Sign In / Register
+ <% end %>
+ <% end %>
+
diff --git a/app/views/thredded/shared/nav/_standalone_profile.html.erb b/app/views/thredded/shared/nav/_standalone_profile.html.erb
new file mode 100644
index 00000000..0d9d8b05
--- /dev/null
+++ b/app/views/thredded/shared/nav/_standalone_profile.html.erb
@@ -0,0 +1,3 @@
+
+ <%= link_to thredded_current_user.thredded_display_name, user_path(thredded_current_user) %>
+
diff --git a/app/views/thredded/shared/preview.html.erb b/app/views/thredded/shared/preview.html.erb
new file mode 100644
index 00000000..1549e9b0
--- /dev/null
+++ b/app/views/thredded/shared/preview.html.erb
@@ -0,0 +1,10 @@
+<% content_for :thredded_page_title, t('thredded.form.preview') %>
+<% content_for :thredded_page_id, 'thredded--post-preview' %>
+
+<%# The noscript version of a post preview %>
+<%= thredded_page do %>
+
<%= t 'thredded.form.preview' %>
+
+ <%= @preview_content %>
+
+<% end %>
diff --git a/app/views/thredded/theme_previews/_section_title.html.erb b/app/views/thredded/theme_previews/_section_title.html.erb
new file mode 100644
index 00000000..1cab479a
--- /dev/null
+++ b/app/views/thredded/theme_previews/_section_title.html.erb
@@ -0,0 +1,3 @@
+
diff --git a/app/views/thredded/theme_previews/show.html.erb b/app/views/thredded/theme_previews/show.html.erb
new file mode 100644
index 00000000..625a4416
--- /dev/null
+++ b/app/views/thredded/theme_previews/show.html.erb
@@ -0,0 +1,97 @@
+<% content_for :thredded_page_title, 'Theme Preview' %>
+<% content_for :thredded_page_id, 'thredded--theme' %>
+<% content_for :thredded_breadcrumbs do %>
+
+ <%= link_to 'Theme Preview', theme_preview_path %>
+
+<% end %>
+
+<%= thredded_page do %>
+ <%= render 'section_title', label: 'messageboards#index', href: messageboards_path %>
+ <%= content_tag :section, class: 'thredded--thredded--main-section thredded--messageboards' do %>
+ <%= render @messageboards %>
+
+ <% end %>
+
+
+ <%= render 'section_title', label: 'topics#index', href: messageboard_topics_path(@messageboard) %>
+ <%= content_tag :section, class: 'thredded--thredded--main-section topics' do %>
+ <%= render 'thredded/topics/form',
+ topic: @new_topic,
+ css_class: 'thredded--is-compact',
+ placeholder: 'Start a New Topic' %>
+ <%= render @topics %>
+ <% end %>
+
+ <%= paginate @topics %>
+
+
+
+
+ <%= render 'section_title', label: 'topics#show', href: @topic.path %>
+ <%= content_tag :section, id: dom_id(@topic), class: ['thredded--thredded--main-section', topic_css_classes(@topic)] do %>
+ <%= render 'thredded/topics/header', topic: @topic %>
+ <%= render @posts %>
+ <%= render 'thredded/posts/form',
+ post: @new_post,
+ button_text: t('thredded.posts.form.create_btn')
+ %>
+ <% end %>
+
+ <%= render 'section_title', label: 'topics#new', href: new_messageboard_topic_path(@messageboard) %>
+ <%= render 'thredded/topics/form',
+ topic: @new_topic,
+ placeholder: 'Start a New Topic' %>
+
+ <%= render 'section_title', label: 'posts#edit', href: edit_messageboard_topic_post_path(@messageboard, @post.postable, @post) %>
+ <%= content_tag :section, class: 'thredded--thredded--main-section posts-form' do %>
+
Edit Post
+
+ <%= render 'thredded/posts/form',
+ post: @post_form,
+ button_text: t('thredded.posts.form.update_btn')
+ %>
+ <% end %>
+
+ <%= render 'section_title', label: 'private_topics#index', href: private_topics_path %>
+ <%= content_tag :section, class: 'thredded--thredded--main-section private-topics' do %>
+
If the user has no private topics:
+ <%= render 'thredded/private_topics/no_private_topics' %>
+
+
+
+
If the user has private topics:
+ <%= render 'thredded/private_topics/form',
+ private_topic: @new_private_topic,
+ css_class: 'thredded--is-compact',
+ placeholder: t('thredded.private_topics.form.title_placeholder_start') %>
+ <%= render @private_topics %>
+ <% end %>
+
+ <%= render 'section_title', label: 'private_topics#new', href: new_private_topic_path %>
+
+ <%= render 'thredded/private_topics/form',
+ private_topic: @new_private_topic,
+ placeholder: t('thredded.private_topics.form.title_placeholder_new') %>
+
+
+ <%= render 'section_title', label: 'private_topics#show', href: private_topic_path(@private_topic) %>
+
+ <%= render 'thredded/private_topics/header', topic: @private_topic %>
+ <%= render @private_posts %>
+ <%= render 'thredded/private_posts/form',
+ post: @private_post_form,
+ button_text: t('thredded.private_posts.form.create_btn')
+ %>
+
+
+ <%= render 'section_title', label: 'preferences#edit', href: edit_messageboard_preferences_path(@messageboard) %>
+ <%= content_tag :section, class: 'thredded--thredded--main-section preferences' do %>
+
+ <%= render 'thredded/preferences/form', preferences: @preferences %>
+ <% end %>
+
+ <%= render 'thredded/shared/currently_online' %>
+<% end %>
diff --git a/app/views/thredded/topic_previews/preview.html.erb b/app/views/thredded/topic_previews/preview.html.erb
new file mode 100644
index 00000000..fa2dc28d
--- /dev/null
+++ b/app/views/thredded/topic_previews/preview.html.erb
@@ -0,0 +1 @@
+<%= @post.filtered_content(self) %>
diff --git a/app/views/thredded/topics/_followers.html.erb b/app/views/thredded/topics/_followers.html.erb
new file mode 100644
index 00000000..2e1eb29b
--- /dev/null
+++ b/app/views/thredded/topics/_followers.html.erb
@@ -0,0 +1,12 @@
+<% if Thredded.show_topic_followers %>
+
+ <% if topic.followers.present? %>
+ <%= t('thredded.topics.followed_by')%>
+ <% topic.followers.each do |user| %>
+ <%= user_mention(user) %>
+ <% end %>
+ <% else %>
+ <%= t('thredded.topics.followed_by_noone')%>
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/topics/_form.html.erb b/app/views/thredded/topics/_form.html.erb
new file mode 100644
index 00000000..30bd380d
--- /dev/null
+++ b/app/views/thredded/topics/_form.html.erb
@@ -0,0 +1,32 @@
+<%= form_for topic,
+ url: topic.submit_path,
+ html: {
+ class: "thredded--form thredded--new-topic-form #{local_assigns[:css_class]}",
+ 'data-thredded-topic-form' => true,
+ 'data-autocomplete-url' => autocomplete_users_path,
+ 'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
+ } do |form| %>
+
+<% end %>
diff --git a/app/views/thredded/topics/_header.html.erb b/app/views/thredded/topics/_header.html.erb
new file mode 100644
index 00000000..d6211f8e
--- /dev/null
+++ b/app/views/thredded/topics/_header.html.erb
@@ -0,0 +1,32 @@
+
diff --git a/app/views/thredded/topics/_sticky_topics_divider.html.erb b/app/views/thredded/topics/_sticky_topics_divider.html.erb
new file mode 100644
index 00000000..b62b7026
--- /dev/null
+++ b/app/views/thredded/topics/_sticky_topics_divider.html.erb
@@ -0,0 +1 @@
+
diff --git a/app/views/thredded/topics/_topic.html.erb b/app/views/thredded/topics/_topic.html.erb
new file mode 100644
index 00000000..62f0bb26
--- /dev/null
+++ b/app/views/thredded/topics/_topic.html.erb
@@ -0,0 +1,46 @@
+<%= content_tag :article,
+ id: dom_id(topic),
+ class: ['thredded--topics--topic', topic_css_classes(topic)],
+ data: {topic: topic.id, messageboard: topic.messageboard_id} do %>
+
<%= topic.posts_count %>
+
+
+
+ <% if topic.followed? %>
+
+ <% else %>
+
+ <% end %>
+
+
+
+
+ <%= link_to topic.title, topic.path %>
+
+
+ <% if topic.categories.any? %>
+
+ <%= render topic.categories %>
+
+ <% end %>
+
+
+ <%= time_ago topic.last_post_at %>
+ <%= user_link topic.last_user %>
+
+
+
+ <%= time_ago topic.created_at %>
+ <%= user_link topic.user %>
+
+
+ <% if topic.blocked? && topic.can_moderate? %>
+
+ <%= render 'thredded/shared/content_moderation_blocked_state', moderation_record: topic.last_moderation_record %>
+
+ <% end %>
+<% end %>
+
+<% if !topic_iteration.last? && topic.sticky? && !topics[topic_counter + 1].sticky? %>
+ <%= render 'thredded/topics/sticky_topics_divider' %>
+<% end %>
diff --git a/app/views/thredded/topics/_topic_form_admin_options.html.erb b/app/views/thredded/topics/_topic_form_admin_options.html.erb
new file mode 100644
index 00000000..520d586b
--- /dev/null
+++ b/app/views/thredded/topics/_topic_form_admin_options.html.erb
@@ -0,0 +1,12 @@
+<% topic = form.object.respond_to?(:topic) ? form.object.topic : form.object %>
+<% if policy(topic).moderate? %>
+
+ <%= form.label :locked do %>
+ <%= form.check_box :locked %> <%= t 'thredded.topics.locked.label' %>
+ <% end %>
+
+ <%= form.label :sticky do %>
+ <%= form.check_box :sticky %> <%= t 'thredded.topics.sticky.label' %>
+ <% end %>
+
+<% end %>
diff --git a/app/views/thredded/topics/edit.html.erb b/app/views/thredded/topics/edit.html.erb
new file mode 100644
index 00000000..0e341882
--- /dev/null
+++ b/app/views/thredded/topics/edit.html.erb
@@ -0,0 +1,50 @@
+<% content_for :thredded_page_title, t('thredded.nav.edit_topic') %>
+<% content_for :thredded_page_id, 'thredded--edit-topic' %>
+<% content_for :thredded_breadcrumbs do %>
+
+ <%= link_to t('thredded.nav.all_messageboards'), messageboards_path %>
+ <%= link_to messageboard.name, @edit_topic.messageboard_path %>
+ <%= link_to @edit_topic.title, @edit_topic.path %>
+ <%= link_to t('thredded.nav.edit_topic'), @edit_topic.edit_path %>
+
+<% end %>
+
+<%= thredded_page do %>
+
+ <%= form_for @edit_topic,
+ url: @edit_topic.path,
+ html: { class: 'thredded--form thredded--is-expanded', 'data-thredded-topic-form' => true } do |form| %>
+
+
+<% end %>
diff --git a/app/views/thredded/topics/index.html.erb b/app/views/thredded/topics/index.html.erb
new file mode 100644
index 00000000..ecd378db
--- /dev/null
+++ b/app/views/thredded/topics/index.html.erb
@@ -0,0 +1,30 @@
+<% content_for :thredded_page_title, messageboard.name %>
+<% content_for :thredded_page_id, 'thredded--topics-index' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+
+<%= thredded_page do %>
+
+ <%= inline_svg 'thredded/follow.svg', id: 'thredded-follow-icon', title: nil %>
+ <%= inline_svg 'thredded/unfollow.svg', id: 'thredded-unfollow-icon' %>
+
+
+ <%= content_tag :section, class: 'thredded--main-section thredded--topics', 'data-thredded-topics' => true do %>
+ <%= render 'thredded/topics/form',
+ topic: @new_topic,
+ css_class: 'thredded--is-compact',
+ placeholder: t('thredded.topics.form.title_placeholder_start') if @new_topic %>
+ <%= render partial: 'thredded/topics/topic', collection: @topics, locals: {topics: @topics} %>
+ <% end %>
+
+
+
+
+<% end %>
diff --git a/app/views/thredded/topics/new.html.erb b/app/views/thredded/topics/new.html.erb
new file mode 100644
index 00000000..a32b105b
--- /dev/null
+++ b/app/views/thredded/topics/new.html.erb
@@ -0,0 +1,12 @@
+<% content_for :thredded_page_title, 'Create a New Topic' %>
+<% content_for :thredded_page_id, 'thredded--new-topic' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+
+<%= thredded_page do %>
+
+ <%= render 'thredded/topics/form',
+ topic: @new_topic,
+ css_class: 'thredded--is-expanded',
+ placeholder: t('thredded.topics.form.title_placeholder_start') %>
+
+<% end %>
diff --git a/app/views/thredded/topics/search.html.erb b/app/views/thredded/topics/search.html.erb
new file mode 100644
index 00000000..7b1b1544
--- /dev/null
+++ b/app/views/thredded/topics/search.html.erb
@@ -0,0 +1,39 @@
+<% content_for :thredded_page_title, t('thredded.topics.search.page_title') %>
+<% content_for :thredded_page_id, 'thredded--topic-search-results' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+
+<%= thredded_page do %>
+ <% if @topics.present? %>
+
+ <% if messageboard_or_nil %>
+ <%= t 'thredded.topics.search.results_in_messageboard_message_html',
+ query: @query, messageboard: messageboard.name %>
+
+
+ <%= t('thredded.topics.search.search_in_all_messageboards_btn') -%>
+
+ <% else %>
+ <%= t 'thredded.topics.search.results_message_html', query: @query %>
+ <% end %>
+
+
+ <%= render @topics %>
+
+
+ <% else %>
+
+ <% if messageboard_or_nil %>
+ <%= t 'thredded.topics.search.no_results_in_messageboard_message_html',
+ query: @query, messageboard: messageboard.name -%>
+
+
+ <%= t('thredded.topics.search.search_in_all_messageboards_btn') -%>
+
+ <% else %>
+ <%= t 'thredded.topics.search.no_results_message_html', query: @query %>
+ <% end %>
+
+ <% end %>
+<% end %>
diff --git a/app/views/thredded/topics/show.html.erb b/app/views/thredded/topics/show.html.erb
new file mode 100644
index 00000000..2f7fd2d2
--- /dev/null
+++ b/app/views/thredded/topics/show.html.erb
@@ -0,0 +1,42 @@
+<% topic = @posts.topic %>
+<% content_for :thredded_page_title, topic.title %>
+<% content_for :thredded_page_id, 'thredded--topic-show' %>
+<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
+
+<%= thredded_page do %>
+ <%= content_tag :section,
+ id: dom_id(topic),
+ class: ['thredded--main-section', 'thredded--topic', *topic_css_classes(topic)] do %>
+
+ <%= render 'thredded/topics/header', topic: topic %>
+ <%= view_hooks.posts_common.pagination_top.render(self, posts: @posts) do %>
+
+ <% end %>
+ <%= render_posts @posts,
+ partial: 'thredded/posts/post',
+ content_partial: 'thredded/posts/content',
+ locals: { actions: { quote: true } } %>
+ <%= view_hooks.posts_common.pagination_bottom.render(self, posts: @posts) do %>
+
+ <% end %>
+
+ <% if policy(@new_post.post).create? %>
+
+
<%= t('thredded.posts.form.title_label') %>
+ <%= render 'thredded/posts/form',
+ post: @new_post,
+ button_text: t('thredded.posts.form.create_btn'),
+ button_submitting_text: t('thredded.posts.form.create_btn_submitting') %>
+
+ <% end %>
+
+ <% if topic.can_destroy? %>
+
+ <%= button_to t('thredded.topics.delete_topic'), topic.destroy_path, method: :delete,
+ form_class: 'thredded--topic-delete-form',
+ class: 'thredded--button',
+ 'data-confirm' => t('thredded.topics.delete_confirm') %>
+
+ <% end %>
+ <% end %>
+<% end %>
diff --git a/app/views/thredded/users/_badge.html.erb b/app/views/thredded/users/_badge.html.erb
new file mode 100644
index 00000000..eb0a7224
--- /dev/null
+++ b/app/views/thredded/users/_badge.html.erb
@@ -0,0 +1,9 @@
+<% badge_style = 'padding: 3px 5px; font-size: 70%; font-weight: normal;' %>
+
+<% if user.selected_billing_plan_id == 2 %>
+
Beta Tester
+<% elsif user.selected_billing_plan_id == 3 %>
+
Early Adopter
+<% elsif [4, 5, 6].include? user.selected_billing_plan_id %>
+
Premium Supporter
+<% end %>
diff --git a/app/views/thredded/users/_link.html.erb b/app/views/thredded/users/_link.html.erb
new file mode 100644
index 00000000..1fd6761c
--- /dev/null
+++ b/app/views/thredded/users/_link.html.erb
@@ -0,0 +1,11 @@
+<% if user %>
+ <% if !user.thredded_anonymous? %>
+
<%= user.thredded_display_name %>
+<%= render partial: 'thredded/users/badge', locals: { user: user } %>
+ <% else %>
+<%= user.thredded_display_name %>
+<%= render partial: 'thredded/users/badge', locals: { user: user } %>
+ <% end %>
+<% else %>
+
<%= t 'thredded.null_user_name' %>
+<% end %>
diff --git a/app/views/thredded/users/_post.html.erb b/app/views/thredded/users/_post.html.erb
new file mode 100644
index 00000000..76fb9427
--- /dev/null
+++ b/app/views/thredded/users/_post.html.erb
@@ -0,0 +1,6 @@
+<% post, content = post_and_content if local_assigns.key?(:post_and_content) %>
+<%= content_tag :article, id: dom_id(post), class: 'thredded--post' do %>
+ <%= render 'thredded/posts_common/actions', post: post %>
+ <%= render 'thredded/posts_common/header_with_topic', post: post %>
+ <%= content || render('thredded/posts/content', post: post) %>
+<% end %>
diff --git a/app/views/thredded/users/_posts.html.erb b/app/views/thredded/users/_posts.html.erb
new file mode 100644
index 00000000..a01c8d1e
--- /dev/null
+++ b/app/views/thredded/users/_posts.html.erb
@@ -0,0 +1,7 @@
+<%#
+ This partial can be called from the parent app to render the user's posts.
+ The parent view context that renders this partial must include Thredded::ApplicationHelper.
+ TODO: Use a Cell instead. https://github.com/apotonick/cells
+%>
+<%# @param posts [Thredded::PostsPageView] %>
+<%= render_posts posts, partial: 'thredded/users/post', content_partial: 'thredded/posts/content' %>
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb
deleted file mode 100644
index 1afe0651..00000000
--- a/app/views/users/_form.html.erb
+++ /dev/null
@@ -1,50 +0,0 @@
-<%= form_for @user, :url => signup_process_path, :html => { :class => 'form-horizontal' } do |f| %>
-
- <% if @user.errors.messages.length > 0 %>
-
-
Oops! There was a problem. See the high-tech bug report below and please try again!
-
- <% @user.errors.messages.keys.each do |key| %>
- <%= key.capitalize %>: <%= @user.errors.messages[key] %>
- <% end %>
-
-
- <% end %>
-
-
- <%= f.label :name, :class => 'control-label' %>
-
- <% if session[:anon_user] %>
- <%= f.text_field :name, :class => 'text_field', :value => '' %>
- <% else %>
- <%= f.text_field :name, :class => 'text_field' %>
- <% end %>
- This is the username you will log in with. Spaces are allowed.
-
-
-
- <%= f.label :email, :class => 'control-label' %>
-
- <% if session[:anon_user] %>
- <%= f.text_field :email, :class => 'text_field', :value => '' %>
- <% else %>
- <%= f.text_field :email, :class => 'text_field' %>
- <% end %>
-
-
-
- <%= f.label :password, :class => 'control-label' %>
-
- <%= f.password_field :password, :class => 'text_field' %>
-
-
-
-
-
-<% end %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 8e1ae1dd..78351c24 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -22,7 +22,7 @@ content_jsonld = {
tabs = %w(
universes
characters locations items
- creatures races religions magics languages groups scenes
+ creatures races religions magics languages groups floras scenes
)
tab_content_list = {}
@@ -43,6 +43,12 @@ content_jsonld = {
<%= @user.name %>
+ <% if user_signed_in? && current_user.id == @user.id %>
+
+ <%= link_to 'Edit your profile', edit_user_registration_path(current_user) %>
+
+ <% end %>
+