Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-wpdesk-rating-petition
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-wpdesk-rating-petition
Commits
96efa149
Commit
96efa149
authored
3 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Patches
Plain Diff
feature(petition): added text petition
parent
07f89ac0
No related branches found
No related tags found
1 merge request
!1
feature(petition): added text petition
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
assets/css/style.css
+43
-0
43 additions, 0 deletions
assets/css/style.css
src/TextPetitionDisplayer.php
+15
-0
15 additions, 0 deletions
src/TextPetitionDisplayer.php
src/views/html-text-petition.php
+3
-43
3 additions, 43 deletions
src/views/html-text-petition.php
with
61 additions
and
43 deletions
assets/css/style.css
0 → 100644
+
43
−
0
View file @
96efa149
.wpdesk-rating-petition
{
font-size
:
15px
;
width
:
100%
;
}
.wpdesk-rating-petition
a
{
text-decoration
:
none
;
color
:
inherit
;
font-weight
:
600
;
}
.wpdesk-rating-petition
span
.plugin-title
{
font-weight
:
600
;
}
.wpdesk-rating-petition
span
.heart
:before
{
speak
:
none
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
color
:
#dc3232
;
font-size
:
16px
;
font-family
:
"dashicons"
;
content
:
"\f487"
;
font-style
:
normal
;
font-variant
:
normal
;
font-weight
:
400
;
text-transform
:
none
;
}
.wpdesk-rating-petition
span
.star
:before
{
speak
:
none
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
color
:
#ffb900
;
font-size
:
16px
;
font-family
:
"dashicons"
;
content
:
"\f155"
;
font-style
:
normal
;
font-variant
:
normal
;
font-weight
:
400
;
text-transform
:
none
;
text-decoration
:
none
;
}
This diff is collapsed.
Click to expand it.
src/TextPetitionDisplayer.php
+
15
−
0
View file @
96efa149
...
...
@@ -10,6 +10,8 @@ use WPDesk\RepositoryRating\DisplayStrategy\DisplayDecision;
*/
class
TextPetitionDisplayer
implements
Hookable
{
const
SCRIPTS_VERSION
=
'2'
;
/**
* @var string
*/
...
...
@@ -38,8 +40,21 @@ class TextPetitionDisplayer implements Hookable {
public
function
hooks
()
{
add_action
(
$this
->
display_on_action
,
[
$this
,
'display_petition_if_should'
]
);
add_action
(
'admin_enqueue_scripts'
,
[
$this
,
'enqueue_css_if_should'
]
);
}
/**
* @internal
*/
public
function
enqueue_css_if_should
()
{
if
(
$this
->
display_decision
->
should_display
()
)
{
wp_enqueue_style
(
'wpdesk-rating-petition'
,
plugin_dir_url
(
__DIR__
.
'/../assets/css'
)
.
'style.css'
,
array
(),
self
::
SCRIPTS_VERSION
);
}
}
/**
* @internal
*/
public
function
display_petition_if_should
()
{
if
(
$this
->
display_decision
->
should_display
()
)
{
echo
wp_kses_post
(
$this
->
petition_text_generator
->
get_petition_text
()
);
...
...
This diff is collapsed.
Click to expand it.
src/views/html-text-petition.php
+
3
−
43
View file @
96efa149
...
...
@@ -5,53 +5,13 @@
* @var string $plugin_title
* @var string $rating_url
*/
?>
<style>
.wpdesk-rating-petition
{
font-size
:
15px
;
text-align
:
<?php
echo
esc_attr
(
$text_align
);
?>
;
width
:
100%
;
}
.wpdesk-rating-petition
a
{
text-decoration
:
none
;
color
:
inherit
;
}
.wpdesk-rating-petition
span
.heart
:before
{
speak
:
none
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
color
:
#dc3232
;
font-size
:
16px
;
font-family
:
"dashicons"
;
content
:
"\f487"
;
font-style
:
normal
;
font-variant
:
normal
;
font-weight
:
400
;
text-transform
:
none
;
}
.wpdesk-rating-petition
span
.star
:before
{
speak
:
none
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
color
:
#ffb900
;
font-size
:
16px
;
font-family
:
"dashicons"
;
content
:
"\f155"
;
font-style
:
normal
;
font-variant
:
normal
;
font-weight
:
400
;
text-transform
:
none
;
text-decoration
:
none
;
}
</style>
<div
class=
"wpdesk-rating-petition"
>
?>
<div
class=
"wpdesk-rating-petition"
style=
"text-align:
<?php
echo
esc_attr
(
$text_align
);
?>
;"
>
<?php
echo
wp_kses_post
(
sprintf
(
__
(
'Created with %1$s by %2$s - If you like %3$s %4$srate us %5$s%6$s'
,
'wp-wpdesk-rating-petition'
),
__
(
'Created with %1$s by %2$s - If you like %3$s %4$srate us %5$s
in plugins repository
%6$s'
,
'wp-wpdesk-rating-petition'
),
'<span class="heart"></span>'
,
$plugin_author
,
$plugin_title
,
'<span class="plugin-title">'
.
$plugin_title
.
'</span>'
,
'<a href="'
.
$rating_url
.
'" target="_blank">'
,
'<span class="star"></span><span class="star"></span><span class="star"></span><span class="star"></span><span class="star"></span>'
,
'</a>'
...
...
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