@@ -59,6 +59,68 @@ app.use(cookieParser());
5959app . use ( express . static ( path . join ( __dirname , 'public' ) ) ) ;
6060app . use ( app . router ) ;
6161
62+ function mockChallenges ( ) {
63+
64+ function add ( name , amount ) {
65+
66+ var platforms = [ 'Salesforce' ] ;
67+ var technologies = [ 'Aura' , 'Apex' , 'JavaScript' ] ;
68+ var today = new Date ( ) ;
69+
70+ return {
71+ _type : 'develop' ,
72+ _source : {
73+ challengeId : 0 ,
74+ challengeName : name ,
75+ platforms : platforms ,
76+ technologies : technologies ,
77+ totalPrize : amount ,
78+ numRegistrants : Math . floor ( ( Math . random ( ) * 10 ) + 1 ) ,
79+ numSubmissions : Math . floor ( ( Math . random ( ) * 3 ) + 1 ) ,
80+ submissionEndDate : today . setDate ( today . getDate ( ) + Math . floor ( ( Math . random ( ) * 10 ) + 1 ) )
81+ }
82+ } ;
83+
84+ }
85+
86+ var challenges = [ ] ;
87+ challenges . push ( add ( 'Hello Aura!! Build Your First Aura Component' , 100 ) ) ;
88+ challenges . push ( add ( 'Lazy Loading Data TreeView App' , 1000 ) ) ;
89+ challenges . push ( add ( 'Lead Conversion App' , 1000 ) ) ;
90+ challenges . push ( add ( 'Customizable Grid w/search, sorting & pagination' , 750 ) ) ;
91+ challenges . push ( add ( 'Org Chart Visualizer App' , 1000 ) ) ;
92+ challenges . push ( add ( 'Find Duplicate Records App' , 1000 ) ) ;
93+ challenges . push ( add ( 'File Upload App' , 1000 ) ) ;
94+ challenges . push ( add ( 'Drag n Drop Record Selector App' , 1000 ) ) ;
95+ challenges . push ( add ( 'Month, Week & Day Calendar App' , 2000 ) ) ;
96+ challenges . push ( add ( 'Typeahead Input Field' , 300 ) ) ;
97+ challenges . push ( add ( 'Combobox with Filtering' , 300 ) ) ;
98+ challenges . push ( add ( 'Image List Viewer App' , 500 ) ) ;
99+ challenges . push ( add ( 'Range Selection DatePicker' , 500 ) ) ;
100+ challenges . push ( add ( 'Share on Social Media' , 350 ) ) ;
101+ challenges . push ( add ( 'Drag n Drop Sortable List' , 250 ) ) ;
102+ challenges . push ( add ( 'Range Selection DateTimePicker' , 500 ) ) ;
103+ challenges . push ( add ( 'Cascading (Dependent) Combobox' , 300 ) ) ;
104+ challenges . push ( add ( 'Progress Bar' , 250 ) ) ;
105+ challenges . push ( add ( 'MaskedText Input Field' , 250 ) ) ;
106+ challenges . push ( add ( 'MultiSelect Input Field with Filtering' , 500 ) ) ;
107+ challenges . push ( add ( 'Range Bounded Spinner' , 250 ) ) ;
108+ challenges . push ( add ( 'Multiselect Calendar' , 250 ) ) ;
109+ challenges . push ( add ( 'Range Bounded Slider' , 350 ) ) ;
110+ challenges . push ( add ( 'TabStrip' , 250 ) ) ;
111+ challenges . push ( add ( 'Image Coverflow' , 250 ) ) ;
112+ challenges . push ( add ( 'Range Bounded Editable Dial' , 500 ) ) ;
113+ challenges . push ( add ( 'Growl Notifications' , 500 ) ) ;
114+ challenges . push ( add ( 'Tooltip' , 250 ) ) ;
115+ challenges . push ( add ( 'Toggle True/False Button' , 250 ) ) ;
116+ challenges . push ( add ( 'Captcha' , 350 ) ) ;
117+ challenges . push ( add ( 'Analog/Digital Clock Datetime' , 350 ) ) ;
118+ challenges . push ( add ( 'Modal' , 250 ) ) ;
119+
120+ return challenges ;
121+
122+ }
123+
62124// fetches a list of challenges as json and exposes it to the ejs
63125var challenges = function ( req , res , next ) {
64126 request ( challengesEndpoint , function ( error , response , body ) {
@@ -70,7 +132,7 @@ var challenges = function(req, res, next) {
70132 challenges . push ( c ) ;
71133 }
72134 } ) ;
73- req . challenges = challenges ;
135+ req . challenges = mockChallenges ( ) ;
74136 } else {
75137 req . challenges = [ ] ;
76138 }
0 commit comments