Skip to content

Commit

Permalink
Merge pull request #225 from dof-dss/development
Browse files Browse the repository at this point in the history
Merge dev to main for release
  • Loading branch information
neilblair authored Jul 20, 2022
2 parents 0baa76c + 9d409cb commit 2a847d6
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
title:
body:
url:
link_url:
link_text:
styles:
published: false
modified: ''
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function origins_shamrock_admin_theme() {
'variables' => [
'title' => NULL,
'body' => NULL,
'url' => NULL,
'link_url' => NULL,
'link_text' => NULL,
'styles' => NULL,
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public function index() {
'#theme' => 'origins_shamrock_banner',
'#title' => $config->get('title'),
'#body' => $config->get('body'),
'#url' => $config->get('url'),
'#link_url' => $config->get('link_url'),
'#link_text' => $config->get('link_text'),
];

$response->setContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,41 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#type' => 'textfield',
'#title' => $this->t('The body text of the banner'),
'#description' => $this->t('Generates the body text for the banner.'),
'#maxlength' => 64,
'#maxlength' => 255,
'#default_value' => $config->get('body'),
'#size' => 64,
'#weight' => '2',
];
$form['shamrock']['url'] = [
$form['shamrock']['link_url'] = [
'#type' => 'textfield',
'#title' => $this->t('Banner URL'),
'#description' => $this->t('Enter the url which the banner should point to.'),
'#maxlength' => 64,
'#default_value' => $config->get('url'),
'#title' => $this->t('Banner link URL'),
'#description' => $this->t('Enter the url the banner should link to.'),
'#maxlength' => 255,
'#default_value' => $config->get('link_url'),
'#size' => 64,
'#weight' => '3',
];
$form['shamrock']['link_text'] = [
'#type' => 'textfield',
'#title' => $this->t('Banner link text'),
'#description' => $this->t('Enter the link text for the banner link.'),
'#maxlength' => 255,
'#default_value' => $config->get('link_text'),
'#size' => 64,
'#weight' => '4',
];
$form['shamrock']['styles'] = [
'#type' => 'textarea',
'#title' => $this->t('CSS styles'),
'#default_value' => $config->get('styles'),
'#weight' => '4',
'#weight' => '5',
];

$form['published'] = [
'#type' => 'checkbox',
'#title' => $this->t('Publish the banner.'),
'#default_value' => $config->get('published'),
'#weight' => '5',
'#weight' => '6',
];
$form['submit'] = [
'#type' => 'submit',
Expand All @@ -98,7 +107,8 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$this->configFactory->getEditable(static::SETTINGS)
->set('title', $form_state->getValue('title'))
->set('body', $form_state->getValue('body'))
->set('url', $form_state->getValue('url'))
->set('link_url', $form_state->getValue('link_url'))
->set('link_text', $form_state->getValue('link_text'))
->set('styles', $form_state->getValue('styles'))
->set('published', (bool) $form_state->getValue('published'))
->set('modified', time())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.setAttribute('aria-live', 'polite')
.setAttribute('aria-atomic', 'region') %}
<div{{ attributes }}>
<a class="opsh-banner__content" href="{{ url }}">
<a class="opsh-banner__content" href="{{ link_url }}">
<h1 class="opsh-banner__title">
{{ title }}
</h1>
Expand All @@ -14,7 +14,7 @@
</p>
<p>
<span class="opsh-banner__faux-link" }}>
{{ 'Read about the arrangements following The Queen\'s death'|t }}
{{ link_text }}
</span>
</p>
</a>
Expand Down
4 changes: 2 additions & 2 deletions origins_toc/origins_toc.module
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ function origins_toc_form_node_type_form_alter(&$form, FormStateInterface $form_
'3' => '3 screens',
'4' => '4 screens',
'5' => '5 screens',
'6' => '6 screen',
'7' => '7 screen',
'6' => '6 screens',
'7' => '7 screens',
'8' => '8 screens',
'9' => '9 screens',
'10' => '10 screens',
Expand Down
32 changes: 26 additions & 6 deletions origins_translations/css/translations_ui.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
input[type=submit].origins-translation-button {
background-image: none !important;
background: none !important;
border: none !important;
box-shadow: none !important;
font-weight: normal !important;
.block-origins-translations-block {
background: #4478b8;
margin-right: 288px;
max-width: 1024px;
padding: 0;
margin: auto !important;
}

.block-origins-translations-block h2 {
color: #fff;
background: #4478b8;
border: none;
font-weight: normal;
text-decoration: underline;
text-decoration-thickness: 1px;
font-family: inherit;
font-size: inherit;
-moz-osx-font-smoothing: grayscale;
padding: .5em 20px;
margin-bottom: auto;
}


#edit-translations-button {
display: none;
}

0 comments on commit 2a847d6

Please sign in to comment.