LOTS of stuff
This commit is contained in:
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