summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/images/logo.pngbin4065 -> 19080 bytes
-rw-r--r--app/assets/stylesheets/screen.css.scss236
-rw-r--r--app/models/user.rb6
-rw-r--r--app/views/blogposts/index.html.erb2
-rw-r--r--app/views/forumthreads/show.html.erb5
-rw-r--r--app/views/layouts/_head.html.erb32
-rw-r--r--app/views/layouts/application.html.erb1
-rw-r--r--app/views/sessions/new.html.erb22
-rw-r--r--app/views/statics/donate.html.erb6
-rw-r--r--app/views/users/_username.html.erb2
-rw-r--r--app/views/users/show.html.erb16
-rw-r--r--db/schema.rb1
12 files changed, 177 insertions, 152 deletions
diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png
index ace0e5b..8b006eb 100644
--- a/app/assets/images/logo.png
+++ b/app/assets/images/logo.png
Binary files differ
diff --git a/app/assets/stylesheets/screen.css.scss b/app/assets/stylesheets/screen.css.scss
index 3456bea..1ba6182 100644
--- a/app/assets/stylesheets/screen.css.scss
+++ b/app/assets/stylesheets/screen.css.scss
@@ -16,12 +16,15 @@ and (min-width: 0px) //TODO
html {
overflow-y: scroll;
+ padding: 0 !important;
+ margin: 0 !important;
}
body {
- background-image: url('/assets/bg.png');
background-color: #F2F2F2;
- color: #222;
+ color: #3F3F3F;
+ padding: 0 !important;
+ margin: 0 !important;
}
#mobile-info {
@@ -51,56 +54,76 @@ and (min-width: 0px) //TODO
}
}
#head {
- background-image: url('/assets/head_bg.png');
- width: 100%;
- margin: auto;
- position: relative;
- text-align: center;
-
- #userinfo {
- position: absolute;
- top: 0;
- right: 0;
- margin: 10px;
- img.avatar {
- border: 1px solid #000;
- border-radius: 16px;
- vertical-align: middle;
- height: 32px;
- width: 32px;
+ #menu {
+ background: #3F3F3F;
+ height: 50px;
+ border-bottom: 1px solid #363636;
+ position: relative;
+ text-shadow: 0 1px 1px #222;
+ #logo {
+ width: 100px;
+ height: 100px;
+ position: absolute;
+ background: url(image_path('logo.png')) no-repeat;
+ background-position: 0 -100px;
+ left: 85px;
&:hover {
- box-shadow: 0 0 2px;
+ transition: all 0.3s ease 0s;
+ background-position: 0 0;
}
}
- #userinfo-box {
- float: left;
- text-align: right;
- margin: 5px;
- line-height: 1em;
- }
- }
- #menu {
- width: 100%;
- background: #686969;
- input {
- display: inline;
- }
ul {
- float: left;
- margin: 0;
+ margin: 0 0 0 185px;
padding: 0;
+ list-style: none;
+ line-height: 0;
a {
- color: #bbb;
+ display: inline-block;
+ color: #fff;
&:hover {
- color: #fff;
+ color: #bbb;
}
}
li {
- float: left;
- height: 100%;
- margin: auto 10px;
- display: block;
- font-size: 1.5em;
+ margin: 15px 10px;
+ font-size: 20px;
+ line-height: 1em;
+ }
+ }
+ }
+ #userbar {
+ border-bottom: 1px solid #d1d1d1;
+ height: 50px;
+ line-height: 50px;
+ text-align: right;
+ display: inline-block;
+ width: 100%;
+ background: #eaeaea;
+ #userinfo {
+ display: inline-block;
+ margin-right: 10px;
+ text-shadow: 0 1px 1px #fff;
+ a {
+ color: #3F3F3F;
+ &:hover {
+ color: #f00;
+ }
+ }
+ img.avatar {
+ border: 1px solid #000;
+ border-radius: 16px;
+ vertical-align: middle;
+ height: 32px;
+ width: 32px;
+ &:hover {
+ box-shadow: 0 0 2px;
+ }
+ }
+ #userinfo-box {
+ display: inline-block;
+ text-align: right;
+ vertical-align: middle;
+ line-height: 1em;
}
}
}
@@ -135,11 +158,16 @@ and (min-width: 0px) //TODO
font-weight: normal;
font-size: 200%;
margin: 0;
- color: #888;
text-shadow: 0 1px #999;
}
}
+ #user-info {
+ .user-avatar {
+ margin-bottom: 30px;
+ }
+ }
+
.user-avatar {
display: block;
}
@@ -163,7 +191,6 @@ and (min-width: 0px) //TODO
}
h2 {
font-weight: normal;
- color: #700;
text-transform: capitalize;
display: inline;
font-size: 200%;
@@ -172,24 +199,6 @@ and (min-width: 0px) //TODO
float: right;
}
}
- .post-info, .thread-info {
- border-bottom: 2px dashed #999;
- color: #888;
- width: 100%;
- a {
- color: #755;
- &:hover {
- color: #d55;
- }
- }
- .post-edit, .thread-edit {
- float: right;
- margin-right: 10px;
- }
- time {
- float: right;
- }
- }
table {
tr, td, th {
border-collapse: collapse;
@@ -204,48 +213,61 @@ and (min-width: 0px) //TODO
}
}
td, th {
- padding: 0.3em;
+ padding: 0.3em 1em;
}
thead {
- background: #def;
+ background: #3F3F3F;
+ color: #fff;
}
}
}
pre {
- background: #ddd;
- padding: 0.5em;
- overflow: auto;
+ background: #3F3F3F;
+ border-radius: 2px;
+ box-shadow: 0 0 16px #222 inset;
+ position: relative;
+ padding: 1em;
+ &:after {
+ color: #fff;
+ content: attr(lang); // show language on top right
+ font-style: italic;
+ margin: 10px;
+ position: absolute;
+ right: -10px;
+ top: 0;
+ opacity: 0;
+ transition: all 0.3s;
+ cursor: default;
+ }
+ &:hover:after {
+ opacity: 1;
+ right: 0;
+ }
+ code {
+ background: transparent;
+ padding: 0;
+ }
}
code {
- background: #ddd;
+ background: #3F3F3F;
+ padding: 0 2px;
+ border-radius: 3px;
+ color: #ddd;
+ text-shadow: 1px 1px #000;
}
table, tr, td, th {
border-collapse: collapse;
}
- pre code {
- background: inherit;
- padding: 0;
- }
-
blockquote {
- background: #f9f9f9;
- border-left: 10px solid #ccc;
- margin: 1.5em 10px;
- padding: 0.5em 10px;
- quotes: "\201C""\201D""\2018""\2019";
- }
-
- blockquote:before {
- color: #ccc;
- content: open-quote;
- font-size: 4em;
- line-height: 0.1em;
- margin-right: 0.25em;
- vertical-align: -0.4em;
+ background: #F9F9F9;
+ border-left: 10px solid #3F3F3F;
+ display: inline-block;
+ margin: 0 0 0 2em;
+ padding: 0.5em 3em 0 10px;
}
blockquote p {
@@ -257,33 +279,33 @@ and (min-width: 0px) //TODO
display: inline-block;
a.role {
display: inline-block;
- color: #fff;
+ color: #fff !important;
font-weight: bold;
padding: 0 0.5em;
border-radius: 3px;
&.superadmin, &.admin {
- background: #d22;
+ background: #d22 !important;
}
&.mod {
- background: #6af;
+ background: #6af !important;
}
&.normal {
- background: #aaa;
+ background: #aaa !important;
}
&.banned, &.disabled {
- background: #ccc;
- text-decoration: line-through;
- color: #888;
+ background: #ccc !important;
+ text-decoration: line-through !important;
+ color: #888 !important;
}
&:hover {
- color: #ddd;
+ color: #ddd !important;
}
}
.donor {
- background: #f60;
+ background: #f60 !important;
border-radius: 3px;
- color: #fff;
- font-weight: bold;
+ color: #fff !important;
+ font-weight: bold !important;
margin-left: 3px;
padding: 0 0.5em;
display: inline-block;
@@ -501,7 +523,7 @@ and (min-width: 0px) //TODO
}
.item-group {
- margin: 10px 0;
+ margin: 30px 0;
&.with-avatar {
margin-left: 70px;
.avatar {
@@ -516,10 +538,18 @@ and (min-width: 0px) //TODO
margin-right: 0;
}
.header {
- background: #ddd;
+ background: #3F3F3F;
border-radius: 5px 5px 0 0;
padding: 0.5em;
border-bottom: 1px solid #ccc;
+ color: #fff;
+ text-shadow: 0 1px 1px #222;
+ a {
+ color: #fff;
+ &:hover {
+ color: #f66;
+ }
+ }
}
.items {
border: 1px solid #ddd;
@@ -530,19 +560,19 @@ and (min-width: 0px) //TODO
padding: 0.5em;
border-bottom: 1px solid #ddd;
&.locked:after {
- background-image: url('/assets/lock.png');
+ background-image: url(image_path('/assets/lock.png'));
width: 20px;
height: 20px;
display: inline-block;
}
&.sticky:after {
- background-image: url('/assets/pin.png');
+ background-image: url(image_path('/assets/pin.png'));
width: 20px;
height: 20px;
display: inline-block;
}
&.sticky-locked:after {
- background-image: url('/assets/lock.png');
+ background-image: url(image_path('/assets/lock.png'));
width: 20px;
height: 20px;
display: inline-block;
diff --git a/app/models/user.rb b/app/models/user.rb
index 601ce01..0245424 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -20,7 +20,7 @@ class User < ActiveRecord::Base
validates :email, uniqueness: {case_sensitive: false}, format: {with: /^.+@.+\..{2,}$/i, message: "That doesn't look like an email adress."}
validates :ign, uniqueness: {case_sensitive: false}, format: {with: /^[a-z\d_]+$/i, message: "That is probably not your username."}
- validate :ign_has_paid
+ validate :has_paid, :if => lambda {|user| user.ign_changed? }
has_many :blogposts
has_many :comments
@@ -179,8 +179,8 @@ class User < ActiveRecord::Base
self.role ||= Role.get(:normal)
end
- def ign_has_paid
- errors.add(:ign, "'#{self.ign}' is not a valid account!") unless self.haspaid?
+ def has_paid
+ errors.add(:ign, "'#{self.ign}' is not a paid account!") unless self.haspaid?
end
def strip_whitespaces
diff --git a/app/views/blogposts/index.html.erb b/app/views/blogposts/index.html.erb
index e2c989b..5bcd690 100644
--- a/app/views/blogposts/index.html.erb
+++ b/app/views/blogposts/index.html.erb
@@ -10,7 +10,7 @@
</span>
</div>
<div class="items">
- <div class="item content">
+ <div class="item content post">
<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>
diff --git a/app/views/forumthreads/show.html.erb b/app/views/forumthreads/show.html.erb
index d57b2e6..8138159 100644
--- a/app/views/forumthreads/show.html.erb
+++ b/app/views/forumthreads/show.html.erb
@@ -1,9 +1,4 @@
<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → <%= link_to @thread %>
-<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">
diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb
index 47cac44..25b89dc 100644
--- a/app/views/layouts/_head.html.erb
+++ b/app/views/layouts/_head.html.erb
@@ -1,28 +1,26 @@
<div id="head">
- <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, current_user %><br/>
- <%= link_to "Logout", logout_path %>
- </span>
- <%= 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 %>
- </div>
- <div class="clear"></div>
<div id="menu">
+ <%= link_to "", root_path, id: "logo" %>
<ul>
<%= link_to statics_path do %><li>Home</li><% end %>
- <%= link_to blogposts_path do %><li>Blog</li><% end %>
+ <%= link_to blogposts_path do %><li>News</li><% end %>
<%= link_to root_path do %><li>Info</li><% end %>
<%= link_to forums_path do %><li>Forums</li><% end %>
<%= link_to users_path do %><li>Users</li><% end %>
<%= link_to donate_statics_path do %><li>Donate</li><% end %>
</ul>
- <div class="clear"></div>
+ </div>
+ <div id="userbar">
+ <div id="userinfo" <%= "class=\"logged-out\"".html_safe unless current_user %>>
+ <% if current_user %>
+ <span id="userinfo-box">
+ <%= link_to current_user.name, current_user %><br/>
+ <%= link_to "Logout", logout_path %>
+ </span>
+ <%= 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 %>
+ </div>
</div>
</div> \ No newline at end of file
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 9dd651a..696c5ad 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -7,6 +7,7 @@
<%= csrf_meta_tags %>
<%= favicon_link_tag "favicon.ico" %>
<%= javascript_include_tag "application" %>
+ <link type="application/atom+xml" rel="alternate" href="<%= blogposts_path(:atom) %>">
</head>
<body>
<div id="mobile-info">We don't have a mobile style yet. It might look shitty.<br>Tip: Hold your device in landscape mode.</div>
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index e1a46da..fe1a2d7 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -1,15 +1,15 @@
<h1>Log in</h1>
<p>Not a member? <%= link_to "Join us", signup_path %>!</p>
<%= form_tag login_path do |f| %>
- <div id="form_labels">
- <%= label_tag :email %>
- <%= label_tag :password %>
- </div>
-
- <div id="form_inputs">
- <div><%= text_field_tag :email, nil, placeholder: "email@example.com" %></div>
- <div><%= password_field_tag :password, nil, placeholder: "••••••" %></div>
- </div>
-
- <%= submit_tag "Log in", class: "btn blue" %>
+ <table>
+ <tr>
+ <td><%= label_tag :email %></td>
+ <td><%= text_field_tag :email, nil, placeholder: "email@example.com" %></td>
+ </tr>
+ <tr>
+ <td><%= label_tag :password %></td>
+ <td><%= password_field_tag :password, nil, placeholder: "******" %></td>
+ </tr>
+ </table>
+ <p><%= submit_tag "Log in", class: "btn blue" %></p>
<% end %> \ No newline at end of file
diff --git a/app/views/statics/donate.html.erb b/app/views/statics/donate.html.erb
index 66b6acf..3372955 100644
--- a/app/views/statics/donate.html.erb
+++ b/app/views/statics/donate.html.erb
@@ -2,8 +2,8 @@
<p>Running a server is really stressful and expensive.<br>
Donating keeps us motivated to do all the work and allows us to pay our bills, etc.</p>
-<p>Donations are made via <a href="https://www.paypal.com" target="_blank">PayPal</a>
-<p>We appreciate every amount of donation but we decided to create two special ranks:</p>
+<p>Donations are made via <a href="https://www.paypal.com" target="_blank">PayPal</a>.
+<p>We do appreciate every amount of donation but we have decided to create two special ranks:</p>
<ul>
<li>Donator ($5 or more)
<li>Donator+ ($20 or more)
@@ -15,7 +15,7 @@
<li>The warm feeling of donating and a big thank you!
<li>Commands <i>/speed</i> and <i>/enchant</i>
<li>You can have a nickname. See <i>/nick</i>
- <li>A "$" next to your name
+ <li>A "$" next to your name <i>(Including website)</i>
<li>The name above your head gets a special color
<li>Your head + a sign with your name at <i>/warp donors</i>
</ul>
diff --git a/app/views/users/_username.html.erb b/app/views/users/_username.html.erb
index 21e06ee..4fff9b7 100644
--- a/app/views/users/_username.html.erb
+++ b/app/views/users/_username.html.erb
@@ -1,4 +1,4 @@
<div class="user">
- <%= link_to user.name, user_path(user.id), class: "role #{user.role.name}", title: user.ign %>
+ <%= link_to user.name, user_path(user.id), class: "role #{user.role.name} #{"banned" if user.banned?} #{"disabled" if user.disabled?}", title: user.ign %>
<% link_to_if "$", donate_statics_path, class: "donor", title: "Donator" if user.donor? %>
</div> \ No newline at end of file
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 5985c33..39bff81 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -15,6 +15,7 @@
<% if @user.banned? %>
<span class="user-banned">This user is banned!</span>
<% end %>
+
<% if !@user.confirmed? %>
<% if @user.is?(current_user) %>
<span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span>
@@ -31,6 +32,7 @@
<%= image_tag @user.avatar_url(128), :class => "user-avatar avatar", :alt => "avatar" %>
+ <%= render partial: "users/username", locals: {user: @user} %>
<table>
<tbody>
<tr>
@@ -63,13 +65,11 @@
<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 %>
+ <% if mod? || @user.is?(current_user) %>
+ <tr>
+ <td>Last IP</td>
+ <td><%= @user.last_ip %></td>
+ </tr>
<tr>
<td>Email</td>
<td><%= mail_to @user.email, @user.email, :subject => "Redstoner" %></td>
@@ -81,6 +81,6 @@
<% end %>
</tbody>
</table>
- <hr>
+ About:<br>
<%= @user.about.blank? ? "<span class=\"no-about\">nothing</span>".html_safe : @user.about %>
</div> \ No newline at end of file
diff --git a/db/schema.rb b/db/schema.rb
index cfb8d63..b877bbc 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -60,6 +60,7 @@ ActiveRecord::Schema.define(:version => 10) do
create_table "register_tokens", :primary_key => "uuid", :force => true do |t|
t.string "token", :limit => 6, :null => false
+ t.string "email", :null => false
end
create_table "roles", :force => true do |t|