Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
867
Issues
867
List
Boards
Labels
Service Desk
Milestones
Merge Requests
47
Merge Requests
47
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
f5ec17bf
Commit
f5ec17bf
authored
6 hours ago
by
Juan Manuel Solaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(prototype) Subscribe button with counter on nav bar
parent
e601de33
No related merge requests found
Pipeline
#75355969
failed with stages
in 3 minutes and 17 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
0 deletions
+51
-0
channel.component.html
src/app/modules/pro/channel/channel.component.html
+7
-0
channel.component.scss
src/app/modules/pro/channel/channel.component.scss
+12
-0
channel.component.ts
src/app/modules/pro/channel/channel.component.ts
+28
-0
pro-user-menu.component.ts
...ules/pro/channel/pro-user-menu/pro-user-menu.component.ts
+4
-0
No files found.
src/app/modules/pro/channel/channel.component.html
View file @
f5ec17bf
...
...
@@ -64,6 +64,13 @@
routerLinkActive=
"active"
i18n
>
Donate
</a>
<button
class=
"m-btn"
(click)=
"subscribe($event)"
[disabled]=
"channel.subscribed"
>
{{ !channel.subscribed ? 'Subscribe' : 'Subscribed' }}
<span>
{{ channel.subscribers_count | abbr:0 }}
</span>
</button>
</ng-container>
<div
class=
"m-proChannelTopbar_menu m-dropdown"
>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.component.scss
View file @
f5ec17bf
...
...
@@ -135,6 +135,18 @@ m-pro--channel {
}
}
.m-btn
{
padding-left
:
16px
;
color
:
var
(
--
text-color
)
!
important
;
border
:
1px
solid
var
(
--
text-color
)
!
important
;
}
.m-btn
:disabled
{
padding-left
:
16px
;
color
:
gray
!
important
;
border
:
gray
!
important
;
}
}
a
.m-proChannelTopbar__navItem
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.component.ts
View file @
f5ec17bf
...
...
@@ -15,6 +15,7 @@ import { MindsUser, Tag } from "../../../interfaces/entities";
import
{
Client
}
from
"
../../../services/api/client
"
;
import
{
MindsTitle
}
from
'
../../../services/ux/title
'
;
import
{
ProChannelService
}
from
'
./channel.service
'
;
import
{
SignupModalService
}
from
'
../../../modules/modals/signup/service
'
;
@
Component
({
providers
:
[
...
...
@@ -59,6 +60,7 @@ export class ProChannelComponent implements OnInit, OnDestroy {
protected
router
:
Router
,
protected
route
:
ActivatedRoute
,
protected
cd
:
ChangeDetectorRef
,
public
modal
:
SignupModalService
)
{
}
...
...
@@ -147,6 +149,32 @@ export class ProChannelComponent implements OnInit, OnDestroy {
this
.
detectChanges
();
}
subscribe
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
!
this
.
session
.
isLoggedIn
())
{
this
.
router
.
navigate
([
'
/pro
'
,
this
.
channel
.
username
,
'
signup
'
]);
return
false
;
}
this
.
channel
.
subscribed
=
true
;
this
.
client
.
post
(
'
api/v1/subscribe/
'
+
this
.
channel
.
guid
,
{})
.
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
error
)
{
throw
'
error
'
;
}
this
.
channel
.
subscribed
=
true
;
this
.
channel
.
subscribers_count
++
;
})
.
catch
((
e
)
=>
{
this
.
channel
.
subscribed
=
false
;
alert
(
'
You can
\'
t subscribe to this user.
'
);
});
}
bindCssVariables
()
{
const
styles
=
this
.
channel
.
pro_settings
.
styles
;
const
modal
:
HTMLElement
=
document
.
querySelector
(
'
m-app m-overlay-modal
'
);
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/pro-user-menu/pro-user-menu.component.ts
View file @
f5ec17bf
...
...
@@ -11,6 +11,10 @@ import { ProChannelService } from "../channel.service";
export
class
ProUserMenuComponent
implements
OnInit
{
isOpen
:
boolean
=
false
;
@
Input
()
channelName
:
string
;
@
Input
()
showNavItems
:
boolean
;
@
Input
()
query
:
string
;
get
channel
()
{
return
this
.
channelService
.
currentChannel
;
}
...
...
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