| | 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 |
| | 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 |
| | 5 | ## License Version 1.1, but Sections 14 and 15 have been added to cover use of |
| | 6 | ## software over a computer network and provide for limited attribution for the |
| | 7 | ## Original Developer. In addition, Exhibit A has been modified to be consistent |
| | 8 | ## with Exhibit B. |
| | 9 | ## |
| | 10 | ## Software distributed under the License is distributed on an "AS IS" basis, |
| | 11 | ## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for |
| | 12 | ## the specific language governing rights and limitations under the License. |
| | 13 | ## |
| | 14 | ## The Original Code is Reddit. |
| | 15 | ## |
| | 16 | ## The Original Developer is the Initial Developer. The Initial Developer of |
| | 17 | ## the Original Code is CondeNet, Inc. |
| | 18 | ## |
| | 19 | ## All portions of the code written by CondeNet are Copyright (c) 2006-2008 |
| | 20 | ## CondeNet, Inc. All Rights Reserved. |
| | 21 | ################################################################################ |
| | 22 | <%! |
| | 23 | from r2.lib.filters import keep_space |
| | 24 | from r2.lib.template_helpers import add_sr |
| | 25 | |
| | 26 | %> |
| | 27 | <%namespace file="utils.html" import="error_field, language_tool"/> |
| | 28 | |
| | 29 | <div class="stylesheet-customize-container"> |
| | 30 | |
| | 31 | <form |
| | 32 | onsubmit="return stylesheetSave(this, 'subreddit_stylesheet')" |
| | 33 | name="subreddit_stylesheet" id="subreddit_stylesheet" |
| | 34 | class="pretty-form sr-form" |
| | 35 | action="/post/subreddit_stylesheet" method="post" > |
| | 36 | |
| | 37 | <input type="hidden" name="r" value="${thing.site.name}" /> |
| | 38 | <input type="hidden" name="op" value="save" /> |
| | 39 | |
| | 40 | <h2>${_("stylesheet")}</h2> |
| | 41 | <div class="sheets"> |
| | 42 | <div style="width: 100%" class="col"> |
| | 43 | <div> |
| | 44 | <textarea |
| | 45 | rows="20" |
| | 46 | cols="20" |
| | 47 | id="stylesheet_contents" |
| | 48 | name="stylesheet_contents" |
| | 49 | > |
| | 50 | ${keep_space(thing.stylesheet_contents) or ''} |
| | 51 | </textarea> |
| | 52 | </div> |
| | 53 | </div> |
| | 54 | <div style="display:none" class="col"> |
| | 55 | <div> |
| | 56 | <textarea |
| | 57 | rows="20" |
| | 58 | cols="20" |
| | 59 | id="default_stylesheet" |
| | 60 | name="default_stylesheet" |
| | 61 | readonly="readonly" |
| | 62 | > |
| | 63 | ${keep_space(g.default_stylesheet)} |
| | 64 | </textarea> |
| | 65 | </div> |
| | 66 | </div> |
| | 67 | <div class="clearleft"></div> |
| | 68 | <div class="buttons"> |
| | 69 | <button class="btn right " id="show_default_stylesheet" |
| | 70 | value="some_button" |
| | 71 | onclick="return showDefaultStylesheet();"> |
| | 72 | ${_('show the default stylesheet')} |
| | 73 | </button> |
| | 74 | <button class="btn right" id="hide_default_stylesheet" |
| | 75 | value="some_button" |
| | 76 | style="display: none;" |
| | 77 | onclick="return hideDefaultStylesheet();"> |
| | 78 | ${_('hide the default stylesheet')} |
| | 79 | </button> |
| | 80 | <button class="btn" name="save" type="submit">${_("save")}</button> |
| | 81 | <button class="btn" name="preview" type="button" |
| | 82 | onclick="stylesheetPreview('subreddit_stylesheet','stylesheet_contents');">${_("preview")}</button> |
| | 83 | |
| | 84 | <span id="status" class="error"></span> |
| | 85 | </div> |
| | 86 | </div> |
| | 87 | <div class="errors"> |
| | 88 | <h2 id="error-header" style="display:none">${_("errors")}</h2> |
| | 89 | <ul id="validation-errors"><li style="display:none"></li> |
| | 90 | <!-- populated from AJAX requests to /api/subreddit_stylesheet --> |
| | 91 | </ul> |
| | 92 | </div> |
| | 93 | <div class="clear"></div> |
| | 94 | |
| | 95 | </form> |
| | 96 | |
| | 97 | <div id="preview-table" style="display:none"> |
| | 98 | <h2><a name="preview">${_("preview")}</a></h2> |
| | 99 | <table> |
| | 100 | <tr> |
| | 101 | <th>${_("normal link")}</th> |
| | 102 | <td id="preview_link_normal"></td> |
| | 103 | </tr> |
| | 104 | <tr> |
| | 105 | <th>${_("compressed link")}</th> |
| | 106 | <td id="preview_link_compressed"></td> |
| | 107 | </tr> |
| | 108 | <tr> |
| | 109 | <th>${_("link with thumbnail")}</th> |
| | 110 | <td id="preview_link_media"></td> |
| | 111 | </tr> |
| | 112 | <tr> |
| | 113 | <th>${_("comment")}</th> |
| | 114 | <td id="preview_comment"></td> |
| | 115 | </tr> |
| | 116 | </table> |
| | 117 | </div> |
| | 118 | </div> |
| | 119 | |