parameters: (self, month, day)
return_statement: return div
docstring: div.add_behavior( {
              'type': 'click_up',
              'cbjs_action': '''
              var class_name = 'tactic.ui.widget.week_wdg.WeekWdg';
              spt.panel.load_popup("Week", class_name);
              '''
          } )
docstring_summary: div.add_behavior( {
              'type': 'click_up',
              'cbjs_action': '''
              var class_name = 'tactic.ui.widget.week_wdg.WeekWdg';
              spt.panel.load_popup("Week", class_name);
              '''
          } )
docstring_tokens: div . add_behavior ( { type : click_up cbjs_action : var class_name = tactic . ui . widget . week_wdg . WeekWdg ; spt . panel . load_popup ( Week class_name ) ; } )
function: def get_day_wdg(self, month, day):
  
          div = DivWdg()
          div.add_style("width: 120px")
          div.add_style("height: 150px")
          div.add_style("padding: 5px")
  
  
          # disabled until further development is done on WeekWdg
          """
          div.add_behavior( {
              'type': 'click_up',
              'cbjs_action': '''
              var class_name = 'tactic.ui.widget.week_wdg.WeekWdg';
              spt.panel.load_popup("Week", class_name);
              '''
          } )
          """
  
          # if the day is today
          today = datetime.today()
          if day.year == today.year and day.month == today.month and day.day == today.day:
              div.add_color("background", "background", [-20, -20, 20])
              div.add("[%s]" % day.day)
  
          elif day.weekday() in [5, 6]:
              div.add_color("background", "background", -3)
              if day.month != self.month:
                  div.add("<i style='opacity: 0.3'>[%s]</i>" % day.day)
              else:
                  div.add("[%s]" % day.day)
  
          # if the month is different than today
          elif day.month != self.month:
              #div.add_color("background", "background", [-5, -5, -5])
              div.add("<i style='opacity: 0.3'>[%s]</i>" % day.day)
  
  
          else:
              div.add("[%s]" % day.day)
  
  
          div.add(HtmlElement.br(2))
  
  
          key = "%s-%0.2d-%0.2d 00:00:00" % (day.year, day.month, day.day)
  
          div.add_attr("date", key)
          div.add_class("spt_date_div_content")
  
  
          line_div = DivWdg()
          div.add(line_div)
          line_div.add_style("padding: 3px")
          icon = IconWdg("Number of task due", IconWdg.CALENDAR)
          line_div.add(icon)
          num_tasks = self.tasks_count.get(key)
          if not num_tasks:
              num_tasks = 0
              line_div.add_style("opacity: 0.15")
              line_div.add_style("font-style: italic")
          line_div.add("%s task/s due" % num_tasks)
          line_div.add(HtmlElement.br())
  
  
  
          line_div = DivWdg()
          div.add(line_div)
          line_div.add_style("padding: 3px")
          icon = IconWdg("Number of check-ins", IconWdg.PUBLISH)
          line_div.add(icon)
          num_snapshots = self.snapshots_count.get(key)
          if not num_snapshots:
              num_snapshots = 0
              line_div.add_style("opacity: 0.15")
              line_div.add_style("font-style: italic")
          line_div.add("%s check-in/s" % num_snapshots )
          line_div.add(HtmlElement.br())
  
  
          line_div = DivWdg()
          div.add(line_div)
          line_div.add_style("padding: 3px")
          icon = IconWdg("Number of notes", IconWdg.NOTE)
          line_div.add(icon)
          num_notes = self.notes_count.get(key)
          if not num_notes:
              num_notes = 0
              line_div.add_style("opacity: 0.15")
              line_div.add_style("font-style: italic")
          line_div.add("%s note/s" % num_notes)
          line_div.add(HtmlElement.br())
  
  
          line_div = DivWdg()
          div.add(line_div)
          line_div.add_style("padding: 3px")
          icon = IconWdg("Work Hours", IconWdg.CLOCK)
          line_div.add(icon)
          work_hours = self.work_hours_count.get(key)
          if not work_hours:
              work_hours = 0
              line_div.add_style("opacity: 0.15")
              line_div.add_style("font-style: italic")
          line_div.add("%s work hours" % work_hours)
          line_div.add(HtmlElement.br())
  
  
  
  
  
  
  
  
  
  
  
  
          line_div = DivWdg()
          div.add(line_div)
          line_div.add_style("padding: 3px")
  
  
  
          num_milestone = self.milestones_count.get(key)
          if num_milestone:
              icon = IconWdg("Milestones", IconWdg.GOOD)
              line_div.add(icon)
              line_div.add_style("font-style: italic")            
              line_div.add_style("cursor: pointer;")
              line_div.add("%i milestone/s" % (num_milestone))
              line_div.add(HtmlElement.br())
  
              
              line_div.add_behavior( {
                  'type': 'click_up',
                  'cbjs_action': '''
  
                  var key_array = "%s".split(" "); // array
                  var single_day = key_array[0]; // string
                  var time_key = Date.parse(single_day); // time object
                  var time_key_str = time_key.format('db'); // string
                  var next_day = time_key.increment('day', 1).format('db'); // string
  
                  var class_name = "tactic.ui.panel.FastTableLayoutWdg";
                  var popup_kwargs = {
                      "search_type": "sthpw/milestone",
                      "expression": "@SOBJECT(sthpw/milestone['due_date', '>=', '" + time_key_str + "']['due_date', '<=', '" + next_day + "']['@ORDER_BY', 'due_date desc'])"
                      };
  
                  spt.tab.set_main_body_tab();
                  spt.tab.add_new("add_milestone", "Add Milestone", class_name, popup_kwargs);
                  //spt.panel.load_popup("Add Milestone", class_name, popup_kwargs);
  
                  ''' % (key)
              } )
  
  
          else:
              num_milestone = 0
              icon = IconWdg("Milestones", "FA_PLUS")
              line_div.add(icon)
              #line_div.add_style("opacity: 0.85")
              line_div.add("Add milestone")
              line_div.add(HtmlElement.br())
              line_div.add_style("cursor: pointer")
          
  
              line_div.add_behavior( {
                  'type': 'click_up',
                  'cbjs_action': '''
                  var server = TacticServerStub.get();
                  var date_div = bvr.src_el.getParent("td");
                  var full_date = date_div.getElement(".spt_date_div_content").getAttribute("date");
                  var date_array = full_date.split(" ");
                  full_date = date_array[0];
  
                  date_array = full_date.split("-");
  
                  var date = date_array[2];
                  var month = date_array[1];
                  var year = date_array[0];
  
                  var due_date_string = month.concat(" " + date + ", ").concat(year);
  
                  var project_code = server.get_project();
  
                  data = {            
                      "due_date": due_date_string,
                      "project_code": project_code
                  }; 
  
                  var class_name = "tactic.ui.panel.EditWdg";
                  var popup_kwargs = {
                      "default": data, 
                      "search_type": "sthpw/milestone"
                      };
  
                  spt.panel.load_popup("Add Milestone", class_name, popup_kwargs);
                  '''
              } )
  
  
          #div.add("%s tasks completed<br/>" % self.task_count)
          #div.add("%s notes entered<br/>" % self.notes_count)
          #div.add("%s work hours<br/>" % self.work_hours_count)
  
  
          return div
