Skip to content

Commit c191d62

Browse files
committed
update course card
1 parent fb57163 commit c191d62

4 files changed

Lines changed: 127 additions & 52 deletions

File tree

ims-education.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
IMS databases differ from each other and differ from relational databases
131131
message types, security, maintenance, troubleshooting, and more."
132132
imgsrc="wp-content/course-badges/badge_ims_fundamentals.png"
133+
selfpaced="true"
133134
level="Beginner"
134135
cost="None"
135136
badge="Yes"
@@ -146,6 +147,7 @@
146147
between C and PL/I, particularly in language syntax, program structure, declarations,
147148
loops, data types, arrays, structures, and more."
148149
imgsrc="wp-content/course-badges/badge_intro_pli.png"
150+
selfpaced="true"
149151
level="Beginner"
150152
cost="None"
151153
badge="Yes"
@@ -167,6 +169,7 @@
167169
the performance of these databases, and review IMS Monitor reports to see whether
168170
the logical relationships are effective."
169171
imgsrc="wp-content/course-badges/badge_log_rel.png"
172+
selfpaced="true"
170173
level="Advanced"
171174
cost="None"
172175
badge="Yes"
@@ -185,6 +188,7 @@
185188
secondary indexes, logical relationships, database types,
186189
access methods, database recovery, and more."
187190
imgsrc="wp-content/course-badges/badge_ims_db_fundamentals.png"
191+
selfpaced="true"
188192
level="Beginner"
189193
cost="None"
190194
badge="Yes"
@@ -203,6 +207,7 @@
203207
This course is for experienced IMS system programmers and database administrators who need to work with
204208
DBRC."
205209
imgsrc="wp-content/course-badges/badge_dbrc.png"
210+
selfpaced="true"
206211
level="Intermediate"
207212
cost="None"
208213
badge="Yes"
@@ -221,6 +226,7 @@
221226
IMS systems on different LPARs and processors can access and update the same databases
222227
with complete integrity, and how to implement and maintain a data sharing environment."
223228
imgsrc="wp-content/course-badges/badge_ims_data_sharing.png"
229+
selfpaced="true"
224230
level="Advanced"
225231
cost="None"
226232
badge="Yes"
@@ -239,6 +245,7 @@
239245
You’ll learn how other IMS databases can be migrated to HALDB and the advantages of using HALDBs.
240246
This is an intermediate course for experienced IMS database administrators who implement and manage HALDBs."
241247
imgsrc="wp-content/course-badges/badge_haldb.png"
248+
selfpaced="true"
242249
level="Intermediate"
243250
cost="None"
244251
badge="Yes"
@@ -256,6 +263,7 @@
256263
and application programmers who design or implement IMS Fast Path applications in an
257264
IMS Transaction Management (TM) or IBM CICS Database Control (DBCTL) environment."
258265
imgsrc="wp-content/course-badges/bacge_fp_implementation.png"
266+
selfpaced="true"
259267
level="Advanced"
260268
cost="None"
261269
badge="Yes"
@@ -276,6 +284,7 @@
276284
control interval (CI) layouts, sequential dependents (SDEPs),
277285
and other database components, features, and structures."
278286
imgsrc="wp-content/course-badges/badge_db_repair.png"
287+
selfpaced="true"
279288
level="Advanced"
280289
cost="None"
281290
badge="Yes"
@@ -294,6 +303,7 @@
294303
and buffering for Virtual Storage Access Method (VSAM) and Overflow Sequential Access Method
295304
(OSAM) databases"
296305
imgsrc="wp-content/course-badges/badge_perf_tuning.png"
306+
selfpaced="true"
297307
level="Advanced"
298308
cost="None"
299309
badge="Yes"
@@ -312,6 +322,7 @@
312322
databases, use the DL/I test program, and how to prepare a job stream
313323
to load a database."
314324
imgsrc="wp-content/course-badges/badge_physical_org_db.png"
325+
selfpaced="true"
315326
level="Intermediate"
316327
cost="None"
317328
badge="Yes"
@@ -333,6 +344,7 @@
333344
logging, connecting IMS to IBM CICS® and IBM Db2®, data sharing, shared queues,
334345
preparing and starting the system, and more."
335346
imgsrc="wp-content/course-badges/badge_db_tm_sysprog.png"
347+
selfpaced="true"
336348
level="Intermediate"
337349
cost="None"
338350
badge="Yes"
@@ -351,6 +363,7 @@
351363
that are useful for IMS problem diagnostics, perform the methodology for debugging IMS abends, and understand the
352364
methodology for debugging IMS waits and loops."
353365
imgsrc="wp-content/course-badges/badge_ims_diagnostics.png"
366+
selfpaced="true"
354367
level="Intermediate"
355368
cost="None"
356369
badge="Yes"
@@ -368,6 +381,7 @@
368381
are shared within a parallel sysplex environment. Learn how to prepare and implement IMS shared queues
369382
and manage and troubleshoot an IMS shared queues environment."
370383
imgsrc="wp-content/course-badges/badge_ims_shared_queues.png"
384+
selfpaced="true"
371385
level="Intermediate"
372386
cost="None"
373387
badge="Yes"
@@ -386,6 +400,7 @@
386400
components, commands, processes, parameters, and more to ensure that the
387401
IMS TM system is running as efficiently as possible."
388402
imgsrc="wp-content/course-badges/badge_ims_tm_tuning.png"
403+
selfpaced="true"
389404
level="Advanced"
390405
cost="None"
391406
badge="Yes"
@@ -404,6 +419,7 @@
404419
an IMS DBCTL system, and understand the IMS architecture that applies to database management and attaching
405420
to CICS systems and transactions."
406421
imgsrc="wp-content/course-badges/badge_ims_dbctl.png"
422+
selfpaced="true"
407423
level="Intermediate"
408424
cost="None"
409425
badge="Yes"
@@ -427,6 +443,7 @@
427443
This course does not teach basic COBOL or PL/I. You should already have
428444
experience developing applications with one or both of those languages."
429445
imgsrc="wp-content/course-badges/badge_tm_app_prog.png"
446+
selfpaced="true"
430447
level="Intermediate"
431448
cost="None"
432449
badge="Yes"
@@ -444,6 +461,7 @@
444461
on IMS database records. You'll learn about the hierarchic structure of IMS databases,
445462
how to construct DL/I calls, how to test your applications, and more."
446463
imgsrc="wp-content/course-badges/badge_db_app_prog.png"
464+
selfpaced="true"
447465
level="Intermediate"
448466
cost="None"
449467
badge="Yes"
@@ -474,7 +492,6 @@
474492
imgsrc="wp-content/icons/icon_education.svg"
475493
selfpaced="false"
476494
level="Intermediate"
477-
badge="n/a"
478495
time="36 hours"
479496
start="Jun 9"
480497
end="Jun 19"

