add themes (light.css [empty], dark.css, neo_dark.css, solarized_dark.css); add theme as settings field

This commit is contained in:
Simon Vieille 2020-01-29 13:35:57 +01:00
부모 dad5a4ddcc
커밋 b83ce52312
로그인 계정: deblan
GPG 키 ID: 03383D15A1D31745
10개의 변경된 파일329개의 추가작업 그리고 2개의 파일을 삭제

파일 보기

@ -0,0 +1,23 @@
ol.stories.list li.story div.details span.link a:link {
color: #6898ff;
}
ol.stories.list li.story div.details span.link a:visited {
color: #2858bf;
}
a {
color: #6898ff;
}
a.tag {
background-color: #000;
border: 1px solid #ccc;
color: #ccc;
}
body {
background: #000;
color: #ccc;
}

파일 보기

@ -0,0 +1,148 @@
body {
background-color: #222;
color: #ddd;
}
a {
color: #ccf;
}
#wrapper textarea, #wrapper input, #wrapper button {
color: #ddd;
background-color: #000;
border-color: #444;
}
#header .headerlinks a.cur_url {
color: #fff;
}
#header #headertitle a {
color: #fff;
}
#header .headerlinks a {
color: #ccc;
}
#inside li .link a {
color: #ddf;
}
#inside li .byline {
color: #bbb;
}
#inside li .byline a {
color: #bbb;
}
#inside li .domain {
color: #bbb;
}
#inside .comment a {
color: #ccf;
}
#wrapper div.morelink a {
color: #ccc;
}
#wrapper div#footer a {
color: #ccc;
}
.comment:target {
background-color: #444;
}
/* tag badges */
#inside a.tag {
background-color: #000;
border-color: #444;
color: #aaa;
}
#inside a.tag.tag_is_media {
background-color: #622;
border-color: #944;
}
#inside a.tag.tag_announce, #inside a.tag.tag_ask, #inside a.tag.tag_show, #inside a.tag.tag_interview {
background-color: #226;
border-color: #449;
}
/* hats */
#inside span.hat span.crown {
background-color: #000;
border-color: #444;
}
#inside span.hat {
border-color: #444;
}
#inside span.hat span.crown, #inside span.hat a {
color: #aaa;
}
/* tag dropdown */
#inside .select2-container-multi .select2-choices {
background-color: #000;
border-color: #444;
}
#inside .select2-container .select2-drop {
background-color: #000;
border-color: #444;
}
/* search pager */
#inside div.page_link_buttons a {
color: #bbb;
background-color: #000;
border-color: #444;
}
#inside div.page_link_buttons a.cur, #inside div.page_link_buttons span {
color: #bbb;
background-color: #222;
border-color: #222;
}
/* history/filter table */
#inside table.data th {
background-color: #000;
border-color: #444;
}
#inside table.data tr.row0 td, table.data.zebra tr:nth-child(2n) td {
background-color: #222;
border-color: #444;
}
#inside table.data tr.row1 td, table.data.zebra tr:nth-child(2n+1) td {
background-color: #000;
border-color: #444;
}
/* mobile/responsive fixes */
ol.stories.list li.story div.story_liner {
background-color: inherit;
}
div#header, div#leader {
background-color: inherit;
border-bottom: 1px solid #444;
}
ol.stories.list li.story .mobile_comments {
background-color: #444;
}
ol.stories.list li.story {
border-bottom: 1px solid #444;
}

파일 보기

