{% extends "tcms_base.html" %}
{% load static %}

{% block subtitle %}Bookmarks - {{ user_profile.user.username }}{% endblock %}

{% block custom_stylesheet %}
<link rel="stylesheet" type="text/css" href="{% static "style/print.css" %}" media="print" />
<link rel="stylesheet" type="text/css" href="{% static "style/dataTables/jquery.dataTables.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "style/dataTables/jquery.dataTables_themeroller.css" %}" />
{% endblock %}

{% block custom_javascript %}
<script type="text/javascript" src="{% static "js/lib/jquery.dataTables.js" %}"></script>
<script type="text/javascript" src="{% static "js/profiles.js" %}"></script>
<script type="text/javascript">
Nitrate.Utils.after_page_load(Nitrate.Profiles.Bookmarks.on_load);
</script>
{% endblock %}

{% block contents %}
<div id="content">
	<div class="sprites crumble profile_tab">
		<ul>
			<li><a href="{% url "user-profile" user.username %}">Basic Information</a></li>
			{% ifequal user_profile.user user %}
			<li  class="profile_tab_active"><a href="{% url "user-bookmark" user.username %}">Bookmarks</a></li>
			<li><a href="{% url "user-recent" user.username %}">Recent</a></li>
			{% endifequal %}
		</ul>
	</div>
	<form id="id_form_bookmark" action="{% url "user-bookmark" user.username %}" method="post">
		<div class="table_watchlist_toolbar">
			<span>
				{# <a href="#" class="sprites node_add">Add</a> #}
				<input type="submit" value="Delete" class="sprites node_delete">
			</span>
		</div>
		<div>
			<input type="hidden" name="a" value="remove" />
			<table id="id_table_bookmark" cellpadding="0" cellspacing="0" class="table_watchlist" >
				<thead>
					<tr>
						<th width="30px" class="nosort">
							<input id="id_check_all_bookmark" class="js-select-all" type="checkbox" />
						</th>
						<th width="40px">Index</th>
						<th>Name</th>
						<th><div class="rightradius"></div>Description</th>
						{# <th width="80">Operation</th> #}
					</tr>
				</thead>
				<tbody>
					{% for bookmark in bookmarks %}
					<tr class="{% cycle 'odd' 'even' %}">
						<td><input type="checkbox" name="pk" value="{{ bookmark.pk }}" /></td>
						<td>{{ forloop.counter }}</td>
						<td><a href='{{ bookmark.url }}'>
						{%if bookmark.name%}{{ bookmark }}{%else%}{{bookmark.url}}{%endif%}</a></td>
						<td>{{ bookmark.description|linebreaksbr }}</td>
						{# <td><a href="#" class="sprites node_edit">Edit</a></td> #}
					</tr>
					{% endfor %}
				</tbody>
			</table>
		</div>
	</form>
		
</div>
{% endblock %}
