From 7dbc55a10dfc7b6e1bd16a39a35c9e2310c16e67 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 4 Jul 2011 20:58:18 +0530 Subject: [PATCH] cleaned html of item form --- edgware/static/js/files/browse.js | 39 ++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/edgware/static/js/files/browse.js b/edgware/static/js/files/browse.js index eb5c22d..658fe26 100644 --- a/edgware/static/js/files/browse.js +++ b/edgware/static/js/files/browse.js @@ -164,15 +164,17 @@ function getJQ(f) { function getItemForm(f) { var $form = $('
').addClass("itemForm"); - var $labelsP = $('

').appendTo($form); - var $titleLabel = $('').addClass("itemFormLabel").addClass("titleLabel").text("Title").appendTo($labelsP); - var $descriptionLabel = $('').addClass("itemFormLabel").addClass("descriptionLabel").text("Description").appendTo($labelsP); - var $inputsP = $('

').appendTo($form); - var $titleInput = $('').addClass("itemTitle").val(f.title).appendTo($inputsP); + var $leftCol = $('

').addClass("leftCol").appendTo($form); + var $title = $('

').addClass("editTitle").appendTo($leftCol); + var $titleLabel = $('').addClass("itemFormLabel").addClass("titleLabel").text("Title").appendTo($title); + var $titleInput = $('').addClass("itemTitle").val(f.title).appendTo($title); + + if (f.can_edit) { - var $privateLabel = $('').addClass("pvtLabel").text("Private ").appendTo($inputsP); - var $pvtCheckbox = $('').attr("type", "checkbox").attr("checked", f.is_private).appendTo($inputsP); + var $pvt = $('

').addClass("editPrivate").appendTo($leftCol); + var $privateLabel = $('').addClass("pvtLabel").text("Private ").appendTo($pvt); + var $pvtCheckbox = $('').attr("type", "checkbox").attr("checked", f.is_private).appendTo($pvt); $pvtCheckbox.change(function() { var checked = $(this).is(":checked"); if (checked) { @@ -194,10 +196,12 @@ function getItemForm(f) { }, "json"); }); } - - var $descriptionInput = $('