forked from bryanlarsen/agility-gitorial-patches
-
Notifications
You must be signed in to change notification settings - Fork 1
/
65-fix-front-page.patch
36 lines (28 loc) · 1.48 KB
/
65-fix-front-page.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
fix-front-page
From: Bryan Larsen <[email protected]>
## Final steps
There's just a couple of things to do to round this part of the tutorial off. Firstly, you might have noticed there's no place to create a new project at the moment. There's also no place that list "Projects you have joined". We'll add both of those to the front page, in the place we currently have a list of "Your projects". Replace that entire `<section class="content-body">` with the following DRYML:
SHOW_PATCH
Notice how we set the context on the entire section to be the current user (`with="¤t_user"`). That makes the markup inside the section much more compact and easy to read.
---
app/views/front/index.dryml | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/views/front/index.dryml b/app/views/front/index.dryml
index 2ef4f9a..8af97d4 100644
--- a/app/views/front/index.dryml
+++ b/app/views/front/index.dryml
@@ -23,9 +23,14 @@
</section>
</header>
- <section class="content-body" if="&logged_in?">
+ <section with="¤t_user" class="content-body" if="&logged_in?">
<h3>Your Projects</h3>
- <collection:projects with="¤t_user"><card without-creator-link/></collection>
+ <collection:projects><card without-creator-link/></collection>
+
+ <a:projects action="new">New Project</a>
+
+ <h3>Projects you have joined</h3>
+ <collection:joined-projects><card without-creator-link/></collection>
</section>
</content:>