Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
condenser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
condenser
Commits
c2a719e2
Commit
c2a719e2
authored
8 years ago
by
Daniel Larimer
Browse files
Options
Downloads
Patches
Plain Diff
adding support for promoted content
parent
51139d15
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/ResolveRoute.js
+2
-2
2 additions, 2 deletions
app/ResolveRoute.js
app/components/modules/Header.jsx
+1
-1
1 addition, 1 deletion
app/components/modules/Header.jsx
app/redux/FetchDataSaga.js
+7
-0
7 additions, 0 deletions
app/redux/FetchDataSaga.js
with
10 additions
and
3 deletions
app/ResolveRoute.js
+
2
−
2
View file @
c2a719e2
...
@@ -59,8 +59,8 @@ export default function resolveRoute(path)
...
@@ -59,8 +59,8 @@ export default function resolveRoute(path)
if
(
match
)
{
if
(
match
)
{
return
{
page
:
'
Post
'
,
params
:
match
.
slice
(
1
)};
return
{
page
:
'
Post
'
,
params
:
match
.
slice
(
1
)};
}
}
match
=
path
.
match
(
/^
\/(
best|updated|hot|votes|responses|trending|trending30|cashout|created|recent|active
)\/?
$/
)
match
=
path
.
match
(
/^
\/(
best|updated|hot|votes|responses|trending|trending30|
promoted|
cashout|created|recent|active
)\/?
$/
)
||
path
.
match
(
/^
\/(
best|updated|hot|votes|responses|trending|trending30|cashout|created|recent|active
)\/([\w\d
-
]
+
)\/?
$/
);
||
path
.
match
(
/^
\/(
best|updated|hot|votes|responses|trending|trending30|
promoted|
cashout|created|recent|active
)\/([\w\d
-
]
+
)\/?
$/
);
if
(
match
)
{
if
(
match
)
{
return
{
page
:
'
PostsIndex
'
,
params
:
match
.
slice
(
1
)};
return
{
page
:
'
PostsIndex
'
,
params
:
match
.
slice
(
1
)};
}
}
...
...
This diff is collapsed.
Click to expand it.
app/components/modules/Header.jsx
+
1
−
1
View file @
c2a719e2
...
@@ -58,13 +58,13 @@ class Header extends React.Component {
...
@@ -58,13 +58,13 @@ class Header extends React.Component {
let
topic_link
=
topic
?
<
Link
to
=
{
`/
${
this
.
last_sort_order
||
'
trending
'
}
/
${
topic
}
`
}
>
{
topic
}
</
Link
>
:
null
;
let
topic_link
=
topic
?
<
Link
to
=
{
`/
${
this
.
last_sort_order
||
'
trending
'
}
/
${
topic
}
`
}
>
{
topic
}
</
Link
>
:
null
;
const
sort_orders
=
{
const
sort_orders
=
{
promoted
:
'
promoted
'
,
hot
:
'
hot
'
,
hot
:
'
hot
'
,
trending
:
'
trending
'
,
trending
:
'
trending
'
,
trending30
:
'
trending (30 day)
'
,
trending30
:
'
trending (30 day)
'
,
cashout
:
'
payout time
'
,
cashout
:
'
payout time
'
,
created
:
'
new
'
,
created
:
'
new
'
,
active
:
'
active
'
,
active
:
'
active
'
,
responses
:
'
responses
'
,
votes
:
'
popular
'
};
votes
:
'
popular
'
};
const
sort_order_menu
=
Object
.
keys
(
sort_orders
).
filter
(
so
=>
so
!==
sort_order
).
map
(
so
=>
({
link
:
`/
${
so
}
/
${
topic
}
`
,
value
:
sort_orders
[
so
]}));
const
sort_order_menu
=
Object
.
keys
(
sort_orders
).
filter
(
so
=>
so
!==
sort_order
).
map
(
so
=>
({
link
:
`/
${
so
}
/
${
topic
}
`
,
value
:
sort_orders
[
so
]}));
...
...
This diff is collapsed.
Click to expand it.
app/redux/FetchDataSaga.js
+
7
−
0
View file @
c2a719e2
...
@@ -76,6 +76,13 @@ export function* fetchData(action) {
...
@@ -76,6 +76,13 @@ export function* fetchData(action) {
limit
:
constants
.
FETCH_DATA_BATCH_SIZE
,
limit
:
constants
.
FETCH_DATA_BATCH_SIZE
,
start_author
:
author
,
start_author
:
author
,
start_permlink
:
permlink
}];
start_permlink
:
permlink
}];
}
else
if
(
order
===
'
promoted
'
)
{
call_name
=
'
get_discussions_by_promoted
'
;
args
=
[
{
tag
:
category
,
limit
:
constants
.
FETCH_DATA_BATCH_SIZE
,
start_author
:
author
,
start_permlink
:
permlink
}];
}
else
if
(
order
===
'
active
'
)
{
}
else
if
(
order
===
'
active
'
)
{
call_name
=
'
get_discussions_by_active
'
;
call_name
=
'
get_discussions_by_active
'
;
args
=
[
args
=
[
...
...
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
register
or
sign in
to comment