1a107601fa490ca69215facceebe3d0dc5e7f1f8 | 6bcef0037bdb2d139a15065c3f31e872bae79df3 | ||
---|---|---|---|
1 | ## "The contents of this file are subject to the Common Public Attribution | 1 | ## The contents of this file are subject to the Common Public Attribution |
2 | ## License Version 1.0. (the "License"); you may not use this file except in | 2 | ## License Version 1.0. (the "License"); you may not use this file except in |
3 | ## compliance with the License. You may obtain a copy of the License at | 3 | ## compliance with the License. You may obtain a copy of the License at |
4 | ## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public | 4 | ## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public |
... | ... | ||
17 | ## the Original Code is CondeNet, Inc. | 17 | ## the Original Code is CondeNet, Inc. |
18 | ## | 18 | ## |
19 | ## All portions of the code written by CondeNet are Copyright (c) 2006-2008 | 19 | ## All portions of the code written by CondeNet are Copyright (c) 2006-2008 |
20 | ## CondeNet, Inc. All Rights Reserved." | 20 | ## CondeNet, Inc. All Rights Reserved. |
21 | ################################################################################ | 21 | ################################################################################ |
22 | 22 | ||
23 | <%! | 23 | <%! |
24 | from r2.lib.filters import keep_space | 24 | from r2.lib.filters import keep_space |
25 | %> | 25 | %> |
26 | <%namespace file="utils.html" import="error_field, language_tool"/> | 26 | <%namespace file="utils.html" import="error_field, language_tool, plain_link"/> |
27 | 27 | ||
28 | <script type="text/javascript"> | 28 | <script type="text/javascript"> |
29 | function update_title() { | 29 | function update_title() { |
... | ... | ||
113 | %endif | 113 | %endif |
114 | </td> | 114 | </td> |
115 | </tr> | 115 | </tr> |
116 | |||
116 | <tr> | 117 | <tr> |
117 | <th> | 118 | <th> |
118 | <label for="description">${_("description")}</label> | 119 | <label for="description">${_("description")}</label> |
... | ... | ||
129 | ${error_field("DESC_TOO_LONG", "span")} | 130 | ${error_field("DESC_TOO_LONG", "span")} |
130 | </td> | 131 | </td> |
131 | </tr> | 132 | </tr> |
133 | |||
132 | %if c.user_is_admin: | 134 | %if c.user_is_admin: |
133 | <tr> | 135 | <tr> |
134 | <th> | 136 | <th> |
... | ... | ||
248 | </label> | 250 | </label> |
249 | </td> | 251 | </td> |
250 | </tr> | 252 | </tr> |
251 | 253 | <tr> | |
254 | <th> | ||
255 | <label for="domain">${_("domain")}</label> | ||
256 | </th> | ||
257 | <td> | ||
258 | %if thing.site: | ||
259 | <input id="domain" type="text" name="domain" class="text" | ||
260 | value="${getattr(thing.site, 'domain', None) or ""}"/> | ||
261 | %else: | ||
262 | <input id="domain" type="text" name="domain" class="text" /> | ||
263 | %endif | ||
264 | </td> | ||
265 | <td id="note_domain"> | ||
266 | ${error_field("BAD_CNAME", "span")} | ||
267 | ${error_field("USED_CNAME", "span")} | ||
268 | %if not thing.site: | ||
269 | <span class="gray" id="example_domain"> | ||
270 | ${_("e.g. reddit.slashdot.org (optional)")} | ||
271 | </span> | ||
272 | %endif | ||
273 | </td> | ||
274 | </tr> | ||
252 | <tr> | 275 | <tr> |
253 | <th> | 276 | <th> |
254 | </th> | 277 | </th> |
255 | <td colspan="2"> | 278 | <td colspan="2"> |
256 | %if thing.site: | 279 | %if thing.site: |
257 | <button name="edit" type="submit">${_("update")}</button> | 280 | <button name="edit" class="btn" type="submit">${_("update")}</button> |
258 | %else: | 281 | %else: |
259 | <button name="create" type="submit">${_("create")}</button> | 282 | <button name="create" class="btn" type="submit">${_("create")}</button> |
260 | %endif | 283 | %endif |
261 |   | 284 |   |
262 | <span id="status" class="error"></span> | 285 | <span id="status" class="error"></span> |
... | ... | ||
266 | </tr> | 289 | </tr> |
267 | </table> | 290 | </table> |
268 | </form> | 291 | </form> |
292 | |||
293 | %if thing.site and thing.site.can_change_stylesheet(c.user) and not g.css_killswitch: | ||
294 | <h1>${_('change the look')}</h1> | ||
295 | |||
296 | <table class="content preftable pretty-form sr-form"> | ||
297 | <tr> | ||
298 | <th> | ||
299 | <label for="stylesheet_contents">${_("edit stylesheet")}</label> | ||
300 | </th> | ||
301 | <td class="nowrap nopadding"> | ||
302 | <p>${plain_link(_('edit the stylesheet'), | ||
303 | '/about/stylesheet', | ||
304 | sr_path = True)}</p> | ||
305 | </td> | ||
306 | <td id="note_stylesheet_contents"></td> | ||
307 | </tr> | ||
308 | |||
309 | <tr> | ||
310 | <th><label for="file">${_('upload header image')}</label></th> | ||
311 | <td> | ||
312 | <form | ||
313 | onsubmit="return uploadHeaderImage('${_('submitting')}');" | ||
314 | name="upload-header-image" id="upload-header-image" | ||
315 | enctype="multipart/form-data" | ||
316 | class="pretty-form sr-form" | ||
317 | target="upload-header-iframe" | ||
318 | action="/api/upload_header_img" method="post"> | ||
319 | <input type="file" name="file" | ||
320 | onchange="return uploadHeaderImage('${_('submitting')}')" /> | ||
321 | <button id="delete-header-img" | ||
322 | class="btn" | ||
323 | onclick="return deleteHeaderImage('${_('submitting')}')" | ||
324 | %if not thing.site.header: | ||
325 | style="display: none;" | ||
326 | %endif | ||
327 | > | ||
328 | ${_('restore default')} | ||
329 | </button> | ||
330 | <input type="hidden" name="uh" value="${c.modhash}" /> | ||
331 | <input type="hidden" name="r" value="${c.site.name}" /> | ||
332 | <input type="hidden" name="op" value="upload" /> | ||
333 | |||
334 | <span style="display: none;" class="error" id="img-status"></span> | ||
335 | <iframe src="about:blank" | ||
336 | width="600" height="200" style="display: none;" | ||
337 | name="upload-header-iframe" id="upload-header-iframe"></iframe> | ||
338 | </form> | ||
339 | <div id="header-img-preview-container" style="display: none;"> | ||
340 | <img id="header-img-preview" | ||
341 | %if thing.site.header: | ||
342 | src="${thing.site.header}" | ||
343 | %else: | ||
344 | src="/static/kill.png" | ||
345 | %endif | ||
346 | / ><br /> | ||
347 | </div> | ||
348 | </td> | ||
349 | </tr> | ||
350 | </table> | ||
351 | %endif | ||
352 |