page titles
This commit is contained in:
BIN
app/assets/images/plots.png
Normal file
BIN
app/assets/images/plots.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 134 KiB |
@@ -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)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Edit News: #{@post.title}" %>
|
||||
|
||||
<h1>Edit post</h1>
|
||||
<%= form_for @post do |f|%>
|
||||
<%= f.text_field :title %>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "News" %>
|
||||
|
||||
<h1>News</h1>
|
||||
<%= link_to 'Make new Post', new_blogpost_path, class: "btn blue" if mod? %>
|
||||
<div id="posts">
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "New Blog Post" %>
|
||||
|
||||
<h1>New Post</h1>
|
||||
<%= form_for @post do |f|%>
|
||||
<%= f.text_field :title, placeholder: "Title" %>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "#{@post.title}" %>
|
||||
|
||||
<%= link_to "News", blogposts_path %> → <%= link_to @post.title %>
|
||||
<div class="item-group post with-avatar" id="post-<%= @post.id %>">
|
||||
<div class="header">
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Edit Comment: #{@comment.blogpost.title}" %>
|
||||
|
||||
<h1>Edit comment</h1>
|
||||
|
||||
<%= form_for [@comment.blogpost, @comment] do |f| %>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Manage Forums" %>
|
||||
|
||||
<h1>Manage Forums</h1>
|
||||
<div class="item-group">
|
||||
<div class="header">
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "New Forum: #{@group.title}" %>
|
||||
|
||||
<h1>New forum group</h1>
|
||||
<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %>
|
||||
<%= form_for @group do |f|%>
|
||||
|
||||
@@ -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 %>
|
||||
<h1>Edit Forum</h1>
|
||||
<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Forums" %>
|
||||
|
||||
<div id="forum_groups">
|
||||
<% @groups.each do |group| %>
|
||||
<div class="item-group" id="group-<%= group.id %>">
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "New Forum: #{@forum.group.name}" %>
|
||||
|
||||
<%= link_to @forum.group, forumgroup_path(@forum.group) %> → New forum
|
||||
<h1>New Forum</h1>
|
||||
<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title @forum.name %>
|
||||
|
||||
<%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= link_to @forum %>
|
||||
|
||||
<h1><%= @forum %></h1>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Edit Thread: #{@thread}" %>
|
||||
|
||||
<h1>Edit thread</h1>
|
||||
<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread
|
||||
<%= form_for @thread do |f|%>
|
||||
|
||||
@@ -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
|
||||
<h1>New thread</h1>
|
||||
<%= form_for @thread do |f|%>
|
||||
|
||||
@@ -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 %>
|
||||
<div class="item-group thread with-avatar" id="thread-<%= @thread.id %>">
|
||||
<div class="header">
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Edit Info: #{@info.title}" %>
|
||||
|
||||
<h1>Edit Info</h1>
|
||||
<%= form_for @info do |f|%>
|
||||
<%= f.text_field :title%>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Info" %>
|
||||
|
||||
<h1>Info</h1>
|
||||
<% if mod? %>
|
||||
<%= link_to "New Info", new_info_path, class: "btn blue" %>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "New Info" %>
|
||||
|
||||
<h1>New Info</h1>
|
||||
<%= form_for @info, url: info_index_path do |f|%>
|
||||
<%= f.text_field :title, placeholder: "Title" %>
|
||||
|
||||
@@ -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" %>
|
||||
<div class="clear"></div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Redstoner</title>
|
||||
<title>Redstoner<%= yield(:site_title).present? ? " › #{yield(:site_title)}" : "" %></title>
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
<%= csrf_meta_tags %>
|
||||
@@ -11,7 +11,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<%= render partial: "/layouts/head" %>
|
||||
<div id="main-content">
|
||||
<div id="main-content" class="<%= yield(:main_class) %>">
|
||||
<%= "<div class='flash alert'>#{alert}</div>".html_safe if alert %>
|
||||
<%= "<div class='flash notice'>#{notice}</div>".html_safe if notice %>
|
||||
<%= yield %>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
<% title "Home" %>
|
||||
|
||||
<h1>Redstoner</h1>
|
||||
<%= image_tag "plots.png" %>
|
||||
<p>We need some text here</p>
|
||||
<p>Any suggestions?</p>
|
||||
@@ -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
|
||||
<h1>Edit reply</h1>
|
||||
<%= form_for [@reply.thread, @reply] do |f| %>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<h1>Change password</h1>
|
||||
<% title "Change Password" %>
|
||||
|
||||
<h1>Change password</h1>
|
||||
|
||||
<%= form_for @user do |f| %>
|
||||
<%= f.text_field :current_password %>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Edit User: #{@user.name}" %>
|
||||
|
||||
<%
|
||||
def can_edit?
|
||||
(@user.is?(current_user) && confirmed?) || (mod? && current_user.role >= @user.role)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Edit Login Credentials: #{@user.name}" %>
|
||||
|
||||
<%= link_to @user.name, @user %> → Edit Login credentials
|
||||
<h1>Edit Login credentials</h1>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<% if params[:role] %>
|
||||
<h1>All '<%= params[:role] %>' users</h1>
|
||||
<h1><%= title "All '#{params[:role]}' Users" %></h1>
|
||||
<%= link_to "show all", users_path %>
|
||||
<% else %>
|
||||
<h1> All users </h1>
|
||||
<h1><%= title "All Users" %></h1>
|
||||
<% end %>
|
||||
<div id="userlist">
|
||||
<% @users.each do |u| %>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title "Sign up" %>
|
||||
|
||||
<h1>Sign up</h1>
|
||||
|
||||
<p>To get your <i>token</i>, join the Minecraft server (redstoner.com) and use the <mark>/token</mark> command.</p>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% title @user.name %>
|
||||
|
||||
<div id="user-info">
|
||||
<% if @user.is?(current_user) || (mod? && current_user.role >= @user.role) %>
|
||||
<div class="profile-action" ><%= link_to "edit profile", edit_user_path(@user), :class => "btn blue" %></div>
|
||||
|
||||
Reference in New Issue
Block a user