@ -0,0 +1,137 @@
body {
background-color: #073642;
color: #93a1a1;
}
a {
color: #b58900;
}
#wrapper textarea, #wrapper input, #wrapper button {
color: #93a1a1;
background-color: #002b36;
border-color: #073642;
}
#header .headerlinks a.cur_url {
color: #2aa198;
}
#header #headertitle a {
color: #2aa198;
}
#header .headerlinks a {
color: #839496;
}
#inside li .link a {
color: #b58900;
}
#inside li .byline {
color: #839496;
}
#inside li .byline a {
color: #839496;
}
#inside li .domain {
color: #839496;
}
#inside .comment a {
color: #b58900;
}
#wrapper div.morelink a {
color: #839496;
}
#wrapper div#footer a {
color: #839496;
}
/* header logo */
#wrapper #header #headerleft #l_holder {
background-color: #dc322f !important;
}
/* buttons */
div.voters .upvoter:hover, .upvoted div.voters .upvoter {
border-bottom-color: #dc322f;
}
/* tag badges */
#inside a.tag {
background-color: #002b36;
border-color: #073642;
color: #aaa;
}
#inside a.tag.tag_is_media {
background-color: #622;
border-color: #944;
}
#inside a.tag.tag_announce, #inside a.tag.tag_ask, #inside a.tag.tag_show, #inside a.tag.tag_interview {
background-color: #226;
border-color: #449;
}
/* hats */
#inside span.hat span.crown {
background-color: #002b36;
border-color: #073642;
}
#inside span.hat {
border-color: #073642;
}
#inside span.hat span.crown, #inside span.hat a {
color: #aaa;
}
/* tag dropdown */
#inside .select2-container-multi .select2-choices {
background-color: #002b36;
border-color: #073642;
}
#inside .select2-container .select2-drop {
background-color: #002b36;
border-color: #073642;
}
/* search pager */
#inside div.page_link_buttons a {
color: #839496;
background-color: #002b36;
border-color: #073642;
}
#inside div.page_link_buttons a.cur, #inside div.page_link_buttons span {
color: #839496;
background-color: #073642;
border-color: #073642;
}
/* history/filter table */
#inside table.data th {
background-color: #002b36;
border-color: #073642;
}
#inside table.data tr.row0 td, table.data.zebra tr:nth-child(2n) td {
background-color: #073642;
border-color: #073642;
}
#inside table.data tr.row1 td, table.data.zebra tr:nth-child(2n+1) td {
background-color: #002b36;
border-color: #073642;
}

파일 보기

@ -246,7 +246,7 @@ private
:email_replies, :email_messages, :email_mentions,
:pushover_replies, :pushover_messages, :pushover_mentions,
:mailing_list_mode, :show_avatars, :show_story_previews,
:show_submitted_story_threads, :hide_dragons
:show_submitted_story_threads, :hide_dragons, :theme
)
end
end

파일 보기

@ -51,11 +51,14 @@ class User < ActiveRecord::Base
s.string :twitter_oauth_token
s.string :twitter_oauth_token_secret
s.string :twitter_username
s.string :theme, :default => "light"
end
validates :email, :format => { :with => /\A[^@ ]+@[^@ ]+\.[^@ ]+\Z/ },
:uniqueness => { :case_sensitive => false }
validates :theme, inclusion: { in: ["light", "dark", "neo_dark", "solarized_dark"] }
validates :password, :presence => true, :on => :create
VALID_USERNAME = /[A-Za-z0-9][A-Za-z0-9_-]{0,24}/

파일 보기

@ -25,6 +25,8 @@
Rails.application.name %></title>
<%= stylesheet_link_tag "application", :media => "all" %>
<% if @user %>
<%= stylesheet_link_tag "themes/" + @user.theme, :media => "all" %>
<%= javascript_include_tag "application" %>
<script>
Lobsters.curUser = '<%= @user.id %>';

파일 보기

@ -209,6 +209,16 @@
<%= f.check_box :hide_dragons %>
</div>
<div class="boxline">
<%= f.label :theme, t('.theme'), :class => "required" %>
<%= f.select :theme, [
["Light", "light"],
["Dark", "dark"],
["Neo Dark", "neo_dark"],
["Solarized Dark", "solarized_dark"]
]%>
</div
<br>
<%= f.submit t('.saveallsettings') %>
<% end %>

파일 보기

@ -5,4 +5,7 @@ Rails.application.config.assets.version = '1.0'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w( themes/light.css )
Rails.application.config.assets.precompile += %w( themes/dark.css )
Rails.application.config.assets.precompile += %w( themes/neo_dark.css )
Rails.application.config.assets.precompile += %w( themes/solarized_dark.css )

파일 보기

@ -364,6 +364,7 @@ fr:
storypreview: "Montrer les aperçus des infos: "
useravatars: "Montrer les avatars des utilisateurs :"
hidedragons: "Cacher les dragons :"
theme: "Thème :"
saveallsettings: "Sauver tous les paramètres"
inviteuser: "Inviter un nouvel utilisateur"
cannotsendinvitations: "Vous ne pouvez pas envoyer d'invitations."