ims-tm.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
<!-- Web components -->
7979
<script src="web-components/nav-header/nav-header.js" type="module"></script>
8080
<script src="web-components/hero-section/hero-section.js" type="module"></script>
81+
<script src="web-components/course-card/course-card.js" type="module"></script>
8182
<script src="web-components/footer/footer.js" type="module"></script>
8283
</head>
8384

@@ -225,6 +226,25 @@ <h3>Ways to connect</h3>
225226
</div>
226227
</section>
227228

229+
<!-- =========================== Upskill with IMS TM =========================== -->
230+
<section class="white-bg card-section">
231+
<div class="card-section-header"><h2>Upskill with IMS Transaction Manager</h2></div>
232+
<div class="card-section-header"><h3>The basics</h3></div>
233+
234+
<!-- IMS Fundamentals -->
235+
<course-card
236+
id="ims-fundamentals"
237+
name="IMS Fundamentals"
238+
desc="Learn about the main components of IBM IMS: IMS Database Manager (IMS DB),
239+
IMS Transaction Manager (IMS TM), and common system services for IMS DB and
240+
IMS TM. Learn how these components work and interact with applications, how
241+
IMS databases differ from each other and differ from relational databases
242+
message types, security, maintenance, troubleshooting, and more."
243+
imgsrc="wp-content/course-badges/badge_ims_fundamentals.png"
244+
link="https://learn.ibm.com/course/view.php?id=8829"
245+
>
246+
</course-card>
247+
</section>
228248

