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
0
Issue boards
Milestones
Code
Merge requests
0
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
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
Tags
1.2.0-beta5
1 merge request
!1
feature(petition): added text petition
Changes
3
Hide 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;
...
@@ -10,6 +10,8 @@ use WPDesk\RepositoryRating\DisplayStrategy\DisplayDecision;
*/
*/
class
TextPetitionDisplayer
implements
Hookable
{
class
TextPetitionDisplayer
implements
Hookable
{
const
SCRIPTS_VERSION
=
'2'
;
/**
/**
* @var string
* @var string
*/
*/
...
@@ -38,8 +40,21 @@ class TextPetitionDisplayer implements Hookable {
...
@@ -38,8 +40,21 @@ class TextPetitionDisplayer implements Hookable {
public
function
hooks
()
{
public
function
hooks
()
{
add_action
(
$this
->
display_on_action
,
[
$this
,
'display_petition_if_should'
]
);
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
()
{
public
function
display_petition_if_should
()
{
if
(
$this
->
display_decision
->
should_display
()
)
{
if
(
$this
->
display_decision
->
should_display
()
)
{
echo
wp_kses_post
(
$this
->
petition_text_generator
->
get_petition_text
()
);
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 @@
...
@@ -5,53 +5,13 @@
* @var string $plugin_title
* @var string $plugin_title
* @var string $rating_url
* @var string $rating_url
*/
*/
?>
<style>
?>
<div
class=
"wpdesk-rating-petition"
style=
"text-align:
<?php
echo
esc_attr
(
$text_align
);
?>
;"
>
.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"
>
<?php
echo
wp_kses_post
(
<?php
echo
wp_kses_post
(
sprintf
(
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>'
,
'<span class="heart"></span>'
,
$plugin_author
,
$plugin_author
,
$plugin_title
,
'<span class="plugin-title">'
.
$plugin_title
.
'</span>'
,
'<a href="'
.
$rating_url
.
'" target="_blank">'
,
'<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>'
,
'<span class="star"></span><span class="star"></span><span class="star"></span><span class="star"></span><span class="star"></span>'
,
'</a>'
'</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