function_tokens: def get_day_wdg ( self , month , day ) : div = DivWdg ( ) div . add_style ( "width: 120px" ) div . add_style ( "height: 150px" ) div . add_style ( "padding: 5px" ) # disabled until further development is done on WeekWdg # if the day is today today = datetime . today ( ) if day . year == today . year and day . month == today . month and day . day == today . day : div . add_color ( "background" , "background" , [ - 20 , - 20 , 20 ] ) div . add ( "[%s]" % day . day ) elif day . weekday ( ) in [ 5 , 6 ] : div . add_color ( "background" , "background" , - 3 ) if day . month != self . month : div . add ( "<i style='opacity: 0.3'>[%s]</i>" % day . day ) else : div . add ( "[%s]" % day . day ) # if the month is different than today elif day . month != self . month : #div.add_color("background", "background", [-5, -5, -5]) div . add ( "<i style='opacity: 0.3'>[%s]</i>" % day . day ) else : div . add ( "[%s]" % day . day ) div . add ( HtmlElement . br ( 2 ) ) key = "%s-%0.2d-%0.2d 00:00:00" % ( day . year , day . month , day . day ) div . add_attr ( "date" , key ) div . add_class ( "spt_date_div_content" ) line_div = DivWdg ( ) div . add ( line_div ) line_div . add_style ( "padding: 3px" ) icon = IconWdg ( "Number of task due" , IconWdg . CALENDAR ) line_div . add ( icon ) num_tasks = self . tasks_count . get ( key ) if not num_tasks : num_tasks = 0 line_div . add_style ( "opacity: 0.15" ) line_div . add_style ( "font-style: italic" ) line_div . add ( "%s task/s due" % num_tasks ) line_div . add ( HtmlElement . br ( ) ) line_div = DivWdg ( ) div . add ( line_div ) line_div . add_style ( "padding: 3px" ) icon = IconWdg ( "Number of check-ins" , IconWdg . PUBLISH ) line_div . add ( icon ) num_snapshots = self . snapshots_count . get ( key ) if not num_snapshots : num_snapshots = 0 line_div . add_style ( "opacity: 0.15" ) line_div . add_style ( "font-style: italic" ) line_div . add ( "%s check-in/s" % num_snapshots ) line_div . add ( HtmlElement . br ( ) ) line_div = DivWdg ( ) div . add ( line_div ) line_div . add_style ( "padding: 3px" ) icon = IconWdg ( "Number of notes" , IconWdg . NOTE ) line_div . add ( icon ) num_notes = self . notes_count . get ( key ) if not num_notes : num_notes = 0 line_div . add_style ( "opacity: 0.15" ) line_div . add_style ( "font-style: italic" ) line_div . add ( "%s note/s" % num_notes ) line_div . add ( HtmlElement . br ( ) ) line_div = DivWdg ( ) div . add ( line_div ) line_div . add_style ( "padding: 3px" ) icon = IconWdg ( "Work Hours" , IconWdg . CLOCK ) line_div . add ( icon ) work_hours = self . work_hours_count . get ( key ) if not work_hours : work_hours = 0 line_div . add_style ( "opacity: 0.15" ) line_div . add_style ( "font-style: italic" ) line_div . add ( "%s work hours" % work_hours ) line_div . add ( HtmlElement . br ( ) ) line_div = DivWdg ( ) div . add ( line_div ) line_div . add_style ( "padding: 3px" ) num_milestone = self . milestones_count . get ( key ) if num_milestone : icon = IconWdg ( "Milestones" , IconWdg . GOOD ) line_div . add ( icon ) line_div . add_style ( "font-style: italic" ) line_div . add_style ( "cursor: pointer;" ) line_div . add ( "%i milestone/s" % ( num_milestone ) ) line_div . add ( HtmlElement . br ( ) ) line_div . add_behavior ( { 'type' : 'click_up' , 'cbjs_action' : '''
  
                  var key_array = "%s".split(" "); // array
                  var single_day = key_array[0]; // string
                  var time_key = Date.parse(single_day); // time object
                  var time_key_str = time_key.format('db'); // string
                  var next_day = time_key.increment('day', 1).format('db'); // string
  
                  var class_name = "tactic.ui.panel.FastTableLayoutWdg";
                  var popup_kwargs = {
                      "search_type": "sthpw/milestone",
                      "expression": "@SOBJECT(sthpw/milestone['due_date', '>=', '" + time_key_str + "']['due_date', '<=', '" + next_day + "']['@ORDER_BY', 'due_date desc'])"
                      };
  
                  spt.tab.set_main_body_tab();
                  spt.tab.add_new("add_milestone", "Add Milestone", class_name, popup_kwargs);
                  //spt.panel.load_popup("Add Milestone", class_name, popup_kwargs);
  
                  ''' % ( key ) } ) else : num_milestone = 0 icon = IconWdg ( "Milestones" , "FA_PLUS" ) line_div . add ( icon ) #line_div.add_style("opacity: 0.85") line_div . add ( "Add milestone" ) line_div . add ( HtmlElement . br ( ) ) line_div . add_style ( "cursor: pointer" ) line_div . add_behavior ( { 'type' : 'click_up' , 'cbjs_action' : '''
                  var server = TacticServerStub.get();
                  var date_div = bvr.src_el.getParent("td");
                  var full_date = date_div.getElement(".spt_date_div_content").getAttribute("date");
                  var date_array = full_date.split(" ");
                  full_date = date_array[0];
  
                  date_array = full_date.split("-");
  
                  var date = date_array[2];
                  var month = date_array[1];
                  var year = date_array[0];
  
                  var due_date_string = month.concat(" " + date + ", ").concat(year);
  
                  var project_code = server.get_project();
  
                  data = {            
                      "due_date": due_date_string,
                      "project_code": project_code
                  }; 
  
                  var class_name = "tactic.ui.panel.EditWdg";
                  var popup_kwargs = {
                      "default": data, 
                      "search_type": "sthpw/milestone"
                      };
  
                  spt.panel.load_popup("Add Milestone", class_name, popup_kwargs);
                  ''' } ) #div.add("%s tasks completed<br/>" % self.task_count) #div.add("%s notes entered<br/>" % self.notes_count) #div.add("%s work hours<br/>" % self.work_hours_count) return div