<input type="hidden" name="status" />
</form>
+<select name="other-user" style="display:none;">
+ {% for user in other_users %}
+ <option {% if request.GET.user == user.username %}selected="selected"
+ {% endif %}value="{{ user.username }}">{{ user.first_name }} {{ user.last_name }} ({{ user.count }})</option>
+ {% endfor %}
+</select>
+
new_context = {"viewed_user": user}
else:
filters = {}
- new_context = {"users": User.objects.annotate(
+ new_context = {
+ "users": User.objects.annotate(
count=Count('chunk')).filter(count__gt=0).order_by(
- '-count', 'last_name', 'first_name')}
+ '-count', 'last_name', 'first_name'),
+ "other_users": User.objects.annotate(
+ count=Count('chunk')).filter(count=0).order_by(
+ 'last_name', 'first_name'),
+ }
new_context.update({
"filters": True,
var field = kp[0];
var idx = parseInt(kp[1]);
- fds[field] = $("select[name="+field+"] option[value!=]").eq(idx).val();
+ var target_field = field;
+ if (field == 'other-user')
+ target_field = 'user';
+
+ fds[target_field] = $("select[name="+field+"] option[value!=]").eq(idx).val();
}
/* fill in the form */
$("#chunk_mass_edit [name=ids]").val(get_ids());
},
"user": {
name: "Set user",
- items: get_items("user"),
+ items: (function() {
+ var active_users = get_items("user");
+ active_users['other'] = {
+ name: "Other",
+ items: get_items("other-user"),
+ };
+ return active_users;
+ })(),
icon: "user",
},
"publish": {