diff --git a/app/assets/images/plots.png b/app/assets/images/plots.png new file mode 100644 index 0000000..b59bd47 Binary files /dev/null and b/app/assets/images/plots.png differ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e001214..a9407ed 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,18 +1,8 @@ module ApplicationHelper - def port_open?(host, port) - wait = 300/1000.0 #milliseconds, the .0 is required!! - require 'timeout' - require 'socket' - isopen = false - begin - Timeout::timeout(wait) { - TCPSocket.new host, port - isopen = true - } - rescue Exception - # could not connect to the server - end - return isopen + + def title(site_title) + content_for(:site_title, site_title.to_s.html_safe) # html_safe because it's escaped again later (yield?) + site_title end def render_md(content) diff --git a/app/views/blogposts/edit.html.erb b/app/views/blogposts/edit.html.erb index 6240262..7eec53f 100644 --- a/app/views/blogposts/edit.html.erb +++ b/app/views/blogposts/edit.html.erb @@ -1,3 +1,5 @@ +<% title "Edit News: #{@post.title}" %> +

Edit post

<%= form_for @post do |f|%> <%= f.text_field :title %> diff --git a/app/views/blogposts/index.html.erb b/app/views/blogposts/index.html.erb index 267d946..7aa9c75 100644 --- a/app/views/blogposts/index.html.erb +++ b/app/views/blogposts/index.html.erb @@ -1,3 +1,5 @@ +<% title "News" %> +

News

<%= link_to 'Make new Post', new_blogpost_path, class: "btn blue" if mod? %>
diff --git a/app/views/blogposts/new.html.erb b/app/views/blogposts/new.html.erb index 2a2266a..ed67138 100644 --- a/app/views/blogposts/new.html.erb +++ b/app/views/blogposts/new.html.erb @@ -1,3 +1,5 @@ +<% title "New Blog Post" %> +

New Post

<%= form_for @post do |f|%> <%= f.text_field :title, placeholder: "Title" %> diff --git a/app/views/blogposts/show.html.erb b/app/views/blogposts/show.html.erb index 822a7b0..0f24626 100644 --- a/app/views/blogposts/show.html.erb +++ b/app/views/blogposts/show.html.erb @@ -1,3 +1,5 @@ +<% title "#{@post.title}" %> + <%= link_to "News", blogposts_path %> → <%= link_to @post.title %>
diff --git a/app/views/comments/edit.html.erb b/app/views/comments/edit.html.erb index 61efc2b..8af487f 100644 --- a/app/views/comments/edit.html.erb +++ b/app/views/comments/edit.html.erb @@ -1,3 +1,5 @@ +<% title "Edit Comment: #{@comment.blogpost.title}" %> +

Edit comment

<%= form_for [@comment.blogpost, @comment] do |f| %> diff --git a/app/views/forumgroups/edit.html.erb b/app/views/forumgroups/edit.html.erb index 0da67b2..ab41aa5 100644 --- a/app/views/forumgroups/edit.html.erb +++ b/app/views/forumgroups/edit.html.erb @@ -1,3 +1,5 @@ +<% title "Manage Forums" %> +

Manage Forums

diff --git a/app/views/forumgroups/new.html.erb b/app/views/forumgroups/new.html.erb index c0525de..4d11a36 100644 --- a/app/views/forumgroups/new.html.erb +++ b/app/views/forumgroups/new.html.erb @@ -1,3 +1,5 @@ +<% title "New Forum: #{@group.title}" %> +

New forum group

<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %> <%= form_for @group do |f|%> diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb index 8cfcad6..990bdf9 100644 --- a/app/views/forums/edit.html.erb +++ b/app/views/forums/edit.html.erb @@ -1,3 +1,5 @@ +<% title "Edit Forum: #{@forum.name}" %> + <%= link_to "(Edit) #{@forum.group.name}", edit_forumgroup_path(@forum.group) %> → <%= link_to @forum.name, @forum %>

Edit Forum

<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %> diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 6e8ff71..df3d590 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -1,3 +1,5 @@ +<% title "Forums" %> +
<% @groups.each do |group| %>
diff --git a/app/views/forums/new.html.erb b/app/views/forums/new.html.erb index e48575b..f60e2b3 100644 --- a/app/views/forums/new.html.erb +++ b/app/views/forums/new.html.erb @@ -1,3 +1,5 @@ +<% title "New Forum: #{@forum.group.name}" %> + <%= link_to @forum.group, forumgroup_path(@forum.group) %> → New forum

New Forum

<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %> diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 267f5e5..0b3a958 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,3 +1,5 @@ +<% title @forum.name %> + <%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= link_to @forum %>

<%= @forum %>

diff --git a/app/views/forumthreads/edit.html.erb b/app/views/forumthreads/edit.html.erb index 044a8ad..daa51c4 100644 --- a/app/views/forumthreads/edit.html.erb +++ b/app/views/forumthreads/edit.html.erb @@ -1,3 +1,5 @@ +<% title "Edit Thread: #{@thread}" %> +

Edit thread

<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread <%= form_for @thread do |f|%> diff --git a/app/views/forumthreads/new.html.erb b/app/views/forumthreads/new.html.erb index ae13848..446fbf1 100644 --- a/app/views/forumthreads/new.html.erb +++ b/app/views/forumthreads/new.html.erb @@ -1,3 +1,5 @@ +<% title "New Thread: #{@thread.forum.title}" %> + <%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread

