another big commit :D
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
<%= simple_form_for @post do |f|%>
|
||||
<%= f.input :title, :label => false %>
|
||||
<%= f.input :text, :label => false %>
|
||||
<%= f.input :content, :label => false %>
|
||||
<%= f.submit "Update Post", :id => "edit_create_post" %>
|
||||
<% end %>
|
||||
<div id="delete_post">
|
||||
<%= button_to "Delete post", @post, :method => "delete", :confirm => "Delete post forever?" %>
|
||||
<%= button_to "Delete post", @post, :method => "delete", :confirm => "Delete post + comments forever?" %>
|
||||
</div>
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
</span>
|
||||
</div>
|
||||
<span class="post-info">
|
||||
by <%= link_to p.user.name, p.user %> on <%= p.created_at.strftime("%e. %b %Y") %>
|
||||
by <%= link_to p.author.name, p.author %> on <%= p.created_at.strftime("%e. %b %Y") %>
|
||||
</span>
|
||||
<div class="post-content">
|
||||
<%= RbbCode.new.convert(p.text).html_safe %>
|
||||
<%= GitHub::Markdown.render_gfm(Sanitize.clean(p.content, Sanitize::Config::RESTRICTED)).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= link_to 'Make new Post', new_blogpost_path if current_user && current_user.rank >= rank_to_int("mod") %>
|
||||
<%= link_to 'Make new Post', new_blogpost_path if mod? %>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h1>New Post</h1>
|
||||
<%= simple_form_for @post do |f|%>
|
||||
<%= f.input :title, :label => false %>
|
||||
<%= f.input :text, :label => false %>
|
||||
<%= f.input :content, :label => false %>
|
||||
<%= f.submit "Update Post", :id => "edit_create_post" %>
|
||||
<% end %>
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<h1><%= @post.title %></h1>
|
||||
</div>
|
||||
<span class="post-info"><%= link_to @post.author.name, @post.author %> on <%= @post.created_at.strftime("%e. %b %Y") %>
|
||||
<% if current_user && current_user.rank >= rank_to_int("mod") %>
|
||||
<% if mod? %>
|
||||
- <%= link_to "edit", edit_blogpost_path(@post.id) %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="post-content">
|
||||
<%= RbbCode.new.convert(@post.text).html_safe %>
|
||||
<%= GitHub::Markdown.render_gfm(Sanitize.clean(@post.content, Sanitize::Config::RESTRICTED)).html_safe %>
|
||||
</div>
|
||||
<div id="comments">
|
||||
<% @post.comments.each do |c| %>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<div class="comment <%= "author" if c.user == @post.user %>">
|
||||
<span class="comment-info"><%= link_to c.user.name, c.user %> <%= c.created_at.strftime("%e. %b %Y, %H:%m") %>
|
||||
<% if mod? || current_user == c.user %>
|
||||
<div class="comment <%= "author" if c.author == @post.author %>">
|
||||
<span class="comment-info"><%= link_to c.author.name, c.author %> <%= c.created_at.strftime("%e. %b %Y, %H:%m") %>
|
||||
<% if mod? || c.author.is?(current_user) %>
|
||||
<div class="editlink"><%= link_to "edit", edit_blogpost_comment_path(c.blogpost, c) %></div>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="comment-content"><%= h(c.text).gsub(/(\w*[\r\n]){3,}/, "\n\n").gsub("\n", "<br>").html_safe %></div>
|
||||
<div class="comment-content"><%= h(c.content).gsub(/(\w*[\r\n]){3,}/, "\n\n").gsub("\n", "<br>").html_safe %></div>
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
<% if current_user %>
|
||||
<h3>New comment</h3>
|
||||
<%= simple_form_for [@post, @comment] do |f| %>
|
||||
<%= f.input :text, :label => false, :as => "text", :placeholder => "Comment" %>
|
||||
<%= f.input :content, :label => false, :as => "text", :placeholder => "Comment" %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -1,6 +1,9 @@
|
||||
<h1>Edit comment</h1>
|
||||
|
||||
<%= simple_form_for [@comment.blogpost, @comment] do |f| %>
|
||||
<%= f.input :text, :label => false, :as => "text", :placeholder => "Comment" %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<%= f.input :content, :label => false, :as => "text", :placeholder => "Comment" %>
|
||||
<%= f.submit "Update Comment", :id => "edit_create_comment" %>
|
||||
<% end %>
|
||||
<div id="delete_comment">
|
||||
<%= button_to "Delete comment", [@comment.blogpost, @comment] , :method => "delete", :confirm => "Delete comment forever?" %>
|
||||
</div>
|
||||
@@ -1,14 +1,14 @@
|
||||
<div id="forum_groups">
|
||||
<% @groups.each do |g| %>
|
||||
<div class="group">
|
||||
<% @groups.each do |group| %>
|
||||
<div class="group" id="forum-<%= group.id %>">
|
||||
<div class="header">
|
||||
<%= g.name %>
|
||||
<%= group.name %>
|
||||
</div>
|
||||
|
||||
<div class="forums">
|
||||
<% g.forums.sort_by{|s| s[:position]}.each do |f| %>
|
||||
<% group.forums.sort_by{|s| s[:position]}.each do |f| %>
|
||||
<div class="forum">
|
||||
<%= f.name %>
|
||||
<%= link_to f.name, f %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
20
app/views/forums/show.html.erb
Normal file
20
app/views/forums/show.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<div class='forum-path'><%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= link_to @forum %></div>
|
||||
<h1><%= @forum.name %></h1>
|
||||
<div id="forum_threads">
|
||||
<% @threads.each do |thread| %>
|
||||
<div class="group" id="thread-<%= thread.id %>">
|
||||
<div class="header">
|
||||
<%= thread.name %>
|
||||
</div>
|
||||
|
||||
<div class="forums">
|
||||
<% thread.forums.sort_by{|s| s[:position]}.each do |f| %>
|
||||
<div class="forum">
|
||||
<%= link_to f.name, f %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,7 +1,9 @@
|
||||
<div id="head">
|
||||
<div id="logo"><%= image_tag "logo.png" %></div>
|
||||
<div id="userinfo" <%= "class=\"logged-out\"".html_safe if !current_user %>>
|
||||
<% if !current_user.nil? %>
|
||||
<div id="logo"><%= link_to root_path do %>
|
||||
<%= image_tag "logo.png" %>
|
||||
<% end %></div>
|
||||
<div id="userinfo" <%= "class=\"logged-out\"".html_safe unless current_user %>>
|
||||
<% if current_user %>
|
||||
<span id="userinfo-box">
|
||||
<%= link_to current_user.name.truncate(14), current_user %><br/>
|
||||
<%= link_to "Logout", logout_path %>
|
||||
@@ -14,17 +16,14 @@
|
||||
<div class="clear"></div>
|
||||
<div id="menu">
|
||||
<ul>
|
||||
<li><%= link_to image_tag('icons/home.png'), root_path %></li>
|
||||
<%= link_to root_path do %>
|
||||
<li>Home</li>
|
||||
<% end %>
|
||||
<li>Info</li>
|
||||
<%= link_to forums_path do %>
|
||||
<%= link_to forumgroups_path do %>
|
||||
<li>Forums</li>
|
||||
<% end %>
|
||||
<li>Donate</li>
|
||||
<li>
|
||||
<%= simple_form_for "asdf", method: "get", action: users_path do |f| %>
|
||||
<%= f.input :rank %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
<%= javascript_include_tag "application" %>
|
||||
</head>
|
||||
<body>
|
||||
<%= render "/layouts/head" %>
|
||||
<%= "<div id='flash' class='alert'>#{alert}</div>".html_safe if alert %>
|
||||
<%= "<div id='flash' class='notice'>#{notice}</div>".html_safe if notice %>
|
||||
<div id="main-content">
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
<div id="mobile-info">Sorry, we don't have a mobile style yet. It's all ugly for now.</div>
|
||||
<%= render "/layouts/head" %>
|
||||
<div id="main-content">
|
||||
<%= "<div id='alert' class='flash'>#{alert}</div>".html_safe if alert %>
|
||||
<%= "<div id='notice' class='flash'>#{notice}</div>".html_safe if notice %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
29
app/views/redstoner_mailer/register_info_mail.html.erb
Normal file
29
app/views/redstoner_mailer/register_info_mail.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<p><%= @user.name %> has registered on redstoner.</p>
|
||||
<p>
|
||||
<table style="border: 1px solid black; border-collapse:collapse;">
|
||||
<tr>
|
||||
<td style="border:1px solid black;">IGN</td>
|
||||
<td style="border:1px solid black;"><%= @user.ign %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid black;">email</td>
|
||||
<td style="border:1px solid black;"><%= @user.email %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid black;">Time</td>
|
||||
<td style="border:1px solid black;"><%= @user.created_at %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid black;">IP</td>
|
||||
<td style="border:1px solid black;"><%= @user.last_ip %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<% if @mcpw %>
|
||||
<p>
|
||||
<font color="red">
|
||||
<b>USER IS AN IDIOT!</b>
|
||||
</font>
|
||||
</p>
|
||||
<% end %>
|
||||
29
app/views/redstoner_mailer/register_mail.html.erb
Normal file
29
app/views/redstoner_mailer/register_mail.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
Hi <%= @user.name %>!
|
||||
|
||||
<p>Thank you for registering on Redstoner.com!</p>
|
||||
<p>To use your account, you need to <%= link_to "confirm", confirm_user_path(@user, code: @user.confirm_code, only_path: false) %> your email address.
|
||||
|
||||
<% if @mcpw %>
|
||||
<div>
|
||||
<p>
|
||||
<font color="red">
|
||||
<b>NEVER USE THE SAME PASSWORD TWICE!</b>
|
||||
</font>
|
||||
</p>
|
||||
<p>
|
||||
<font color="red">
|
||||
You used your minecraft password on our website. We could have stolen it easily!<br>
|
||||
</font>
|
||||
<i>(But we didn't)</i>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
|
||||
<p>Please click this link to confirm your registration:
|
||||
<div style="background-color: #eeeeee; padding: 1em; margin: 0; text-align: center;" width="100%">
|
||||
<%= link_to "confirm my email", confirm_user_path(@user, code: @user.confirm_code, only_path: false), style: "text-decoration: none; color: #f2f2f2; padding: 0.5em 2em; background-color: #4096EE; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; display: inline-block; text-transform: uppercase;" %>
|
||||
</div>
|
||||
</p>
|
||||
|
||||
<p>If you have any questions or problems, just ask one of our <%= link_to "Staff", users_path(role: "staff", only_path: false) %> in-game.</p>
|
||||
<p>Your Redstoner team</p>
|
||||
@@ -1,4 +1,5 @@
|
||||
<h1>Log in</h1>
|
||||
<p>Not a member? <%= link_to "Join us here", signup_path %>!</p>
|
||||
<%= form_tag login_path do |f| %>
|
||||
<div id="form_labels">
|
||||
<%= label_tag :email %>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<%= link_to "Your profile", current_user %> → Edit
|
||||
<h1>Edit profile</h1>
|
||||
|
||||
<%= simple_form_for @user do |f| %>
|
||||
@@ -9,41 +10,59 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Display name</td>
|
||||
<td><%= f.input :name, :label => false %></td>
|
||||
<td>
|
||||
<%= f.input :name, :label => false, disabled: !((@user.is?(current_user) && confirmed?) || (mod? && current_user.role >= @user.role)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% if admin? %>
|
||||
<tr class="special_edit" >
|
||||
<td>Ingame name</td>
|
||||
<td><%= f.input :ign, :label => false %></td>
|
||||
<td>In-game name</td>
|
||||
<td>
|
||||
<%= f.input :ign, :label => false, disabled: !(mod? && current_user.role >= @user.role) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="special_edit" >
|
||||
<td>Rank</td>
|
||||
<td><%= f.input :rank, :label => false, :collection => ranks, :include_blank => false %></td>
|
||||
<tr>
|
||||
<td>Role</td>
|
||||
<td>
|
||||
<% if mod? && current_user.role >= @user.role %>
|
||||
<%= f.association :role, :label => false, :collection => Role.all_until(current_user.role), :include_blank => false %>
|
||||
<% else %>
|
||||
<%= f.input :role, label: false, disabled: true %>
|
||||
<% end %>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td>
|
||||
Skype username<br>
|
||||
Show to all users
|
||||
Show to...
|
||||
</td>
|
||||
<td>
|
||||
<%= f.input :skype, :label => false %>
|
||||
<%= f.input :skype_public, :label => false %>
|
||||
<%= f.input :skype, label: false, placeholder: "Skype username", disabled: !((@user.is?(current_user) && confirmed?) || (mod? && current_user.role >= @user.role)) %>
|
||||
<%= f.input :skype_public, label: false, as: :radio_buttons, collection: [['all users', false], ['only staff', true]], input_html: { disabled: !((@user.is?(current_user) && confirmed?) || (mod? && current_user.role >= @user.role)) } %>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>YouTube username</td>
|
||||
<td><%= f.input :youtube, :label => false %></td>
|
||||
<td>
|
||||
<%= f.input :youtube, :label => false, placeholder: "YouTube username", disabled: !((@user.is?(current_user) && confirmed?) || (mod? && current_user.role >= @user.role)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Twitter username</td>
|
||||
<td><%= f.input :twitter, :label => false %></td>
|
||||
<td>
|
||||
<%= f.input :twitter, :label => false, placeholder: "Twitter username", disabled: !(confirmed? || (mod? && current_user.role >= @user.role)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>About you</td>
|
||||
<td><%= f.input :about, :label => false, :input_html => {:class => "vertical"} %></td>
|
||||
<td>
|
||||
<%= f.input :about, :label => false, :input_html => {:class => "vertical"}, placeholder: "Tell us something about you...", disabled: !((@user.is?(current_user) && confirmed?) || (mod? && current_user.role >= @user.role)) %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= f.submit "Save profile" %>
|
||||
<%= f.submit "Save profile", disabled: @user.unconfirmed? %>
|
||||
<% if @user.unconfirmed? %>
|
||||
<span class='red'>Please confirm your email adress first.</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -1,4 +1,4 @@
|
||||
<% filter = params[:rank] %>
|
||||
<% filter = params[:role] %>
|
||||
<% if filter %>
|
||||
<h1>All '<%= filter %>' users</h1>
|
||||
<%= link_to "show all", users_path %>
|
||||
@@ -16,7 +16,7 @@
|
||||
<span class="user-name"><%= u.name %></span>
|
||||
<span class="user-ign"><%= u.ign %></span>
|
||||
<% end %>
|
||||
<span class="user-rank"><%= link_to int_to_rank(u.rank), users_path(:rank => int_to_rank(u.rank)) %></span>
|
||||
<span class="user-role"><%= link_to u.role, users_path(:role => u.role.name) %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<h1>Register</h1>
|
||||
|
||||
<%= simple_form_for @user do |f| %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :ign, label: "Exact ingame name" %>
|
||||
<%= f.input :name, label: "Display Name" %>
|
||||
<%= f.input :ign, label: "Case sensitive Minecraft name" %>
|
||||
<%= f.input :email %>
|
||||
<%= f.input :password %>
|
||||
<%= f.input :password_confirmation %>
|
||||
|
||||
@@ -1,22 +1,32 @@
|
||||
<div id="user-info">
|
||||
<h1><%= @user.name %></h1>
|
||||
|
||||
<% if @user == current_user || mod? %>
|
||||
<% 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>
|
||||
<div class="profile-action" >
|
||||
<% if session[:original_user_id] %>
|
||||
<%= link_to "revert", unbecome_users_path, :class => "btn-blue" %>
|
||||
<% else %>
|
||||
<%= link_to "become this user", become_user_path(@user), :class => "btn-blue" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="profile-action" >
|
||||
<% if !session[:original_user_id] && admin? %>
|
||||
<%= link_to "become this user", become_user_path(@user), :class => "btn-blue" %>
|
||||
<% elsif session[:original_user_id] %>
|
||||
<%= link_to "revert", unbecome_users_path, :class => "btn-blue" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @user.rank.to_i == rank_to_int("banned") %>
|
||||
<% if @user.banned? %>
|
||||
<span class="user-banned">This user is banned!</span>
|
||||
<% end %>
|
||||
<% if @user.rank.to_i == rank_to_int("unconfirmed") %>
|
||||
<span class="user-unconfirmed">This user hasn't confirmed his email yet!</span>
|
||||
<% if @user.unconfirmed? %>
|
||||
<% if @user.is?(current_user) %>
|
||||
<span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span>
|
||||
<% else %>
|
||||
<span class="user-unconfirmed">This user hasn't confirmed their email yet!</span>
|
||||
<% end %>
|
||||
<% elsif @user.disabled? %>
|
||||
<% if @user.is?(current_user) %>
|
||||
<span class="user-unconfirmed">Your account has been disabled.</span>
|
||||
<% else %>
|
||||
<span class="user-unconfirmed">This user is disabled or does no longer exist.</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -28,25 +38,25 @@
|
||||
<td><%= @user.ign %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rank</td>
|
||||
<td><%= link_to int_to_rank(@user.rank), users_path(:rank => int_to_rank(@user.rank)) %></td>
|
||||
<td>Role</td>
|
||||
<td><%= link_to @user.role, users_path(:role => @user.role.name) %></td>
|
||||
</tr>
|
||||
<% if current_user && !@user.skype.blank? && (@user.skype_public || current_user == @user || mod?) %>
|
||||
<tr>
|
||||
<td>Skype</td>
|
||||
<td><a href="skype:<%= @user.skype %>?chat" target="_blank"><%= @user.skype %></a></td>
|
||||
<td><%= link_to @user.skype, "skype:#{@user.skype}?chat", target: "_blank" %></a></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@user.youtube.blank? && @user.youtube_channelname.blank? %>
|
||||
<% if !@user.youtube.blank? && !@user.youtube_channelname.blank? %>
|
||||
<tr>
|
||||
<td>YouTube</td>
|
||||
<td><%= link_to @user.youtube_channelname, "https://youtube.com/user/#{CGI::escape(@user.youtube)}", :target => "_blank" %></td>
|
||||
<td><%= link_to @user.youtube_channelname, "https://youtube.com/user/#{CGI.escape(@user.youtube)}", :target => "_blank" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@user.twitter.blank? %>
|
||||
<tr>
|
||||
<td>Twitter</td>
|
||||
<td><%= link_to @user.twitter, "https://twitter.com/#{CGI::escape(@user.twitter)}", :target => "_blank" %></td>
|
||||
<td><%= link_to @user.twitter, "https://twitter.com/#{CGI.escape(@user.twitter)}", :target => "_blank" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
@@ -54,10 +64,12 @@
|
||||
<td><%= @user.created_at.strftime("%e. %b %Y") %></td>
|
||||
</tr>
|
||||
<% if mod? || current_user == @user %>
|
||||
<% if mod? %>
|
||||
<tr>
|
||||
<td>Last IP</td>
|
||||
<td><%= @user.last_ip %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td>Email</td>
|
||||
<td><%= mail_to @user.email, @user.email, :subject => "Redstoner" %></td>
|
||||
|
||||
Reference in New Issue
Block a user