diff --git a/admin/include/functions.php b/admin/include/functions.php
index 331e21a8b..326b53016 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -2734,6 +2734,17 @@ function get_newsletter_subscribe_base_url($language='en_UK')
return PHPWG_URL.'/announcement/subscribe/';
}
+/**
+ * Get url on piwigo.org for old newsletters
+ *
+ * @param string $language (unused)
+ * @return string
+ */
+function get_old_newsletters_base_url($language='en_UK')
+{
+ return PHPWG_URL.'/newsletter';
+}
+
/**
* Return admin menu id for accordion.
*
diff --git a/admin/intro.php b/admin/intro.php
index 4cfcb02b5..c9629a5fe 100644
--- a/admin/intro.php
+++ b/admin/intro.php
@@ -104,6 +104,7 @@ if ($conf['show_newsletter_subscription'] and userprefs_get_param('show_newslett
array(
'EMAIL' => $user['email'],
'SUBSCRIBE_BASE_URL' => get_newsletter_subscribe_base_url($user['language']),
+ 'OLD_NEWSLETTERS_URL' => get_old_newsletters_base_url($user['language']),
)
);
}
diff --git a/admin/themes/default/images/promote-newsletter.png b/admin/themes/default/images/promote-newsletter.png
new file mode 100644
index 000000000..6b37d63e8
Binary files /dev/null and b/admin/themes/default/images/promote-newsletter.png differ
diff --git a/admin/themes/default/template/intro.tpl b/admin/themes/default/template/intro.tpl
index eff014028..59590a606 100644
--- a/admin/themes/default/template/intro.tpl
+++ b/admin/themes/default/template/intro.tpl
@@ -13,6 +13,7 @@ const storage_total = {$STORAGE_TOTAL};
const storage_details = {$STORAGE_CHART_DATA|json_encode};
const translate_files = "{'%d files'|translate|escape:javascript}";
let translate_type = {};
+const newsletter_base_url = "{$SUBSCRIBE_BASE_URL}";
{literal}
jQuery().ready(function(){
jQuery('.cluetip').cluetip({
@@ -42,10 +43,37 @@ jQuery().ready(function(){
}
});
{/if}
+
+{if isset($SUBSCRIBE_BASE_URL)}
+ jQuery(".eiw").prepend(`
+
`);
+
+{/if}
+
{literal}
- jQuery('.newsletter-subscription a').click(function() {
- jQuery('.newsletter-subscription').hide();
+ jQuery("#newsletterSubscribeInput").change(function(){
+ jQuery("#newsletterSubscribeLink").attr("href", newsletter_base_url + jQuery("#newsletterSubscribeInput").val())
+ })
+
+ jQuery('.promote-newsletter a').click(function() {
+ jQuery('.promote-newsletter').hide();
jQuery.ajax({
type: 'GET',
@@ -247,7 +275,4 @@ translate_type['{$type_to_translate}'] = "{$type_to_translate|translate}";
{/if}
-{if isset($SUBSCRIBE_BASE_URL)}
-
{'Subscribe %s to Piwigo Announcements Newsletter'|@translate:$EMAIL} {'... or hide this link'|translate}
-{/if}
\ No newline at end of file
diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css
index 74684c8b4..7882d23ed 100644
--- a/admin/themes/default/theme.css
+++ b/admin/themes/default/theme.css
@@ -7344,7 +7344,7 @@ color:#FF7B00;
color: black !important;
}
-.promote-apps {
+.promote-apps{
display: flex;
flex-direction: column;
justify-content: flex-end;
@@ -7359,6 +7359,71 @@ color:#FF7B00;
box-shadow: 0px 5px 10px 5px rgba(0,0,0,0.1)
}
+.promote-newsletter{
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-end;
+
+ border-radius: 5px;
+ margin: 0 20px 15px 20px;
+
+ background: #f5d8b0;
+ position: relative;
+
+ box-shadow: 0px 5px 10px 5px rgba(0,0,0,0.1)
+}
+
+.promote-newsletter-content{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ flex: 2;
+
+ margin-left: 8.45%;
+ margin-right: 16.32%;
+}
+
+.promote-link {
+ color: #E18C32;
+ font-size: 15px;
+ margin-block: 3.5%;
+ font-weight: 700;
+}
+
+.promote-newsletter-title{
+ font-size: 24px;
+ font-weight: 700;
+ text-align: left;
+ margin-top: 3.5%;
+ margin-bottom: 1.75%;
+ color: #493C21;
+}
+
+.subscribe-newsletter{
+ font-size: 15px;
+ max-height: 17.5%;
+ display: flex;
+ gap: 4.64%;
+ margin-block: 1.75%;
+}
+
+.promote-image{
+ height: auto;
+ width: 25%;
+ object-fit: contain;
+}
+
+#newsletterSubscribeInput{
+ font-weight: 700;
+ background-color: #FFFFFF;
+ color: #000000;
+ padding-inline: 4%;
+ padding-block: 2%;
+ border-radius: 2px;
+ border-width: 2px;
+ border-color: #D3D3D3;
+}
+
.close-apps {
padding: 1px;
margin-left: auto;
@@ -7414,7 +7479,7 @@ color:#FF7B00;
flex-direction: column;
font-size: 30px;
font-weight: 700;
- color: #000;
+ color: #493C21;
justify-content: center;
flex: 2;
}
@@ -7432,11 +7497,11 @@ color:#FF7B00;
.go-to-porg {
cursor: pointer;
padding: 7px 14px;
- font-size: 18px;
+ font-size: 15px;
font-weight: bold;
- background-color: #ffa744;
+ max-width: 41.06%;
+ background-color: #f4ab4f;
color: #3c3c3c;
- width: 150px;
text-align: center;
white-space: nowrap;
}
@@ -7444,6 +7509,9 @@ color:#FF7B00;
.go-to-porg::before {
margin-right: 10px;
}
+.go-to-porg:hover {
+ color: #3c3c3c;
+}
.promote-content .right-side .promote-text {
display: flex;
@@ -7619,6 +7687,40 @@ color:#FF7B00;
}
}
+@media (max-width: 393px) {
+ .promote-content{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ gap: 15%;
+ flex: 2;
+ }
+
+ .promote-newsletter-content {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ flex: 2;
+ margin-inline: 3.8%;
+ }
+
+ .promote-image{
+ height: auto;
+ width: 77%;
+ object-fit: contain;
+ align-self: center;
+ }
+
+ .go-to-porg{
+ max-width: 100%;
+ margin-top: 5%;
+ }
+
+ .promote-link{
+ margin-block: 10%;
+ }
+}
+
/* Css for whats new popin */
#whats_new{
display: none;