New thread

<%= form_for @thread do |f|%> diff --git a/app/views/forumthreads/show.html.erb b/app/views/forumthreads/show.html.erb index 0d3e234..7580818 100644 --- a/app/views/forumthreads/show.html.erb +++ b/app/views/forumthreads/show.html.erb @@ -1,3 +1,5 @@ +<% title @thread.title %> + <%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → <%= link_to @thread %>
diff --git a/app/views/info/edit.html.erb b/app/views/info/edit.html.erb index bb17379..c36f6ca 100644 --- a/app/views/info/edit.html.erb +++ b/app/views/info/edit.html.erb @@ -1,3 +1,5 @@ +<% title "Edit Info: #{@info.title}" %> +

Edit Info

<%= form_for @info do |f|%> <%= f.text_field :title%> diff --git a/app/views/info/index.html.erb b/app/views/info/index.html.erb index 52f2a45..931b015 100644 --- a/app/views/info/index.html.erb +++ b/app/views/info/index.html.erb @@ -1,3 +1,5 @@ +<% title "Info" %> +

Info

<% if mod? %> <%= link_to "New Info", new_info_path, class: "btn blue" %> diff --git a/app/views/info/new.html.erb b/app/views/info/new.html.erb index da2c124..00d156f 100644 --- a/app/views/info/new.html.erb +++ b/app/views/info/new.html.erb @@ -1,3 +1,5 @@ +<% title "New Info" %> +

New Info

<%= form_for @info, url: info_index_path do |f|%> <%= f.text_field :title, placeholder: "Title" %> diff --git a/app/views/info/show.html.erb b/app/views/info/show.html.erb index 22196c2..adab4af 100644 --- a/app/views/info/show.html.erb +++ b/app/views/info/show.html.erb @@ -1,3 +1,5 @@ +<% title @info.title %> + <%= link_to "Info", info_index_path %> → <%= @info.title %> <%= link_to "Edit Info", edit_info_path(@info), class: "btn blue right" %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f6f68d6..4bc2c93 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - Redstoner + Redstoner<%= yield(:site_title).present? ? " › #{yield(:site_title)}" : "" %> <%= stylesheet_link_tag "application", :media => "all" %> <%= csrf_meta_tags %> @@ -11,7 +11,7 @@ <%= render partial: "/layouts/head" %> -
+
<%= "
#{alert}
".html_safe if alert %> <%= "
#{notice}
".html_safe if notice %> <%= yield %> diff --git a/app/views/statics/index.html.erb b/app/views/statics/index.html.erb index e4585cb..36d1f2c 100644 --- a/app/views/statics/index.html.erb +++ b/app/views/statics/index.html.erb @@ -1,3 +1,6 @@ +<% title "Home" %> +

Redstoner

+<%= image_tag "plots.png" %>

We need some text here

Any suggestions?

\ No newline at end of file diff --git a/app/views/threadreplies/edit.html.erb b/app/views/threadreplies/edit.html.erb index 943083f..d45c2b7 100644 --- a/app/views/threadreplies/edit.html.erb +++ b/app/views/threadreplies/edit.html.erb @@ -1,3 +1,5 @@ +<% title "Edit Thread Reply: #{@reply.thread.title}" %> + <%= link_to @reply.thread.forum.group, forumgroup_path(@reply.thread.forum.group) %> → <%= link_to @reply.thread.forum, @reply.thread.forum %> → <%= link_to @reply.thread %> → Edit reply

Edit reply

<%= form_for [@reply.thread, @reply] do |f| %> diff --git a/app/views/users/change_password.html.erb b/app/views/users/change_password.html.erb index 1ca943d..54a935c 100644 --- a/app/views/users/change_password.html.erb +++ b/app/views/users/change_password.html.erb @@ -1,4 +1,6 @@ -

Change password

+<% title "Change Password" %> + +

Change password

<%= form_for @user do |f| %> <%= f.text_field :current_password %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 3784df8..4071f93 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,3 +1,5 @@ +<% title "Edit User: #{@user.name}" %> + <% def can_edit? (@user.is?(current_user) && confirmed?) || (mod? && current_user.role >= @user.role) diff --git a/app/views/users/edit_login.html.erb b/app/views/users/edit_login.html.erb index 81bdae8..6fef6d3 100644 --- a/app/views/users/edit_login.html.erb +++ b/app/views/users/edit_login.html.erb @@ -1,3 +1,5 @@ +<% title "Edit Login Credentials: #{@user.name}" %> + <%= link_to @user.name, @user %> → Edit Login credentials

Edit Login credentials

diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 74baa64..33fed1d 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,8 +1,8 @@ <% if params[:role] %> -

All '<%= params[:role] %>' users

+

<%= title "All '#{params[:role]}' Users" %>

<%= link_to "show all", users_path %> <% else %> -

All users

+

<%= title "All Users" %>

<% end %>
<% @users.each do |u| %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 03a507d..afa13e4 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,3 +1,5 @@ +<% title "Sign up" %> +

Sign up

To get your token, join the Minecraft server (redstoner.com) and use the /token command.

diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 911b1c6..c36f027 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,3 +1,5 @@ +<% title @user.name %> +
<% if @user.is?(current_user) || (mod? && current_user.role >= @user.role) %>
<%= link_to "edit profile", edit_user_path(@user), :class => "btn blue" %>