소스 검색

Set the POTD as the default background.

pull/24/head
Ben Kurtovic 10 년 전
부모
커밋
41c0df6cb9
2개의 변경된 파일6개의 추가작업 그리고 7개의 파일을 삭제
  1. +4
    -4
      pages/settings.mako
  2. +2
    -3
      pages/support/header.mako

+ 4
- 4
pages/settings.mako 파일 보기

@@ -41,11 +41,11 @@
</tr>
<%
background_options = [
("plain", "Use a plain tiled background (default)."),
("potd", 'Use the current <a href="//commons.wikimedia.org/">Wikimedia Commons</a> <a href="//commons.wikimedia.org/wiki/Commons:Picture_of_the_day">Picture of the Day</a>, unfiltered. Certain POTDs may be unsuitable as backgrounds due to their aspect ratio or subject matter (generally portraits do not work well).'),
("list", 'Randomly select from <a href="http://commons.wikimedia.org/wiki/User:The_Earwig/POTD">a subset of previous Commons Pictures of the Day</a> that work well as widescreen backgrounds, refreshed daily.'),
("list", 'Randomly select from <a href="http://commons.wikimedia.org/wiki/User:The_Earwig/POTD">a subset</a> of previous <a href="//commons.wikimedia.org/">Wikimedia Commons</a> <a href="//commons.wikimedia.org/wiki/Commons:Picture_of_the_day">Pictures of the Day</a> that work well as widescreen backgrounds, refreshed daily (default).'),
("potd", 'Use the current Commons Picture of the Day, unfiltered. Certain POTDs may be unsuitable as backgrounds due to their aspect ratio or subject matter.'),
("plain", "Use a plain background."),
]
selected = cookies["CopyviosBackground"].value if "CopyviosBackground" in cookies else "plain"
selected = cookies["CopyviosBackground"].value if "CopyviosBackground" in cookies else "list"
%>\
% for i, (value, desc) in enumerate(background_options):
<tr>


+ 2
- 3
pages/support/header.mako 파일 보기

@@ -14,12 +14,11 @@
<link rel="stylesheet" href="${root}/static/style.css" type="text/css" />
<script src="${root}/static/script.js" type="text/javascript"></script>
</head>
<% selected = cookies["CopyviosBackground"].value if "CopyviosBackground" in cookies else "plain" %>\
<% selected = cookies["CopyviosBackground"].value if "CopyviosBackground" in cookies else "list" %>\
% if selected == "plain":
<body style="background-image: url('${root}/static/background.png');">
% else:
<% bg_url = set_background(cookies, selected) %>\
<body onload="update_screen_size()" style="background-image: url('${bg_url | h}'); background-size: cover;">
<body onload="update_screen_size()" style="background-image: url('${set_background(cookies, selected) | h}'); background-size: cover;">
% endif
<div id="header">
<p id="heading"><a class="dark" href="${root}">Earwig's Copyvio Detector</a></p>


불러오는 중...
취소
저장