use new style {% url "view" %} template syntax
[mygpo.git] / mygpo / share / templates / share / favorites.html
blobe483eede5ed445c2946c77962968bfd3b0e237cb
1 {% extends "base.html" %}
2 {% load url from future %}
3 {% load i18n %}
4 {% load podcasts %}
5 {% load episodes %}
7 {% load menu %}
8 {% block mainmenu %}{{ "/share/"|main_menu }}{% endblock %}
9 {% block sectionmenu %}{{ "/share/favorites"|section_menu }}{% endblock %}
11 {% block title %}{% trans "Share your favorite episodes" %}{% endblock %}
13 {% block header %}
14 <h1>
15 {% trans "Share your favorite episodes" %}
16 </h1>
17 {% endblock %}
20 {% block content %}
22 <table>
24 <tr>
25 <td>
26 <i class="icon-rss icon-large"></i>
27 </td>
28 <td>
29 <a href="{% url "favorites-feed" user.username %}">
30 {% trans "Feed" %}
31 </a>
32 </td>
33 <td>
34 <input class="input-xxlarge" readonly="readonly" type="text" value="http://{% if feed_token %}{{ user.username }}:{{feed_token}}@{% endif %}{{ site.domain }}{% url "favorites-feed" user.username %}" />
35 </td>
36 </tr>
38 {% if not feed_token %}
40 <tr>
41 <td>
42 <i class="icon-link icon-large"></i>
43 </td>
45 <td>
46 {% if podcast %}
47 <a href="{% podcast_link_target podcast %}">{% trans "Directory Entry" %}</a>
48 {% else %}
49 {% trans "Directory Entry" %}
50 {% endif %}
51 </td>
52 <td>
53 {% if podcast %}
54 <input class="input-xxlarge" readonly="readonly" type="text" value="http://{{ site.domain }}{% podcast_link_target podcast %}" />
55 {% else %}
56 <form action="{% url "favorites-create-entry" %}" method="post">
57 {% csrf_token %}
58 <button class="btn" type="submit">{% trans "Create" %}</button>
59 </form>
60 {% endif %}
61 </td>
62 </tr>
64 {% endif %}
66 </table>
68 <h2>Permissions</h2>
69 {% if feed_token %}
70 <p>
71 {% blocktrans %}To keep your favorites private (from others and from the public pages of {{ site }}), you need to use HTTP-Authentication in your client. {% endblocktrans %}
72 <ul>
73 <li>{% trans "Username:" %} {{ user.username }}</li>
74 <li>{% trans "Password:" %} {{ feed_token }}</li>
75 </ul>
76 </p>
78 <div class="btn-group">
79 <button type="submit" class="btn" onclick="submitForm('public');">
80 <i class="icon-eye-open"></i> {% trans "Remove password" %}
81 </button>
82 <button type="submit" class="btn" onclick="submitForm('private');">
83 <i class="icon-eye-close"></i> {% trans "Generate new password" %}
84 </button>
85 </div>
88 <form id="private" class="form-inline" method="post" action="{% url "favorites_private" %}">
89 {% csrf_token %}
90 </form>
92 <form id="public" class="form-inline" method="post" action="{% url "favorites_public" %}">
93 {% csrf_token %}
94 </form>
97 {% else %}
98 <p>
99 {% blocktrans with site as sitename %}You've marked your favorites-feed as public and others can
100 subscribe to it. It will also be indexed by {{ sitename }}.{% endblocktrans %}
101 </p>
102 {% if podcast %}
103 <ul>
104 <li><a href="{% podcast_link_target podcast %}">public information about your favorites-feed</a></li>
105 </ul>
106 {% endif %}
108 <form class="form-inline" method="post" action="{% url "favorites_private" %}">
109 {% csrf_token %}
110 <button type="submit" class="btn">
111 <i class="icon-eye-close"></i> {% trans "Create password" %}
112 </button>
113 </form>
115 </ul>
116 {% endif %}
118 {% endblock %}
121 {% block javascript %}
123 <script language="javascript">
124 <!--
125 function submitForm(formid)
127 document.forms[formid].submit();
128 return true;
131 </script>
133 {% endblock %}