Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
841
Issues
841
List
Boards
Labels
Service Desk
Milestones
Merge Requests
43
Merge Requests
43
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
6b4aef46
Commit
6b4aef46
authored
2 minutes ago
by
Juan Manuel Solaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat) Hot/Top/Latest selector for content
parent
ac29029a
epic/minds-pro
1 merge request
!459
WIP: (feat): Minds Pro
Pipeline
#73998461
running with stages
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
10 deletions
+73
-10
channel.component.html
src/app/modules/pro/channel/channel.component.html
+5
-5
list.component.html
src/app/modules/pro/channel/list/list.component.html
+17
-0
list.component.scss
src/app/modules/pro/channel/list/list.component.scss
+13
-0
list.component.ts
src/app/modules/pro/channel/list/list.component.ts
+35
-2
pro.module.ts
src/app/modules/pro/pro.module.ts
+3
-3
No files found.
src/app/modules/pro/channel/channel.component.html
View file @
6b4aef46
...
...
@@ -24,11 +24,11 @@
</div>
<ng-container
*
ngIf=
"!collapseNavItems"
>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
feed
']"
routerLinkActive=
"active"
i18n
>
Feed
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
videos
']"
routerLinkActive=
"active"
i18n
>
Videos
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
images
']"
routerLinkActive=
"active"
i18n
>
Images
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
articles
']"
routerLinkActive=
"active"
i18n
>
Articles
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
groups
']"
routerLinkActive=
"active"
i18n
>
Groups
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
feed
'
,
'
top
'
]"
routerLinkActive=
"active"
i18n
>
Feed
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
videos
'
,
'
top
'
]"
routerLinkActive=
"active"
i18n
>
Videos
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
images
'
,
'
top
'
]"
routerLinkActive=
"active"
i18n
>
Images
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
articles
'
,
'
top
'
]"
routerLinkActive=
"active"
i18n
>
Articles
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
groups
'
,
'
top
'
]"
routerLinkActive=
"active"
i18n
>
Groups
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
donate
']"
routerLinkActive=
"active"
>
Donate
</a>
<a
[
routerLink
]="['/
pro
',
channel
.
username
,
'
signup
']"
routerLinkActive=
"active"
*
ngIf=
"!currentUser"
>
Signup / Login
</a>
</ng-container>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/list/list.component.html
View file @
6b4aef46
...
...
@@ -7,6 +7,23 @@
<ng-template
ngSwitchDefault
>
{{ type | titlecase }}
</ng-template>
</h1>
<div
class=
"m-proChannelList__algorithm"
>
<a
[
routerLink
]="['/
pro
',
channelService
.
currentChannel
.
username
,
getTypeForRoute
(
type
),
'
hot
']"
routerLinkActive=
"active"
i18n
>
<i
class=
"material-icons"
>
whatshot
</i>
<span
i18n
>
HOT
</span>
</a>
<a
[
routerLink
]="['/
pro
',
channelService
.
currentChannel
.
username
,
getTypeForRoute
(
type
),
'
top
']"
routerLinkActive=
"active"
i18n
>
<i
class=
"material-icons"
>
trending_up
</i>
<span
i18n
>
TOP
</span>
</a>
<a
[
routerLink
]="['/
pro
',
channelService
.
currentChannel
.
username
,
getTypeForRoute
(
type
),
'
latest
']"
routerLinkActive=
"active"
i18n
>
<i
class=
"material-icons"
>
timelapse
</i>
<span
i18n
>
LATEST
</span>
</a>
</div>
<div
class=
"m-proChannelList__content"
>
<ul
class=
"m-proChannelListContent__list"
>
<li
*
ngFor=
"let entity of entities"
>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/list/list.component.scss
View file @
6b4aef46
...
...
@@ -5,6 +5,19 @@ m-pro--channel-list {
margin
:
0
0
0
.4em
;
}
.m-proChannelList__algorithm
{
background-color
:
var
(
--
plain-background-color
)
!
important
;
width
:
fit-content
;
margin-left
:
20px
;
i
{
vertical-align
:
middle
;
margin-right
:
8px
;
font-size
:
18px
;
color
:
#444
!
important
;
}
}
.m-proChannelList__content
{
width
:
85%
;
margin
:
0
auto
;
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/list/list.component.ts
View file @
6b4aef46
import
{
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
}
from
"
@angular/router
"
;
import
{
ActivatedRoute
,
Router
}
from
"
@angular/router
"
;
import
{
Subscription
}
from
"
rxjs
"
;
import
{
FeedsService
}
from
"
../../../../common/services/feeds.service
"
;
import
{
ProChannelService
}
from
'
../channel.service
'
;
...
...
@@ -18,10 +18,13 @@ export class ProChannelListComponent implements OnInit {
entities
:
any
[]
=
[];
algorithm
:
string
;
constructor
(
public
feedsService
:
FeedsService
,
protected
channelService
:
ProChannelService
,
protected
route
:
ActivatedRoute
,
protected
router
:
Router
,
protected
cd
:
ChangeDetectorRef
,
)
{
}
...
...
@@ -53,6 +56,8 @@ export class ProChannelListComponent implements OnInit {
throw
new
Error
(
'
Unknown type
'
);
}
this
.
algorithm
=
params
[
'
algorithm
'
]
||
'
top
'
;
this
.
load
(
true
);
});
...
...
@@ -78,7 +83,7 @@ export class ProChannelListComponent implements OnInit {
try
{
this
.
feedsService
.
setEndpoint
(
`api/v2/feeds/channel/
${
this
.
channelService
.
currentChannel
.
guid
}
/
${
this
.
type
}
`
)
.
setEndpoint
(
`api/v2/feeds/channel/
${
this
.
channelService
.
currentChannel
.
guid
}
/
${
this
.
type
}
/
${
this
.
algorithm
}
`
)
.
setLimit
(
9
)
.
fetch
();
...
...
@@ -99,4 +104,32 @@ export class ProChannelListComponent implements OnInit {
get
seeMoreRoute
()
{
return
[
'
/
'
,
this
.
channelService
.
currentChannel
.
username
];
}
/**
* Returns the feed type on par to routes
* @param type feed type
*/
getTypeForRoute
(
type
:
string
):
string
{
let
routeType
=
''
;
switch
(
type
)
{
case
'
videos
'
:
routeType
=
'
videos
'
;
break
;
case
'
images
'
:
routeType
=
'
images
'
;
break
;
case
'
blogs
'
:
routeType
=
'
articles
'
;
break
;
case
'
groups
'
:
routeType
=
'
groups
'
;
break
;
case
'
activities
'
:
routeType
=
'
feed
'
;
break
;
default
:
throw
new
Error
(
'
Unknown type
'
);
}
return
routeType
;
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/pro/pro.module.ts
View file @
6b4aef46
...
...
@@ -34,7 +34,7 @@ const routes: Routes = [
children
:
[
{
path
:
''
,
redirectTo
:
'
articles
'
,
redirectTo
:
'
articles
/top
'
,
pathMatch
:
'
full
'
},
{
...
...
@@ -46,8 +46,8 @@ const routes: Routes = [
component
:
ProChannelSignupComponent
},
{
path
:
'
:type
'
,
component
:
ProChannelListComponent
path
:
'
:type
/:algorithm
'
,
component
:
ProChannelListComponent
,
},
]
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment