mostly styles

This commit is contained in:
jomo
2014-04-08 00:49:17 +02:00
parent f290258f26
commit b0504467e1
12 changed files with 177 additions and 152 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 19 KiB

+133 -103
View File
@@ -16,12 +16,15 @@ and (min-width: 0px) //TODO
html { html {
overflow-y: scroll; overflow-y: scroll;
padding: 0 !important;
margin: 0 !important;
} }
body { body {
background-image: url('/assets/bg.png');
background-color: #F2F2F2; background-color: #F2F2F2;
color: #222; color: #3F3F3F;
padding: 0 !important;
margin: 0 !important;
} }
#mobile-info { #mobile-info {
@@ -51,56 +54,76 @@ and (min-width: 0px) //TODO
} }
} }
#head { #head {
background-image: url('/assets/head_bg.png'); #menu {
width: 100%; background: #3F3F3F;
margin: auto; height: 50px;
position: relative; border-bottom: 1px solid #363636;
text-align: center; position: relative;
text-shadow: 0 1px 1px #222;
#userinfo { #logo {
position: absolute; width: 100px;
top: 0; height: 100px;
right: 0; position: absolute;
margin: 10px; background: url(image_path('logo.png')) no-repeat;
img.avatar { background-position: 0 -100px;
border: 1px solid #000; left: 85px;
border-radius: 16px;
vertical-align: middle;
height: 32px;
width: 32px;
&:hover { &: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 { ul {
float: left; margin: 0 0 0 185px;
margin: 0;
padding: 0; padding: 0;
list-style: none;
line-height: 0;
a { a {
color: #bbb; display: inline-block;
color: #fff;
&:hover { &:hover {
color: #fff; color: #bbb;
} }
} }
li { li {
float: left; margin: 15px 10px;
height: 100%; font-size: 20px;
margin: auto 10px; line-height: 1em;
display: block; }
font-size: 1.5em; }
}
#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-weight: normal;
font-size: 200%; font-size: 200%;
margin: 0; margin: 0;
color: #888;
text-shadow: 0 1px #999; text-shadow: 0 1px #999;
} }
} }
#user-info {
.user-avatar {
margin-bottom: 30px;
}
}
.user-avatar { .user-avatar {
display: block; display: block;
} }
@@ -163,7 +191,6 @@ and (min-width: 0px) //TODO
} }
h2 { h2 {
font-weight: normal; font-weight: normal;
color: #700;
text-transform: capitalize; text-transform: capitalize;
display: inline; display: inline;
font-size: 200%; font-size: 200%;
@@ -172,24 +199,6 @@ and (min-width: 0px) //TODO
float: right; 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 { table {
tr, td, th { tr, td, th {
border-collapse: collapse; border-collapse: collapse;
@@ -204,48 +213,61 @@ and (min-width: 0px) //TODO
} }
} }
td, th { td, th {
padding: 0.3em; padding: 0.3em 1em;
} }
thead { thead {
background: #def; background: #3F3F3F;
color: #fff;
} }
} }
} }
pre { pre {
background: #ddd; background: #3F3F3F;
padding: 0.5em; border-radius: 2px;
overflow: auto; 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 { code {
background: #ddd; background: #3F3F3F;
padding: 0 2px;
border-radius: 3px;
color: #ddd;
text-shadow: 1px 1px #000;
} }
table, tr, td, th { table, tr, td, th {
border-collapse: collapse; border-collapse: collapse;
} }
pre code {
background: inherit;
padding: 0;
}
blockquote { blockquote {
background: #f9f9f9; background: #F9F9F9;
border-left: 10px solid #ccc; border-left: 10px solid #3F3F3F;
margin: 1.5em 10px; display: inline-block;
padding: 0.5em 10px; margin: 0 0 0 2em;
quotes: "\201C""\201D""\2018""\2019"; padding: 0.5em 3em 0 10px;
}
blockquote:before {
color: #ccc;
content: open-quote;
font-size: 4em;
line-height: 0.1em;
margin-right: 0.25em;
vertical-align: -0.4em;
} }
blockquote p { blockquote p {
@@ -257,33 +279,33 @@ and (min-width: 0px) //TODO
display: inline-block; display: inline-block;
a.role { a.role {
display: inline-block; display: inline-block;
color: #fff; color: #fff !important;
font-weight: bold; font-weight: bold;
padding: 0 0.5em; padding: 0 0.5em;
border-radius: 3px; border-radius: 3px;
&.superadmin, &.admin { &.superadmin, &.admin {
background: #d22; background: #d22 !important;
} }
&.mod { &.mod {
background: #6af; background: #6af !important;
} }
&.normal { &.normal {
background: #aaa; background: #aaa !important;
} }
&.banned, &.disabled { &.banned, &.disabled {
background: #ccc; background: #ccc !important;
text-decoration: line-through; text-decoration: line-through !important;
color: #888; color: #888 !important;
} }
&:hover { &:hover {
color: #ddd; color: #ddd !important;
} }
} }
.donor { .donor {
background: #f60; background: #f60 !important;
border-radius: 3px; border-radius: 3px;
color: #fff; color: #fff !important;
font-weight: bold; font-weight: bold !important;
margin-left: 3px; margin-left: 3px;
padding: 0 0.5em; padding: 0 0.5em;
display: inline-block; display: inline-block;
@@ -501,7 +523,7 @@ and (min-width: 0px) //TODO
} }
.item-group { .item-group {
margin: 10px 0; margin: 30px 0;
&.with-avatar { &.with-avatar {
margin-left: 70px; margin-left: 70px;
.avatar { .avatar {
@@ -516,10 +538,18 @@ and (min-width: 0px) //TODO
margin-right: 0; margin-right: 0;
} }
.header { .header {
background: #ddd; background: #3F3F3F;
border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0;
padding: 0.5em; padding: 0.5em;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
color: #fff;
text-shadow: 0 1px 1px #222;
a {
color: #fff;
&:hover {
color: #f66;
}
}
} }
.items { .items {
border: 1px solid #ddd; border: 1px solid #ddd;
@@ -530,19 +560,19 @@ and (min-width: 0px) //TODO
padding: 0.5em; padding: 0.5em;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
&.locked:after { &.locked:after {
background-image: url('/assets/lock.png'); background-image: url(image_path('/assets/lock.png'));
width: 20px; width: 20px;
height: 20px; height: 20px;
display: inline-block; display: inline-block;
} }
&.sticky:after { &.sticky:after {
background-image: url('/assets/pin.png'); background-image: url(image_path('/assets/pin.png'));
width: 20px; width: 20px;
height: 20px; height: 20px;
display: inline-block; display: inline-block;
} }
&.sticky-locked:after { &.sticky-locked:after {
background-image: url('/assets/lock.png'); background-image: url(image_path('/assets/lock.png'));
width: 20px; width: 20px;
height: 20px; height: 20px;
display: inline-block; display: inline-block;
+3 -3
View File
@@ -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 :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."} 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 :blogposts
has_many :comments has_many :comments
@@ -179,8 +179,8 @@ class User < ActiveRecord::Base
self.role ||= Role.get(:normal) self.role ||= Role.get(:normal)
end end
def ign_has_paid def has_paid
errors.add(:ign, "'#{self.ign}' is not a valid account!") unless self.haspaid? errors.add(:ign, "'#{self.ign}' is not a paid account!") unless self.haspaid?
end end
def strip_whitespaces def strip_whitespaces
+1 -1
View File
@@ -10,7 +10,7 @@
</span> </span>
</div> </div>
<div class="items"> <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> <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 %> <%= Sanitize.clean(GitHub::Markdown.render_gfm(p.content), Sanitize::Config::RELAXED).html_safe %>
</div> </div>
-5
View File
@@ -1,9 +1,4 @@
<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %><%= link_to @thread.forum, @thread.forum %><%= link_to @thread %> <%= 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 %>"> <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) %> <%= link_to(image_tag(@thread.author.avatar_url(64), class: "avatar"), @thread.author, title: @thread.author.ign) %>
<div class="header"> <div class="header">
+15 -17
View File
@@ -1,28 +1,26 @@
<div id="head"> <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"> <div id="menu">
<%= link_to "", root_path, id: "logo" %>
<ul> <ul>
<%= link_to statics_path do %><li>Home</li><% end %> <%= 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 root_path do %><li>Info</li><% end %>
<%= link_to forums_path do %><li>Forums</li><% end %> <%= link_to forums_path do %><li>Forums</li><% end %>
<%= link_to users_path do %><li>Users</li><% end %> <%= link_to users_path do %><li>Users</li><% end %>
<%= link_to donate_statics_path do %><li>Donate</li><% end %> <%= link_to donate_statics_path do %><li>Donate</li><% end %>
</ul> </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>
</div> </div>
+1
View File
@@ -7,6 +7,7 @@
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= favicon_link_tag "favicon.ico" %> <%= favicon_link_tag "favicon.ico" %>
<%= javascript_include_tag "application" %> <%= javascript_include_tag "application" %>
<link type="application/atom+xml" rel="alternate" href="<%= blogposts_path(:atom) %>">
</head> </head>
<body> <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> <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>
+11 -11
View File
@@ -1,15 +1,15 @@
<h1>Log in</h1> <h1>Log in</h1>
<p>Not a member? <%= link_to "Join us", signup_path %>!</p> <p>Not a member? <%= link_to "Join us", signup_path %>!</p>
<%= form_tag login_path do |f| %> <%= form_tag login_path do |f| %>
<div id="form_labels"> <table>
<%= label_tag :email %> <tr>
<%= label_tag :password %> <td><%= label_tag :email %></td>
</div> <td><%= text_field_tag :email, nil, placeholder: "email@example.com" %></td>
</tr>
<div id="form_inputs"> <tr>
<div><%= text_field_tag :email, nil, placeholder: "email@example.com" %></div> <td><%= label_tag :password %></td>
<div><%= password_field_tag :password, nil, placeholder: "••••••" %></div> <td><%= password_field_tag :password, nil, placeholder: "******" %></td>
</div> </tr>
</table>
<%= submit_tag "Log in", class: "btn blue" %> <p><%= submit_tag "Log in", class: "btn blue" %></p>
<% end %> <% end %>
+3 -3
View File
@@ -2,8 +2,8 @@
<p>Running a server is really stressful and expensive.<br> <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> 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>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>We do appreciate every amount of donation but we have decided to create two special ranks:</p>
<ul> <ul>
<li>Donator ($5 or more) <li>Donator ($5 or more)
<li>Donator+ ($20 or more) <li>Donator+ ($20 or more)
@@ -15,7 +15,7 @@
<li>The warm feeling of donating and a big thank you! <li>The warm feeling of donating and a big thank you!
<li>Commands <i>/speed</i> and <i>/enchant</i> <li>Commands <i>/speed</i> and <i>/enchant</i>
<li>You can have a nickname. See <i>/nick</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>The name above your head gets a special color
<li>Your head + a sign with your name at <i>/warp donors</i> <li>Your head + a sign with your name at <i>/warp donors</i>
</ul> </ul>
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="user"> <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? %> <% link_to_if "$", donate_statics_path, class: "donor", title: "Donator" if user.donor? %>
</div> </div>
+8 -8
View File
@@ -15,6 +15,7 @@
<% if @user.banned? %> <% if @user.banned? %>
<span class="user-banned">This user is banned!</span> <span class="user-banned">This user is banned!</span>
<% end %> <% end %>
<% if !@user.confirmed? %> <% if !@user.confirmed? %>
<% if @user.is?(current_user) %> <% if @user.is?(current_user) %>
<span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span> <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" %> <%= image_tag @user.avatar_url(128), :class => "user-avatar avatar", :alt => "avatar" %>
<%= render partial: "users/username", locals: {user: @user} %>
<table> <table>
<tbody> <tbody>
<tr> <tr>
@@ -63,13 +65,11 @@
<td>Joined</td> <td>Joined</td>
<td><%= @user.created_at.strftime("%e. %b %Y, %H:%m") %></td> <td><%= @user.created_at.strftime("%e. %b %Y, %H:%m") %></td>
</tr> </tr>
<% if mod? || current_user == @user %> <% if mod? || @user.is?(current_user) %>
<% if mod? %> <tr>
<tr> <td>Last IP</td>
<td>Last IP</td> <td><%= @user.last_ip %></td>
<td><%= @user.last_ip %></td> </tr>
</tr>
<% end %>
<tr> <tr>
<td>Email</td> <td>Email</td>
<td><%= mail_to @user.email, @user.email, :subject => "Redstoner" %></td> <td><%= mail_to @user.email, @user.email, :subject => "Redstoner" %></td>
@@ -81,6 +81,6 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<hr> About:<br>
<%= @user.about.blank? ? "<span class=\"no-about\">nothing</span>".html_safe : @user.about %> <%= @user.about.blank? ? "<span class=\"no-about\">nothing</span>".html_safe : @user.about %>
</div> </div>
+1
View File
@@ -60,6 +60,7 @@ ActiveRecord::Schema.define(:version => 10) do
create_table "register_tokens", :primary_key => "uuid", :force => true do |t| create_table "register_tokens", :primary_key => "uuid", :force => true do |t|
t.string "token", :limit => 6, :null => false t.string "token", :limit => 6, :null => false
t.string "email", :null => false
end end
create_table "roles", :force => true do |t| create_table "roles", :force => true do |t|