229249
<!-- =========================== Hone your skills =========================== -->
230250
<section class="zs-gray-section ibm-background-white-core hs-section">

web-components/course-card/course-card.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ <h3 class="live-session"></h3>
1111
<span class="course-desc"></span>
1212
<div class="column-g">
1313
<div class="inline-g">
14-
<p><b><span class="course-type"></span></b> Yes</p>
15-
<p><b>Level: </b><span class="course-level"></span></p>
16-
<p><b>Cost: </b><span class="course-cost"></span></p>
17-
<!-- <p><b>Badge: </b><span class="course-badge"></span></p> -->
14+
<p class="course-type-g"><b><span class="course-type"></span></b> Yes</p>
15+
<p class="course-level-g"><b>Level: </b><span class="course-level"></span></p>
16+
<p class="course-cost-g"><b>Cost: </b><span class="course-cost"></span></p>
1817
<p class="course-badge-g"><b>Badge: </b><span class="course-badge"></span></p>
1918
<p class="course-time-g"><b>Time: </b><span class="course-time"></span></p>
2019
<p class="course-start-g"><b>Starts: </b><span class="course-start"></span></p>

web-components/course-card/course-card.js

Lines changed: 86 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,35 @@ function createComponent(html) {
1919
*/
2020
function setContent(cssSelector, content, shadow) {
2121
const selector = shadow.querySelector(cssSelector);
22-
selector.textContent = content;
22+
// Check if content has been specified
23+
if (content != "") {
24+
selector.textContent = content;
25+
} else {
26+
const hideSelector = cssSelector + "-g";
27+
hideContent(hideSelector, shadow);
28+
}
29+
}
30+
31+
/**
32+
* Sets the image of an element based on a CSS selector.
33+
* @param {string} cssSelector - The CSS selector of the element to set the content for.
34+
* @param {string} image - The image to set for the element.
35+
* @param {string} name - The name of the element.
36+
* @param {string} selfpaced - A boolean indicating whether the element is a self-paced course.
37+
* @param {boolean} shadow - A boolean indicating whether to use the shadow DOM for the element.
38+
* @returns {void}
39+
*/
40+
function setImage(cssSelector, image, name, selfpaced, shadow) {
41+
const selector = shadow.querySelector(cssSelector);
42+
// Set image
43+
selector.src = image;
44+
// Set alt text
45+
selector.setAttribute('alt', `${name} badge`);
46+
// Change styling for self-paced course card
47+
if (selfpaced != 'true') {
48+
const courseCard = shadow.querySelector('.course-card');
49+
courseCard.style.alignItems = 'flex-start';
50+
}
2351
}
2452

2553
/**
@@ -53,9 +81,14 @@ function createComponent(html) {
5381
*/
5482
function setLink(cssSelector, url, name, linkText, shadow) {
5583
const link = shadow.querySelector(cssSelector);
56-
link.href = url;
57-
link.setAttribute('aria-label', `Learn more about ${name}`);
58-
link.textContent = linkText;
84+
if (url != "") {
85+
link.href = url;
86+
link.setAttribute('aria-label', `Learn more about ${name}`);
87+
link.textContent = linkText;
88+
} else {
89+
const hideSelector = cssSelector + "-g";
90+
hideContent(hideSelector, shadow);
91+
}
5992
}
6093

6194
/**
@@ -75,9 +108,16 @@ function createComponent(html) {
75108
// Creates an instance of CourseCard
76109
constructor() {
77110
super();
78-
this.selfpaced = 'true';
79-
this.cost = 'None';
80-
this.badge = 'Yes';
111+
this.selfpaced = "";
112+
this.level = "";
113+
this.cost = "";
114+
this.badge = "";
115+
this.time = "";
116+
this.start = "";
117+
this.end = "";
118+
this.hours = "";
119+
this.link = "";
120+
this.registerlink = "";
81121
}
82122

83123
/**
@@ -87,6 +127,21 @@ function createComponent(html) {
87127
static get observedAttributes() {
88128
return ['name', 'session', 'desc', 'imgsrc', 'selfpaced', 'level', 'cost', 'badge', 'time', 'start', 'end', 'hours', 'link', 'registerlink'];
89129
}
130+
// Course Card Options
131+
// - id
132+
// - name
133+
// - session (for live courses only)
134+
// - desc: can be written with <p> tags or as plaintext
135+
// - imgsrc
136+
// - selfpaced: true or false
137+
// - level: Beginner, Intermediate, or Advanced
138+
// - badge: Yes or No
139+
// - time: x hours
140+
// - start (for live courses only)
141+
// - end (for live courses only)
142+
// - hours (for live courses only)
143+
// - registerlink (for live courses only)
144+
// - link
90145

91146
/**
92147
* Called when an attribute is defined or changed.
@@ -106,63 +161,47 @@ function createComponent(html) {
106161
shadow.innerHTML = html;
107162

108163
// Set course img
109-
const courseImg = shadow.querySelector('.course-img');
110-
courseImg.src = this.imgsrc;
111-
courseImg.setAttribute('alt', `${this.name} badge`);
112-
if (this.selfpaced != 'true') {
113-
const courseCard = shadow.querySelector('.course-card');
114-
courseCard.style.alignItems = 'flex-start';
115-
}
116-
117-
if (this.name == 'IMS Database Recovery Control (DBRC)') {
118-
console.log(this.badge);
119-
}
120-
164+
setImage('.course-img', this.imgsrc, this.name, this.selfpaced, shadow);
121165
// Set course name
122166
setContent('.course-name', this.name, shadow);
123-
// Set session for live course
124-
setContent('.live-session', this.session, shadow);
125167
// Set course desc
126168
setDesc('.course-desc', this.desc, shadow);
169+
// Set session for live course
170+
setContent('.live-session', this.session, shadow);
127171
// Set course level
128172
setContent('.course-level', this.level, shadow);
129173
// Set course type
130-
const courseType = this.selfpaced == 'true' ? 'Self-paced: ' : 'Instructor-led: ';
174+
let courseType;
175+
switch (this.selfpaced) {
176+
case 'true':
177+
courseType = 'Self-paced: ';
178+
break;
179+
case 'false':
180+
courseType = 'Instructor-led: ';
181+
break;
182+
default:
183+
courseType = '';
184+
}
185+
// const courseType = this.selfpaced == 'true' ? 'Self-paced: ' : 'Instructor-led: ';
131186
setContent('.course-type', courseType, shadow);
132187
// Set course cost
133188
setContent('.course-cost', this.cost, shadow);
134189
// Set course badge
135-
if (this.badge != 'n/a') {
136-
setContent('.course-badge', this.badge, shadow);
137-
} else {
138-
hideContent('.course-badge-g', shadow);
139-
};
190+
setContent('.course-badge', this.badge, shadow);
140191
// Set course time
141192
setContent('.course-time', this.time, shadow);
193+
// Set course duration
194+
setContent('.course-start', this.start, shadow);
195+
setContent('.course-end', this.end, shadow);
196+
// Set course hours
197+
setContent('.course-hours', this.hours, shadow);
142198
// Set course link
143199
setLink('.course-link', this.link, this.name, 'Learn more →', shadow);
144-
145-
var linkText;
146-
// Change card content based on self-paced vs live course
147-
if (this.selfpaced == 'true') {
148-
// Hide course duration
149-
hideContent('.course-start-g', shadow);
150-
hideContent('.course-end-g', shadow);
151-
// Hide course hours
152-
hideContent('.course-hours-g', shadow);
153-
} else {
154-
// Set course duration
155-
setContent('.course-start', this.start, shadow);
156-
setContent('.course-end', this.end, shadow);
157-
// Set course hours
158-
setContent('.course-hours', this.hours, shadow);
159-
// Set register link
160-
linkText = 'Register →'
161-
setLink('.register-link', this.registerlink, this.name, 'Register →', shadow);
162-
}
200+
// Set register link
201+
setLink('.register-link', this.registerlink, this.name, 'Register →', shadow);
163202
}
164203
}
165204

166205
// Define new CourseCard element
167206
customElements.define('course-card', CourseCard);
168-
}
207+
}

0 commit comments

Comments
 (0)