Skip to content

Commit fd0ef37

Browse files
committed
Displays groups dynamically
1 parent bf82c38 commit fd0ef37

File tree

4 files changed

+28
-27
lines changed

4 files changed

+28
-27
lines changed

app/routes/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import Ember from 'ember';
22

33
export default Ember.Route.extend({
44
model: function() {
5-
return this.store.query('group', {
6-
'filter[id]': 1
7-
}).then((groups) => {
8-
return groups.objectAt(0);
9-
});
5+
return this.get('store').findAll("group");
106
}
117
});

app/styles/pages/index.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
.group {
4141
text-align: center;
4242
margin-top: $padding-l;
43+
margin-bottom: $padding-xl;
44+
45+
.profile-picture {
46+
width: 200px;
47+
height: 200px;
48+
}
4349

4450
.description {
4551
margin-top: $padding-m;

app/templates/index.hbs

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,35 @@
2121
<div class="offset-md-1 col-md-10 offset-lg-2 col-lg-8">
2222
Want to know more about our church? Check out some of the groups within
2323
our church that may interest you.
24-
{{#each g in model.group}}
25-
<p>HELLO={{group.slug}}</p>
26-
{{/each}}
2724
</div>
2825
</div>
2926
<div class="row">
30-
<div class="offset-md-2 col-md-4 group">
31-
{{#link-to "group.index" "childrens-church"}}
32-
<img src={{cloudinary-fetch url="https://mcac.s3.amazonaws.com/groups/fabe359d-8611-4112-b675-842cd40ef57e.jpg"
33-
width=200
34-
radius="max"
35-
height=200 crop="fill"}} />
27+
{{#each model as |group|}}
28+
<div class="col-md-4 group">
29+
{{#link-to "group.index" group.slug}}
30+
<img class="profile-picture"
31+
src={{cloudinary-fetch url=group.profilePictureUrl
32+
width=200
33+
radius="max"
34+
height=200
35+
crop="fill"}} />
3636
{{/link-to}}
3737
<div class="description">
38-
{{#link-to "group.index" "childrens-church"}}
39-
Children's Church
38+
{{#link-to "group.index" group.slug}}
39+
{{group.name}}
4040
{{/link-to}}
4141
</div>
4242
</div>
43-
<div class="col-md-4 group" {{action "viewGroup" "english-service"}}>
44-
{{#link-to "group.index" "english-service"}}
45-
<img src={{cloudinary-fetch url="https://mcac.s3.amazonaws.com/groups/5c7d76a8-d195-4907-951d-5b3fb00c438d.jpg"
46-
width=200
47-
radius="max"
48-
height=200 crop="fill"}} />
49-
50-
{{/link-to}}
43+
{{/each}}
44+
<div class="col-md-4 group">
45+
<img class="profile-picture"
46+
src={{cloudinary-fetch url="https://mcac.s3.amazonaws.com/bulletins/3017d548-1461-4520-8153-3ed1d910e11a.jpg"
47+
width=200
48+
radius="max"
49+
height=200
50+
crop="fill"}} />
5151
<div class="description">
52-
{{#link-to "group.index" "english-service"}}
53-
English Service
54-
{{/link-to}}
52+
Coming Soon...
5553
</div>
5654
</div>
5755
</div>

mirage/scenarios/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default function(server) {
2222
}
2323

2424
server.createList("post", 40, { group: englishService });
25+
server.createList("group", 1);
2526

2627
server.create("user", { email: "[email protected]", name: "Test User" });
2728
}

0 commit comments

Comments
 (0)