Permalink
Browse files

Added Task Views

You can now click and get a pop up box with the task descriptions but there still is not a way to edit those things.
  • Loading branch information...
1 parent ffe3ca8 commit 33baf2831978cd9a96f47b425cef2e2f62b6262f @kcalmes kcalmes committed Apr 5, 2012
@@ -32,6 +32,7 @@ def index
results[results.length-1]['tasks'] << {
'id' => task.id,
'name' => task.name,
+ 'description' => task.description
}
end
end
@@ -194,4 +194,16 @@ select, input {
}
.flat_area #myguide ul.chzn-results li:first-child {
padding-top: 7px;
+}
+
+.stg label:hover {
+ text-decoration: underline;
+ cursor: pointer;
+}
+
+.description_dialog{
+ display: none;
+}
+.edit_img{
+ width: 15px;
}
@@ -55,14 +55,17 @@ function setupGoals(){
html += '" stg_id="'+ this.id +'"><img src="' + unchecked_icon + '" />' + this.name + '<div class="edit"><img class="edit_img" src="http://humadvisement.byu.edu/sites/default/files/menu_icons/Pencil_64x64.png"></div><div class="tasks hidden"><ul>';
$.each(this.tasks,function(){
- html +='<li><input type="checkbox" name="task[name]" task_id="'+this.id+'" /><label>'+ this.name +'</label></li>';
+ html +='<li><input type="checkbox" name="task[name]" task_id="'+this.id+'" /><label>'+ this.name +'</label>';
+ html +='<div class="description_dialog" task_id="'+this.id+'">' + this.description + '</div>'
+ html +='</li>';
});
html += '</ul></div></div>';
$('#year'+this.school_year+'_col').append(html);
});
$(".year img.add").click(function(event){
window.location.href = "/short_term_goals/new";
});
+ $('.description_dialog').dialog({ autoOpen: false, show: "fade", hide: "fade", modal: true });
$(".stg").click(function(event){
var target = $(event.target);
if(target.is('li')){
@@ -77,7 +80,8 @@ function setupGoals(){
if(target.is(':checked')){
target.removeAttr('checked');
} else {
- target.attr('checked', 'checked');
+ //target.attr('checked', 'checked');
+ $(".description_dialog[task_id="+target.attr("task_id")+"]").dialog('open');
}
} else if(target.is('.edit_img')) {
var stg_id = target.parents('.stg').attr('stg_id');

0 comments on commit 33baf28

Please sign in to comment.