[Directory] don't fail on missing random podcast
[mygpo.git] / mygpo / web / templates / dashboard.html
blob66a4fc9d3ce99fc12dc769790e0be3eef7e73320
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load devices %}
4 {% load episodes %}
5 {% load podcasts %}
6 {% load humanize %}
7 {% load cache %}
8 {% load utils %}
10 {% load menu %}
11 {% block mainmenu %}{{ "/"|main_menu }}{% endblock %}
12 {% block sectionmenu %}{{ "/"|section_menu }}{% endblock %}
14 {% block title %}{% trans "Overview" %}{% endblock %}
16 {% block header %}
17 <h1>{% trans "Hi, " %}{{ user.username }}</h1>
18 {% endblock %}
21 {% block content %}
22 {% cache 600 newest_episodes user.username %}
23 {% if newest_episodes %}
24 <h2>{% trans "Newest Episodes" %}</h2>
25 <table class="list">
26 {% for episode in newest_episodes %}
27 <tr>
28 <td class="logo">{{ episode.podcast|podcast_logo }}</td>
29 <td>
30 {% episode_link episode episode.podcast %}<br/>
31 <span class="from_podcast">{% podcast_group_link episode.podcast %}</span>
32 </td>
33 <td>{{ episode.released|naturalday|nbsp }}</td>
34 </tr>
35 {% endfor %}
36 </table>
37 {% else %}
38 <p>
39 {% blocktrans %}Welcome to {{ site }}! If this is your first visit, you should set up your <a href="http://wiki.gpodder.org/wiki/Web_Services/Clients">podcast client</a> and try to check as many <em>Explore</em> boxes as you can.{% endblocktrans %}
40 </p>
42 <p>
43 {% url "help" as help %}
44 {% blocktrans %}If you have problems, have a look at the <a href="{{ help }}">docs</a> or ask questions on the <a href="http://wiki.gpodder.org/wiki/Mailing_List">mailing list</a> or <a href="https://getsatisfaction.com/gpoddernet">forum</a>.{% endblocktrans %}
45 </p>
47 {% endif %}
48 {% endcache %}
49 {% endblock %}
51 {% block sidebar %}
52 {% if sponsored_podcast %}
53 <div class="well">
54 <h4>{{ sponsored_podcast.title }} <small>(Supporting Podcast)</small></h4>
55 <div>{{ sponsored_podcast.podcast|podcast_logo }}</div>
56 <div style="margin-left: 40px">{{ sponsored_podcast.text|truncatewords:"20"}}</div>
57 <br style="clear: left;"/>
58 <small><a href="{% url "advertise" %}">advertise here</a></small>
59 </div>
60 {% endif %}
62 {% if random_podcast %}
63 {% cache 3600 random_podcast_box %}
64 <div class="well">
66 <h4><small>{% trans "Random" %}</small></h4>
69 <a href="{% podcast_link_target random_podcast %}">
70 <div id="podcastlogo">{{ random_podcast|podcast_logo_medium }}</div>
71 </a>
73 <h4>{{ random_podcast.title }}</h4>
75 <p class="description">
76 {{ random_podcast.description|default:""|truncatewords:"50" }}
77 </p>
79 <p>
80 <a href="{% podcast_link_target random_podcast %}">{% trans "more..." %}</a>
81 </p>
83 </div>
84 {% endcache %}
85 {% endif %}
87 <div class="well">
88 <h4>{% blocktrans %}Explore {{ site }}{% endblocktrans %}</h4>
89 <ul class="icons">
90 <li><i class="icon-check"></i>
91 <a href="{% url "home" %}">
92 {% blocktrans %}Sign up to {{ site }}{% endblocktrans %}
93 </a>
94 </li>
95 <li><i class="icon-check{% if not "devices" in checklist %}-empty{% endif %}"></i>
96 <a href="{% url "devices" %}">
97 {% trans "Connect your Podcast Clients" %}
98 </a>
99 </li>
100 <li><i class="icon-check{% if not "subscriptions" in checklist %}-empty{% endif %}"></i>
101 <a href="{% url "subscriptions" %}">
102 {% trans "Subscribe to Podcasts" %}
103 </a>
104 </li>
105 <li><i class="icon-check{% if not "favorites" in checklist %}-empty{% endif %}"></i>
106 <a href="{% url "favorites" %}">
107 {% trans "Mark your Favorite Episodes" %}
108 </a>
109 </li>
110 <li><i class="icon-check{% if not "share" in checklist %}-empty{% endif %}"></i>
111 <a href="{% url "share" %}">
112 {% trans "Share your Subscriptions" %}
113 </a>
114 </li>
115 <li><i class="icon-check{% if not "share-favorites" in checklist %}-empty{% endif %}"></i>
116 <a href="{% url "share" %}">
117 {% trans "Share your Favorite Episodes" %}
118 </a>
119 </li>
120 <li><i class="icon-check{% if not "userpage" in checklist %}-empty{% endif %}"></i>
121 <a href="{% url "share" %}">
122 {% trans "Share your Userpage" %}
123 </a>
124 </li>
125 <li><i class="icon-check{% if not "tags" in checklist %}-empty{% endif %}"></i>
126 <a href="{% url "tags" %}">
127 {% trans "Tag Podcasts" %}
128 </a>
129 </li>
130 <li><i class="icon-check{% if not "lists" in checklist %}-empty{% endif %}"></i>
131 <a href="{% url "lists-overview" %}">
132 {% trans "Create Podcast Lists" %}
133 </a>
134 </li>
135 <li><i class="icon-check{% if not "flattr" in checklist %}-empty{% endif %}"></i>
136 <a href="{% url "account" %}#flattr">
137 {% trans "Connect to Flattr" %}
138 </a>
139 </li>
140 <li><i class="icon-check{% if not "auto-flattr" in checklist %}-empty{% endif %}"></i>
141 <a href="{% url "account" %}#flattr">
142 {% trans "Auto-Flattr Podcasts" %}
143 </a>
144 </li>
145 <li><i class="icon-check{% if not "publish" in checklist %}-empty{% endif %}"></i>
146 <a href="{% url "publisher" %}">
147 {% trans "Publish your own Podcast" %}
148 </a>
149 </li>
150 </ul>
151 </p>
153 </div>
155 {% if show_install_reader %}
156 <div class="well">
157 <h4>{% trans "Subscribe in Your Browser" %}</h4>
159 {% blocktrans %}Register {{ site.domain }} as a feed reader, and subscribe to podcasts directly from your browser{% endblocktrans %}
160 </p>
161 <a class="btn btn-primary" href="#" onclick="registerHandler();">
162 {% trans "Install" %}
163 </a>
165 </div>
166 {% endif %}
168 {% endblock %}
171 {% block javascript %}
172 <script type="text/javascript">
173 function registerHandler()
175 navigator.registerContentHandler("application/vnd.mozilla.maybe.feed",
176 document.location.protocol + "//{{ site.domain }}/subscribe?url=%s",
177 "{{ site.domain }}");
179 </script>
180 {% endblock %}