Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qpixel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Answers
Qpixel
Commits
5a089b28
Commit
5a089b28
authored
Aug 2, 2020
by
ArtOfCode-
Browse files
Options
Downloads
Patches
Plain Diff
Comment timestamps
parent
0dfac2c3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/assets/javascripts/notifications.js
+18
-4
18 additions, 4 deletions
app/assets/javascripts/notifications.js
with
18 additions
and
4 deletions
app/assets/javascripts/notifications.js
+
18
−
4
View file @
5a089b28
...
@@ -14,16 +14,30 @@ $(() => {
...
@@ -14,16 +14,30 @@ $(() => {
const
unread
=
data
.
filter
(
n
=>
!
n
.
is_read
);
const
unread
=
data
.
filter
(
n
=>
!
n
.
is_read
);
const
read
=
data
.
filter
(
n
=>
n
.
is_read
);
const
read
=
data
.
filter
(
n
=>
n
.
is_read
);
console
.
log
(
read
);
unread
.
forEach
(
notification
=>
{
unread
.
forEach
(
notification
=>
{
const
item
=
$
(
`<div class="widget is-teal h-m-0 h-m-b-2"><div class="widget--body h-p-2"><div class="h-c-tertiary-600 h-fs-caption">
${
notification
.
community_name
}
· <strong>unread</strong></div><a href="
${
notification
.
link
}
" data-id="
${
notification
.
id
}
" class="h-fw-bold is-not-underlined">
${
notification
.
content
}
</a></div></div>`
);
const
item
=
$
(
`<div class="widget is-teal h-m-0 h-m-b-2">
<div class="widget--body h-p-2">
<div class="h-c-tertiary-600 h-fs-caption">
${
notification
.
community_name
}
· <strong>unread</strong> ·
<span data-livestamp="
${
notification
.
created_at
}
">
${
notification
.
created_at
}
</span>
</div>
<a href="
${
notification
.
link
}
" data-id="
${
notification
.
id
}
" class="h-fw-bold is-not-underlined">
${
notification
.
content
}
</a>
</div>
</div>`
);
$inboxContainer
.
append
(
item
);
$inboxContainer
.
append
(
item
);
});
});
$inboxContainer
.
append
(
`<div role="separator" class="header-slide--separator"></div>`
);
$inboxContainer
.
append
(
`<div role="separator" class="header-slide--separator"></div>`
);
read
.
forEach
(
notification
=>
{
read
.
forEach
(
notification
=>
{
const
item
=
$
(
`<div class="widget h-m-0 h-m-b-2"><div class="widget--body h-p-2"><div class="h-c-tertiary-600 h-fs-caption">
${
notification
.
community_name
}
· read</div><a href="
${
notification
.
link
}
" data-id="
${
notification
.
id
}
" class="h-fw-bold is-not-underlined">
${
notification
.
content
}
</a></div></div>"`
);
const
item
=
$
(
`<div class="widget h-m-0 h-m-b-2">
<div class="widget--body h-p-2">
<div class="h-c-tertiary-600 h-fs-caption">
${
notification
.
community_name
}
· read ·
<span data-livestamp="
${
notification
.
created_at
}
">
${
notification
.
created_at
}
</span>
</div>
<a href="
${
notification
.
link
}
" data-id="
${
notification
.
id
}
" class="h-fw-bold is-not-underlined">
${
notification
.
content
}
</a>
</div>
</div>"`
);
$inboxContainer
.
append
(
item
);
$inboxContainer
.
append
(
item
);
});
});
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment