Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Revert "Revert "Release""
Browse files Browse the repository at this point in the history
  • Loading branch information
yeseniamolinab committed Mar 4, 2022
1 parent 4ee7477 commit 3440289
Show file tree
Hide file tree
Showing 16 changed files with 149 additions and 14 deletions.
7 changes: 7 additions & 0 deletions app/assets/stylesheets/member-facing/form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ label.checkbox-label {
}
}

html[dir=rtl] .sweet-placeholder {
&__label {
left: unset;
right: 20px;
}
}

.sweet-placeholder {
display: inline-block;
position: relative;
Expand Down
9 changes: 9 additions & 0 deletions app/assets/stylesheets/member-facing/petition.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
$mobile-width: 700px;

html[dir=rtl] .petition-bar,
html[dir=rtl] .fundraiser-bar,
html[dir=rtl] .action-form {
&__welcome-name {
padding-right: 10px;
padding-left: unset;
}
}

.petition-bar,
.fundraiser-bar,
.action-form {
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/member-facing/thermometer.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
html[dir=rtl] div.thermometer {
&__mercury {
float: right;
}
}

.thermometer {
$graphic-height: 10px;
$graphic-border-radius: 15px;
Expand Down
24 changes: 24 additions & 0 deletions app/javascript/components/Braintree/Braintree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,30 @@
margin-right: 3px;
}

html[dir=rtl] div.BraintreeCardFields__expiration-date {
margin-right: 3px;
margin-left: unset;
}

html[dir=rtl] div.BraintreeCardFields__cvv {
margin-left: 3px;
margin-right: unset;
}

html[dir=rtl] span.BraintreeCardFields__card-type {
left: 13px;
right: unset;
}

html[dir=rtl] div.BraintreeCardFields__error-msg {
text-align: left;

&--col-left,
&--col-right {
float: left;
}
}

.BraintreeCardFields__expiration-date {
flex-grow: 1;
margin-left: 3px;
Expand Down
4 changes: 4 additions & 0 deletions app/javascript/components/Braintree/BraintreeCardFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ee from '../../shared/pub_sub';
class BraintreeCardFields extends Component {
constructor(props) {
super(props);
const lang = window.champaign.page.language_code;
this.state = {
hostedFields: null,
errors: {
Expand All @@ -20,6 +21,9 @@ class BraintreeCardFields extends Component {
input: {
color: '#333',
'font-size': '16px',
...(lang === 'ar' && {
'text-align': 'right',
}),
},
':focus': { color: '#333' },
'.valid': { color: '#333' },
Expand Down
6 changes: 5 additions & 1 deletion app/javascript/components/Stepper/Step.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* */
import React, { Component } from 'react';
import classnames from 'classnames';
import { FormattedMessage } from 'react-intl';
import './Step.scss';

export default class Step extends Component {
Expand All @@ -15,7 +16,10 @@ export default class Step extends Component {
return (
<div className={rootClasses} onClick={this.props.onClick}>
<div className="Step__circle">
<span>{index + 1}</span>
<FormattedMessage
id={`fundraiser.donation_steps.number${index + 1}`}
defaultMessage={index + 1}
/>
</div>
<div className="Step__label">{label}</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/views/api/pages/show.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ json.extract!(
)

json.template_name @page.liquid_layout.title
json.follow_up_template @page.follow_up_liquid_layout

share_buttons = @page.share_buttons.to_a.map do |share|
share = share.attributes
Expand Down Expand Up @@ -60,7 +61,7 @@ json.language @page.language.code
petition = @page.plugins.select { |p| p.class.name == 'Plugins::Petition' }.first
fundraiser = @page.plugins.select { |p| p.class.name == 'Plugins::Fundraiser' }.first

json.petition do
json.petition do
if petition
if petition.form
json.form petition.form.form_elements.order(:position)
Expand All @@ -73,7 +74,7 @@ json.petition do
end
end

json.fundraiser do
json.fundraiser do
if fundraiser
liquid_data = fundraiser.liquid_data
if fundraiser.form
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/member_facing.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
doctype html
html lang="#{@page.language.try(:code).try(:downcase)}"
html lang="#{@page.language.try(:code).try(:downcase)}" dir=("#{@page.language.try(:code).try(:downcase)}" == 'ar' ? 'rtl' : 'ltr')
head
title = @page.title
meta http-equiv="X-UA-Compatible" content="IE=edge;"
Expand Down
4 changes: 4 additions & 0 deletions config/locales/member_facing.ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ ar:
payment: الدفع
donate: "التبرّع بمبلغ%{amount}" # used on the submit button, eg 'Donate $15'
donate_monthly: "التبرّع بمبلغ%{amount} كلّ شهر"
donation_steps:
number1: "١"
number2: "٢"
number3: "٣"

make_monthly_donation: "%{name} تبرّعك {duration} سيوفّر دعماً لحركتنا ويتيح لنا التخطيط للمستقبل، بحيث نتّخذ خطواتٍ أكثر فاعليّةً لوقف الشركات الكبرى التي تهدّدنا وتهدّد كوكبنا. "
complete_donation: "استكمال تبرّعك بمبلغ%{amount}"
Expand Down
1 change: 1 addition & 0 deletions spec/requests/api/pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def json
sources
meta_description
template_name
follow_up_template
]
expect(subject.keys).to match_array(expected)
expect(subject.symbolize_keys).to include(title: 'Foo',
Expand Down
6 changes: 6 additions & 0 deletions vendor/theme/stylesheets/components/logo.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
html[dir=rtl] .sumofus-logo {
&--tagline {
margin-right: 15px;
}
}

.sumofus-logo {
&--negative {
background-image: url(asset-path('sumofus-logo-horizontal.svg'));
Expand Down
15 changes: 8 additions & 7 deletions vendor/theme/stylesheets/components/petition.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@
overflow: hidden;
&::after {
display: none;
// width: 15%;
// height: 100%;
// position: absolute;
// right: 0;
// top: 0;
// background: $dark-teal;
// content: "";
}
}
&__title {
Expand Down Expand Up @@ -160,6 +153,14 @@
}
}

html[dir=rtl] div.petition-bar {
&__title-bar {
&::after {
left: 0;
}
}
}

.petition-bar {
&__top {
padding: 0;
Expand Down
4 changes: 4 additions & 0 deletions vendor/theme/stylesheets/components/photos.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
}
}

html[dir=rtl] div.mobile-title, html[dir=rtl] div.header-logo__tagline, html[dir=rtl] div.header-logo__logo {
float: right;
}

.cover-photo--small, .header-logo__left-constraint, .mobile-title {
width: 65%;
&.header-logo__left-constraint {
Expand Down
8 changes: 8 additions & 0 deletions vendor/theme/stylesheets/global/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ html {
}

}

html[dir=rtl] div.center-content {
&__fixed-right {
left: 0;
right: unset;
}
}

.center-content--share-and-donate {
margin-top: 100px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@
<b>Doe een maandelijkse donatie en sluit je vandaag nog aan bij onze geweldige 38.652 kernleden:</b>
</p>
</div>
<div class="ar-copy">
<p>
<b><span class="thank-you-firstname">Thank you </span>for helping build a world where people come before corporate profit.</b>
</p>
<p>
There's still lots of work to do. <b>Would you consider becoming a SumOfUs core member to help us get there faster?</b> A monthly donation will support our movement to plan ahead, so we can take on the biggest corporations that threaten people and planet.
</p>
<p>
<b>Make a monthly donation and join our amazing 38,652 core members today:</b>
</p>
</div>


<div class="fundraiser-bar__step-panel script-dependent">
Expand Down Expand Up @@ -143,7 +154,7 @@
.center-content__one-column{
max-width: 100% !important;
}
.fr-copy, .de-copy, .es-copy, .pt-copy{
.fr-copy, .de-copy, .es-copy, .pt-copy, .nl-copy, .ar-copy {
display:none;
}
Expand Down Expand Up @@ -654,6 +665,7 @@ function handleLanguages(){
$('.pt-copy').hide();
$('.de-copy').hide();
$('.nl-copy').hide();
$('.ar-copy').hide();
$('.fundraiser-bar__amount-button').addClass('long-button');
Expand All @@ -677,7 +689,8 @@ function handleLanguages(){
$('.en-copy').hide();
$('.es-copy').hide();
$('.pt-copy').hide();
$('.nl-copy').hide();
$('.nl-copy').hide();
$('.ar-copy').hide();
$('.fundraiser-bar__amount-button').addClass('long-button');
$('.fundraiser-bar__amount-buttons').addClass('long-button-container');
Expand All @@ -701,6 +714,7 @@ function handleLanguages(){
$('.en-copy').hide();
$('.pt-copy').hide();
$('.nl-copy').hide();
$('.ar-copy').hide();
$('.fundraiser-bar__amount-button').addClass('long-button');
$('.fundraiser-bar__amount-buttons').addClass('long-button-container');
Expand All @@ -725,6 +739,7 @@ function handleLanguages(){
$('.fr-copy').hide();
$('.en-copy').hide();
$('.nl-copy').hide();
$('.ar-copy').hide();
$('.fundraiser-bar__amount-button').addClass('long-button');
$('.fundraiser-bar__amount-buttons').addClass('long-button-container');
Expand All @@ -747,12 +762,37 @@ function handleLanguages(){
$('.fr-copy').hide();
$('.en-copy').hide();
$('.es-copy').hide();
$('.pt-copy').hide();
$('.ar-copy').hide();
$('.fundraiser-bar__amount-button').addClass('long-button');
$('.fundraiser-bar__amount-buttons').addClass('long-button-container');
break;
case 'ar':
postDonatePage = "https://actions.sumofus.org/a/donate"; //TODO: Change for real link
preButtonLanguage = "التبرّع بمبلغ ";
postButtonLanguage = " شهرياً";
thankyou = "ما أروعك!";
secondFirstname = "";
if(name){
thankyou = name+", ما أروعك!";
secondFirstname = "";
}
$('.ar-copy').show();
$('.nl-copy').hide();
$('.de-copy').hide();
$('.fr-copy').hide();
$('.en-copy').hide();
$('.es-copy').hide();
$('.pt-copy').hide();
$('.fundraiser-bar__amount-button').addClass('long-button');
$('.fundraiser-bar__amount-buttons').addClass('long-button-container');
break;
default:
default:
postButtonLanguage = "/month";
thankyou = "You're awesome!";
Expand Down
16 changes: 16 additions & 0 deletions vendor/theme/templates/partials/_progress_tracker.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@
border-color: green;
}
html[dir=rtl] div.progress-tracker__circle--tick::before {
right: 0.25em;
left: unset;
}
.progress-tracker__circle--tick::before {
content: "";
display: block;
Expand All @@ -121,6 +126,12 @@
border-color: red;
}
html[dir=rtl] div.progress-tracker__circle--cross::before,
html[dir=rtl] div.progress-tracker__circle--cross::after {
right: calc(50% - 0.4em);
left: unset;
}
.progress-tracker__circle--cross::before {
content: "";
display: block;
Expand Down Expand Up @@ -149,6 +160,11 @@
top: calc(50% - 1px);
}
html[dir=rtl] span.progress-tracker__label {
margin-right: 0.4em;
margin-left: unset;
}
.progress-tracker__label {
color: #fff;
margin-left: 0.4em;
Expand Down

0 comments on commit 3440289

Please sign in to comment.