LOTS of stuff
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
<%= link_to 'Make new Post', new_blogpost_path, class: "btn blue" if mod? %>
|
||||
<div id="posts">
|
||||
<% @posts.each do |p| %>
|
||||
<div class="post" id="post-<%= p.id %>">
|
||||
<div class="post-title">
|
||||
<h2><%= link_to truncate(p.title, length: 60, omission: " …"), p %></h2>
|
||||
<span class="comment-counter">
|
||||
<%= link_to pluralize(p.comments.count, "Comment"), p %>
|
||||
</span>
|
||||
<div class="item-group with-avatar" id="post-<%= p.id %>">
|
||||
<%= link_to(image_tag(p.author.avatar_url(64), class: "avatar"), p.author, title: p.author.ign) %>
|
||||
<div class="header">
|
||||
<%= render partial: "users/username", locals: { user: p.author } %> <time><%= link_to p.created_at.strftime("%e. %b %Y, %H:%m"), p %></time>
|
||||
<span class="comment-counter">
|
||||
<%= link_to pluralize(p.comments.count, "Comment"), p %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="items">
|
||||
<div class="item content">
|
||||
<h2 class="headline"><%= link_to truncate(p.title, length: 60, omission: " …"), p %></h2>
|
||||
<%= Sanitize.clean(GitHub::Markdown.render_gfm(p.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-info">
|
||||
by <%= link_user p.author %> on <%= p.created_at.strftime("%e. %b %Y") %>
|
||||
</div>
|
||||
<div class="post-content">
|
||||
<%= Sanitize.clean(GitHub::Markdown.render_gfm(p.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<div class="post">
|
||||
<div class="post-title">
|
||||
<h1><%= @post.title %></h1>
|
||||
<div class="item-group post with-avatar" id="post-<%= @post.id %>">
|
||||
<%= link_to(image_tag(@post.author.avatar_url(64), class: "avatar"), @post.author, title: @post.author.ign) %>
|
||||
<div class="header">
|
||||
<%= render partial: "users/username", locals: { user: @post.author } %> <time><%= link_to @post.created_at.strftime("%e. %b %Y, %H:%m"), p %></time>
|
||||
<%= link_to "edit", edit_blogpost_path(@post.id), class: "editlink" if mod? %>
|
||||
</div>
|
||||
<div class="post-info"><%= link_user @post.author %> on <%= @post.created_at.strftime("%e. %b %Y") %>
|
||||
<% if mod? %>
|
||||
<%= link_to "edit", edit_blogpost_path(@post.id), class: "post-edit" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="post-content">
|
||||
<%= Sanitize.clean(GitHub::Markdown.render_gfm(@post.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
</div>
|
||||
<div id="comments">
|
||||
<h3><%= "#{pluralize(@post.comments.length, 'comment')}." %></h3>
|
||||
<% @post.comments.each do |c| %>
|
||||
<%= render "comments/comment", :c => c %>
|
||||
<% end %>
|
||||
<%= render "comments/new" %>
|
||||
<div class="items">
|
||||
<div class="item content">
|
||||
<h2 class="headline"><%= link_to truncate(@post.title, length: 60, omission: " …"), p %></h2>
|
||||
<%= Sanitize.clean(GitHub::Markdown.render_gfm(@post.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="comments">
|
||||
<h3><%= "#{pluralize(@post.comments.length, 'comment')}." %></h3>
|
||||
<% @post.comments.each do |c| %>
|
||||
<%= render "comments/comment", :c => c %>
|
||||
<% end %>
|
||||
<%= render "comments/new" %>
|
||||
</div>
|
||||
@@ -1,8 +1,12 @@
|
||||
<div class="comment <%= "author" if c.author == @post.author %>" id="comment-<%= c.id %>">
|
||||
<span class="comment-info"><%= link_user 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.content).gsub(/(\s*?[\r\n]){3,}/, "\n\n").gsub("\n", "<br>").html_safe %></div>
|
||||
<div class="item-group with-avatar comment" id="comment-<%= c.id %>">
|
||||
<%= link_to(image_tag(c.author.avatar_url(64), class: "avatar"), c.author, title: c.author.ign) %>
|
||||
<div class="header <%= "op" if c.author.is?(c.blogpost.author) %>">
|
||||
<%= render partial: "users/username", locals: { user: c.author } %> <time><%= link_to c.created_at.strftime("%e. %b %Y, %H:%m"), [c.blogpost, c] %></time>
|
||||
<%= link_to "edit", edit_blogpost_comment_path(c.blogpost, c), class: "editlink" if (mod? || c.author.is?(current_user)) %>
|
||||
</div>
|
||||
<div class="items">
|
||||
<div class="item content">
|
||||
<%= h(c.content).gsub(/(\s*?[\r\n]){3,}/, "\n\n").gsub("\n", "<br>").html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1 +1,24 @@
|
||||
<h1>Not yet</h1>
|
||||
<h1>Edit forum group</h1>
|
||||
<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %>
|
||||
<%= form_for @group do |f|%>
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= f.label :name %></td>
|
||||
<td><%= f.text_field :name, placeholder: "Name" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :position %></td>
|
||||
<td><%= f.number_field :position, placeholder: "Position" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :role_read_id, "Min. read role" %></td>
|
||||
<td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :role_write_id, "Min. write role" %></td>
|
||||
<td><%= f.select :role_write_id, role_selection, include_blank: false %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= f.submit "Update group", class: "btn blue" %>
|
||||
<% end %>
|
||||
<%= button_to "Delete group", @post, :method => "delete", :confirm => "Delete group?\nForums + Threads will not be accessible!", class: "btn red right" %>
|
||||
@@ -1,16 +1,23 @@
|
||||
<h1>New forum group</h1>
|
||||
<%= simple_form_for @group do |f|%>
|
||||
<div id="form_labels">
|
||||
<%= f.label :name %>
|
||||
<%= f.label :position %>
|
||||
<%= f.label :role_read_id, "Min read role" %>
|
||||
<%= f.label :role_write_id, "Min write role" %>
|
||||
</div>
|
||||
<div id="form_inputs">
|
||||
<%= f.input :name, placeholder: "Name" %>
|
||||
<%= f.input :position, placeholder: "Position" %>
|
||||
<%= f.input :role_read_id, as: :select, collection: Role.all_from(Role.get :default), include_blank: "None" %>
|
||||
<%= f.input :role_write_id, as: :select, collection: Role.all_from(Role.get :default), include_blank: false %>
|
||||
</div>
|
||||
<%= f.submit "Create group", class: "btn blue" %>
|
||||
<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %>
|
||||
<%= form_for @group do |f|%>
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= f.label :name %></td>
|
||||
<td><%= f.text_field :name, placeholder: "Name" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :position %></td>
|
||||
<td><%= f.number_field :position, placeholder: "Position" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :role_read_id, "Min. read role" %></td>
|
||||
<td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :role_write_id, "Min. write role" %></td>
|
||||
<td><%= f.select :role_write_id, role_selection, include_blank: false %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= f.submit "Create group", class: "btn blue" %>
|
||||
<% end %>
|
||||
@@ -1,12 +1,13 @@
|
||||
<div id="forum_groups">
|
||||
<% @groups.each do |group| %>
|
||||
<div class="item_group" id="forums-<%= group.id %>">
|
||||
<div class="item-group" id="forums-<%= group.id %>">
|
||||
<div class="header">
|
||||
<%= group.name %>
|
||||
<%= link_to "edit", edit_forumgroup_path(group), class: "editlink" if admin? %>
|
||||
<%= link_to "+", new_forum_path(forumgroup: group), class: "editlink" if admin? %>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<div class="items bold">
|
||||
<% group.forums.each do |f| %>
|
||||
<%= link_to f.name, f, class: "item" %>
|
||||
<% end %>
|
||||
@@ -14,4 +15,10 @@
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if admin? %>
|
||||
<%= link_to "New group", new_forumgroup_path, class: "btn blue" %>
|
||||
<% elsif mod? %>
|
||||
<%= link_to "New group", nil, class: "btn blue", disabled: true %>
|
||||
<% end %>
|
||||
@@ -1,17 +1,25 @@
|
||||
<%= link_to @group %> → New forum
|
||||
<h1>New forum</h1>
|
||||
<%= simple_form_for [@group, @forum] do |f|%>
|
||||
<div id="form_labels">
|
||||
<%= f.label :name %>
|
||||
<%= f.label :position %>
|
||||
<%= f.label :role_read_id, "Min read role" %>
|
||||
<%= f.label :role_write_id, "Min write role" %>
|
||||
</div>
|
||||
<div id="form_inputs">
|
||||
<%= f.input :name, placeholder: "Name" %>
|
||||
<%= f.input :position, placeholder: "Position" %>
|
||||
<%= f.input :role_read_id, as: :select, collection: Role.all_from(Role.get :default), include_blank: "None" %>
|
||||
<%= f.input :role_write_id, as: :select, collection: Role.all_from(Role.get :default), include_blank: false %>
|
||||
</div>
|
||||
<%= f.submit "Create forum", class: "btn blue" %>
|
||||
<% end %>
|
||||
<%= link_to @group, forumgroup_path(@group) %> → New forum
|
||||
<h1>New forum forum</h1>
|
||||
<% role_selection = Role.all_from_to(:normal, :admin).collect{|p|[p.name, p.id]} %>
|
||||
<%= form_for @forum do |f|%>
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= f.label :name %></td>
|
||||
<td><%= f.text_field :name, placeholder: "Name" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :position %></td>
|
||||
<td><%= f.number_field :position, placeholder: "Position" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :role_read_id, "Min. read role" %></td>
|
||||
<td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :role_write_id, "Min. write role" %></td>
|
||||
<td><%= f.select :role_write_id, role_selection, include_blank: false %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= f.hidden_field :forumgroup_id, value: @group.id %>
|
||||
<%= f.submit "Create forum", class: "btn blue" %>
|
||||
<% end %>
|
||||
@@ -1,14 +1,20 @@
|
||||
<%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= link_to @forum %>
|
||||
|
||||
<p><%= link_to "New thread", new_forum_forumthread_path(@forum), class: "btn blue" %></p>
|
||||
|
||||
<h1><%= @forum %></h1>
|
||||
<div id="forum_groups">
|
||||
<div id="forum-<%= @forum.id %>" class="item_group">
|
||||
<div class="header">
|
||||
<%= @forum.name %> <%= link_to "edit", edit_forum_path(@forum), class: "editlink" %>
|
||||
<% @threads.each do |thread| %>
|
||||
<div class="item-group with-avatar" id="thread-<%= thread.id %>">
|
||||
<%= link_to(image_tag(thread.author.avatar_url(64), class: "avatar"), thread.author, title: thread.author.ign) %>
|
||||
<div class="header">
|
||||
<%= render partial: "users/username", locals: { user: thread.author } %> <time><%= link_to thread.created_at.strftime("%e. %b %Y, %H:%m"), thread %></time>
|
||||
<span class="comment-counter">
|
||||
<%= link_to pluralize(thread.replies.count, "Reply"), thread %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="items bold">
|
||||
<%= link_to thread.title, forumthread_path(thread), class: "item#{" locked" if thread.locked}#{" sticky" if thread.sticky}" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<% @threads.each do |thread| %>
|
||||
<%= link_to thread.title, forum_forumthread_path(@forum, thread), class: "item#{" locked" if thread.locked}#{" sticky" if thread.sticky}" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<p><%= link_to "New thread", new_forumthread_path(forum_id: @forum), class: "btn blue" %></p>
|
||||
@@ -1,17 +1,22 @@
|
||||
<%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= link_to @forum, @forum %> → New thread
|
||||
<h1>New thread</h1>
|
||||
<%= simple_form_for [@forum, @thread] do |f|%>
|
||||
<% if mod? %>
|
||||
<%= f.label :sticky %> <%= f.input :sticky %>
|
||||
<%= f.label :locked %> <%= f.input :locked %>
|
||||
<% end %>
|
||||
<div id="form_labels">
|
||||
<%= f.label :title %>
|
||||
</div>
|
||||
<%= form_for [@forum, @thread] do |f|%>
|
||||
<table>
|
||||
<% if mod? %>
|
||||
<tr>
|
||||
<td><%= f.label :sticky %></td>
|
||||
<td><%= f.check_box :sticky %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :locked %></td>
|
||||
<td><%= f.check_box :locked %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<div id="form_inputs">
|
||||
<%= f.input :title, placeholder: "Title" %>
|
||||
<%= f.text_field :title, placeholder: "Title" %>
|
||||
</div>
|
||||
<%= f.hidden_field :content, id: "epic-textarea", placeholder: "Text" %>
|
||||
<div id="epic"></div>
|
||||
<%= f.submit "Create thread", class: "btn blue" %><br>
|
||||
<p><%= f.submit "Create thread", class: "btn blue" %></p>
|
||||
<% end %>
|
||||
@@ -1,16 +1,29 @@
|
||||
<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → <%= link_to @thread %>
|
||||
<div class="post">
|
||||
<div class="thread-title">
|
||||
<h1><%= @thread.title %></h1>
|
||||
<div>
|
||||
<%= params.inspect %><br>
|
||||
<%= @forum.inspect %><br>
|
||||
<%= @thread.forum.inspect %>
|
||||
</div>
|
||||
<div class="item-group thread with-avatar" id="thread-<%= @thread.id %>">
|
||||
<%= link_to(image_tag(@thread.author.avatar_url(64), class: "avatar"), @thread.author, title: @thread.author.ign) %>
|
||||
<div class="header">
|
||||
<%= render partial: "users/username", locals: { user: @thread.author } %> <time><%= link_to @thread.created_at.strftime("%e. %b %Y, %H:%m"), p %></time>
|
||||
<%= link_to "edit", edit_forumthread_path( @thread), class: "editlink" if mod? %>
|
||||
</div>
|
||||
<div class="thread-info"><%= link_user @thread.author %> on <%= @thread.created_at.strftime("%e. %b %Y") %>
|
||||
<% if mod? %>
|
||||
<%= link_to "edit", edit_forum_forumthread_path(@thread.forum, @thread), class: "thread-edit" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="thread-content">
|
||||
<%= Sanitize.clean(GitHub::Markdown.render_gfm(@thread.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
<div class="items">
|
||||
<div class="item content">
|
||||
<h2 class="headline"><%= link_to truncate(@thread.title, length: 60, omission: " …"), p %></h2>
|
||||
<%= Sanitize.clean(GitHub::Markdown.render_gfm(@thread.content), Sanitize::Config::RELAXED).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
(replies go here)
|
||||
<div id="replies">
|
||||
<h3><%= "#{pluralize(@thread.replies.length, 'reply')}." %></h3>
|
||||
<% @thread.replies.each do |c| %>
|
||||
Reply<%# render "threadreplies/reply", :c => c %>
|
||||
<% end %>
|
||||
<% unless @thread.can_read?(current_user) %>
|
||||
new
|
||||
<%# render "threadreplies/new" %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -5,10 +5,10 @@
|
||||
<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 current_user.name, current_user %><br/>
|
||||
<%= link_to "Logout", logout_path %>
|
||||
</span>
|
||||
<%= link_to image_tag(avatar_url(current_user.id, 32), :class => "avatar"), current_user %>
|
||||
<%= link_to image_tag(current_user.avatar_url(32), :class => "avatar"), current_user %>
|
||||
<% else %>
|
||||
<%= link_to "Log in", login_path(return_path: request.env['PATH_INFO']), action: "new" %> | <%= link_to "Sign up", signup_path %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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.
|
||||
<p>To use your account, you need to <%= link_to "confirm", confirm_user_path(@user, code: @user.email_token, only_path: false) %> your email address.</p>
|
||||
|
||||
<% if @mcpw %>
|
||||
<div>
|
||||
@@ -21,9 +21,12 @@ Hi <%= @user.name %>!
|
||||
|
||||
<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;" %>
|
||||
<%= link_to "confirm my email", confirm_user_path(@user, code: @user.email_token, 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>
|
||||
<p>Your Redstoner team</p>
|
||||
|
||||
|
||||
<i style="color: #555;">If you did not sign up on redstoner.com you can safely ignore this email</i>
|
||||
4
app/views/users/_username.html.erb
Normal file
4
app/views/users/_username.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<div class="user">
|
||||
<%= link_to user.name, user_path(user.id), class: "role #{user.role.name}", title: user.ign %>
|
||||
<% link_to_if "$", donate_statics_path, class: "donor", title: "Donator" if user.donor? %>
|
||||
</div>
|
||||
@@ -7,68 +7,67 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><%= image_tag avatar_url(@user.id, 128), :class => "user-avatar avatar", :alt => "avatar" %></td>
|
||||
<td><%= image_tag @user.avatar_url(128), :class => "user-avatar avatar", :alt => "avatar" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Display name</td>
|
||||
<td>
|
||||
<%= f.input :name, :label => false, disabled: !can_edit? %>
|
||||
</td>
|
||||
</tr>
|
||||
<td>In-game name</td>
|
||||
<td>
|
||||
<%= f.input :ign, :label => false, disabled: !(mod? && current_user.role >= @user.role) %>
|
||||
</td>
|
||||
</tr>
|
||||
<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>
|
||||
<tr>
|
||||
<td>
|
||||
Skype username
|
||||
</td>
|
||||
<td>
|
||||
<%= f.input :skype, label: false, placeholder: "Skype username", disabled: !can_edit? %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Show Skype to
|
||||
</td>
|
||||
<td>
|
||||
<%= f.input :skype_public, label: false, as: :select, collection: [["Staff only", false], ["All users", true]], include_blank: false, input_html: { disabled: !can_edit? } %>
|
||||
</td>
|
||||
<tr>
|
||||
<td>YouTube username</td>
|
||||
<td>
|
||||
<%= f.input :youtube, :label => false, placeholder: "YouTube username", disabled: !can_edit? %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Twitter username</td>
|
||||
<td>
|
||||
<%= f.input :twitter, :label => false, placeholder: "Twitter username", disabled: !(@user.is?(current_user) && confirmed? || (mod? && current_user.role >= @user.role)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>About you</td>
|
||||
<td>
|
||||
<%= f.input :about, :label => false, :input_html => {:class => "vertical"}, placeholder: "Tell us something about you...", disabled: !can_edit? %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= f.submit "Save profile", class: "btn blue", disabled: (@user.unconfirmed? && @user.is?(current_user)) %>
|
||||
<% if @user.unconfirmed? %>
|
||||
<% if @user.is?(current_user) %>
|
||||
<%= f.input :name, :label => false, disabled: !can_edit? %>
|
||||
</td>
|
||||
</tr>
|
||||
<% if mod? %>
|
||||
<tr>
|
||||
<td>In-game name</td>
|
||||
<td>
|
||||
<%= f.input :ign, :label => false, disabled: !(mod? && current_user.role >= @user.role) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Role</td>
|
||||
<td>
|
||||
<% if mod? && current_user.role >= @user.role %>
|
||||
<%= f.association :role, :label => false, :collection => Role.all_to(current_user.role), :include_blank => false %>
|
||||
<% else %>
|
||||
<%= f.input :role, label: false, disabled: true %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td>Skype username</td>
|
||||
<td>
|
||||
<%= f.input :skype, label: false, placeholder: "Skype username", disabled: !can_edit? %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Show Skype to</td>
|
||||
<td>
|
||||
<%= f.input :skype_public, label: false, as: :select, collection: [["Staff only", false], ["All users", true]], include_blank: false, input_html: { disabled: !can_edit? } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>YouTube username</td>
|
||||
<td>
|
||||
<%= f.input :youtube, :label => false, placeholder: "YouTube username", disabled: !can_edit? %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Twitter username</td>
|
||||
<td>
|
||||
<%= f.input :twitter, :label => false, placeholder: "Twitter username", disabled: !(@user.is?(current_user) && confirmed? || (mod? && current_user.role >= @user.role)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>About you</td>
|
||||
<td>
|
||||
<%= f.input :about, :label => false, :input_html => {:class => "vertical"}, placeholder: "Tell us something about you...", disabled: !can_edit? %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= f.submit "Save profile", class: "btn blue", disabled: (!@user.confirmed? && @user.is?(current_user)) %>
|
||||
<% if !@user.confirmed? %>
|
||||
<% if @user.is?(current_user) %>
|
||||
<span class='red-alert'>Please confirm your email adress first!</span>
|
||||
<% else %>
|
||||
<span class='red-alert'>This user has not confirmed his email!</span>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<% filter = params[:role] %>
|
||||
<% if filter %>
|
||||
<h1>All '<%= filter %>' users</h1>
|
||||
<% if params[:role] %>
|
||||
<h1>All '<%= params[:role] %>' users</h1>
|
||||
<%= link_to "show all", users_path %>
|
||||
<% else %>
|
||||
<h1> All users </h1>
|
||||
@@ -8,13 +7,10 @@
|
||||
<div id="userlist">
|
||||
<% @users.each do |u| %>
|
||||
<div class="list-user">
|
||||
<%= link_to u, class: "avatar_url" do %>
|
||||
<%= image_tag(avatar_url(u.id, 64), :class => "avatar", :alt => "avatar") %>
|
||||
<% end %>
|
||||
<div class="user-info">
|
||||
<span class="user-name"><%= link_user u %></span>
|
||||
<span class="user-ign"><%= u.ign %></span>
|
||||
<span class="user-role"><%= link_to u.role, users_path(:role => u.role.name) %></span>
|
||||
<%= link_to(image_tag(u.avatar_url(64)), u) %>
|
||||
<div class="detail">
|
||||
<%= render partial: "users/username", locals: { user: u } %><br>
|
||||
<i><%= u.ign %></i>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
<h1>Sign up</h1>
|
||||
|
||||
<%= simple_form_for @user do |f| %>
|
||||
<div id="form_labels">
|
||||
<%= f.label :name, "Display name" %>
|
||||
<%= f.label :ign, "Minecraft name" %>
|
||||
<%= f.label :email, "Email" %>
|
||||
<%= f.label :password, "Password" %>
|
||||
<%= f.label :password_confirmation, "Confirm" %>
|
||||
</div>
|
||||
<div id="form_inputs">
|
||||
<%= f.input :name, placeholder: "John" %>
|
||||
<%= f.input :ign, placeholder: "johndoe_1337" %>
|
||||
<%= f.input :email, placeholder: "johndoe@example.com" %>
|
||||
<%= f.input :password, placeholder: "••••••" %>
|
||||
<%= f.input :password_confirmation, placeholder: "••••••" %>
|
||||
</div>
|
||||
<p>To get a <i>token</i>, join the Minecraft server (redstoner.com) and use the <code>/token <your-email></code> command.</p>
|
||||
|
||||
<%= form_for @user do |f| %>
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= f.label :ign, "Minecraft name" %></td>
|
||||
<td><%= f.text_field :ign, placeholder: "Steve", pattern: "[a-zA-Z0-9_]{2,16}", required: true, title: "Your IGN" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :email, "Email" %></td>
|
||||
<td><%= f.email_field :email, placeholder: "steve@example.com", required: true, pattern: ".+@.+", title: "enter valid email adress", "x-moz-errormessage" => "enter valid email adress" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :registration_token, "Token" %></td>
|
||||
<td><%= text_field_tag :registration_token, nil, placeholder: "abcdef", required: true, pattern: "[a-z]{6}", title: "6 character token", "x-moz-errormessage" => "6 character token" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :password, "Password" %></td>
|
||||
<td><%= f.password_field :password, placeholder: "secret", required: true, pattern: ".{8,}", title: "minimum 8 characters", "x-moz-errormessage" => "minimum 8 characters" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.label :password_confirmation, "Confirm" %></td>
|
||||
<td><%= f.password_field :password_confirmation, placeholder: "secret", required: true, pattern: ".{8,}", title: "minimum 8 characters", "x-moz-errormessage" => "minimum 8 characters" %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= f.submit "Sign up", class: "btn blue" %>
|
||||
<% end %>
|
||||
@@ -15,7 +15,7 @@
|
||||
<% if @user.banned? %>
|
||||
<span class="user-banned">This user is banned!</span>
|
||||
<% end %>
|
||||
<% if @user.unconfirmed? %>
|
||||
<% if !@user.confirmed? %>
|
||||
<% if @user.is?(current_user) %>
|
||||
<span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span>
|
||||
<% else %>
|
||||
@@ -25,62 +25,62 @@
|
||||
<% 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>
|
||||
<span class="user-unconfirmed">This account has been disabled.</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= image_tag avatar_url(@user.id, 128), :class => "user-avatar avatar", :alt => "avatar" %>
|
||||
<%= image_tag @user.avatar_url(128), :class => "user-avatar avatar", :alt => "avatar" %>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>IGN</td>
|
||||
<td><%= @user.ign %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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><%= link_to @user.skype, "skype:#{@user.skype}?chat", target: "_blank" %></a></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% 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>
|
||||
</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>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td>Joined</td>
|
||||
<td><%= @user.created_at.strftime("%e. %b %Y") %></td>
|
||||
</tr>
|
||||
<% if mod? || current_user == @user %>
|
||||
<% if mod? %>
|
||||
<tr>
|
||||
<td>IGN</td>
|
||||
<td><%= @user.ign %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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><%= link_to @user.skype, "skype:#{@user.skype}?chat", target: "_blank" %></a></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% 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>
|
||||
</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>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td>Joined</td>
|
||||
<td><%= @user.created_at.strftime("%e. %b %Y, %H:%m") %></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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last login</td>
|
||||
<td><%= @user.last_login.strftime("%e. %b %Y, %H:%M") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<%= @user.about.blank? ? "<span class=\"no-about\">nothing</span>".html_safe : @user.about %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td>Email</td>
|
||||
<td><%= mail_to @user.email, @user.email, :subject => "Redstoner" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last seen</td>
|
||||
<td><%= @user.last_seen.strftime("%e. %b %Y, %H:%M") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<%= @user.about.blank? ? "<span class=\"no-about\">nothing</span>".html_safe : @user.about %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user