Created
September 25, 2013 13:02
-
-
Save overnin/6699259 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generateHtmlProgramStats(programStats) { | |
| var myTemplate = '<div>'+ | |
| '<span ' + ( (programStats!=null) ? 'title="Optin/Totalparticipant(s)"' : 'Stats Not Available') +'class = stat>'+ | |
| 'ActiveParticipant/TotalParticipantStats'+ | |
| '</span> participant(s)'+ | |
| '</div>'+ | |
| '<div>'+ | |
| '<span title = Total(totalcurrentmonth)message(s) class = stat>'+ | |
| 'Totalhistory(Totalcurrentmonthmessages)'+ | |
| '</span> total message(s)'+ | |
| '</div>'+ | |
| .... | |
| myTemplate = myTemplate.replace('Activeparticipant', programStats['active-participant-count']); | |
| myTemplate = myTemplate.replace('Totalparticipantstats', programStats['participant-count']); | |
| myTemplate = myTemplate.replace('Totalhistory', programStats['history-count']); | |
| myTemplate = myTemplate.replace('Totalcurrentmonthmessages', programStats['total-current-month-messages-count']); | |
| myTemplate = myTemplate.replace('Allreceivedmessages', programStats['all-received-messages-count']); | |
| myTemplate = myTemplate.replace('Currentmonthreceivedmessages', programStats['current-month-received-messages-count']); | |
| myTemplate = myTemplate.replace('Allsentmessages', programStats['all-sent-messages-count']); | |
| myTemplate = myTemplate.replace('Currentmonthsentmessages', programStats['current-month-sent-messages-count']); | |
| myTemplate = myTemplate.replace('Schedule', programStats['schedule-count']); | |
| myTemplate = myTemplate.replace('Todayschedule', programStats['today-schedule-count']); | |
| return myTemplate; | |
| } |
overnin
commented
Sep 25, 2013
Author
Author
But i don't like programStats == null because it's not what happend in Cakephp
in cakephp the component would return
array( "activeParticipant" => "N/A", .....
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment