-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
38 changed files
with
1,176 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"modules": false, | ||
"targets": { | ||
"browsers": "> 1%", | ||
"uglify": true | ||
}, | ||
"useBuiltIns": true | ||
}] | ||
[ | ||
"env", | ||
{ | ||
"modules": false, | ||
"targets": { | ||
"browsers": "> 1%", | ||
"uglify": true | ||
}, | ||
"useBuiltIns": true | ||
} | ||
], | ||
"react" | ||
], | ||
|
||
"plugins": [ | ||
"syntax-dynamic-import", | ||
"transform-object-rest-spread", | ||
["transform-class-properties", { "spec": true }] | ||
[ | ||
"transform-class-properties", | ||
{ | ||
"spec": true | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class BannersController < ApplicationController | ||
def new | ||
@publisher_id = current_publisher.id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
class Publishers::SiteBannersController < ApplicationController | ||
def new | ||
@site_banner = current_publisher.site_banner || SiteBanner.new | ||
end | ||
|
||
def create | ||
site_banner = current_publisher.site_banner || SiteBanner.new | ||
donation_amounts = JSON.parse(params[:donation_amounts]) | ||
site_banner.update( | ||
publisher_id: current_publisher.id, | ||
title: params[:title], | ||
donation_amounts: donation_amounts, | ||
default_donation: donation_amounts[1], | ||
social_links: params[:social_links], | ||
description: params[:description] | ||
) | ||
head :ok | ||
end | ||
|
||
def update_logo | ||
site_banner = current_publisher.site_banner | ||
update_image(site_banner.logo) | ||
head :ok | ||
end | ||
|
||
def update_background_image | ||
site_banner = current_publisher.site_banner | ||
update_image(site_banner.background_image) | ||
head :ok | ||
end | ||
|
||
private | ||
|
||
def update_image(attachment) | ||
data_url = params[:image].split(',')[0] | ||
if data_url.starts_with?("data:image/jpeg") | ||
content_type = "image/jpeg" | ||
extension = ".jpg" | ||
elsif data_url.starts_with?("data:image/png") | ||
content_type = "image/png" | ||
extension = ".png" | ||
else | ||
# TODO: Throw an exception here | ||
end | ||
filename = Time.now.to_s.gsub!(" ", "_").gsub!(":", "_") + current_publisher.id + "_logo" | ||
|
||
file = Tempfile.new([filename, extension]) | ||
File.open(file.path, 'wb') do |f| | ||
f.write(Base64.decode64(params[:image].split(',')[1])) | ||
end | ||
attachment.attach(io: open(file.path), | ||
filename: filename, | ||
content_type: content_type | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
const locale = { | ||
about: 'about', | ||
addFunds: 'add funds', | ||
allowTip: 'Allow tips on', | ||
braveRewards: 'Brave Rewards', | ||
cancel: 'Cancel', | ||
claim: 'Claim', | ||
copy: 'Copy', | ||
currentDonation: 'You’re currently donating {{currentDonation}} BAT to this site every month.', | ||
detail: 'Detail', | ||
donationAmount: 'Donation amount', | ||
done: 'Done', | ||
earningsAds: 'Earnings from Brave Ads', | ||
expiresOn: 'expires on', | ||
import: 'import', | ||
makeMonthly: 'Make this monthly', | ||
monthApr: 'Apr', | ||
monthAug: 'August', | ||
monthDec: 'December', | ||
monthFeb: 'February', | ||
monthJan: 'January', | ||
monthJul: 'July', | ||
monthJun: 'June', | ||
monthMar: 'March', | ||
monthMay: 'May', | ||
monthNov: 'November', | ||
monthOct: 'October', | ||
monthSep: 'September', | ||
noGrants: 'Currently no token grant is available.', | ||
notEnoughTokens: 'Not enough tokens. Please', | ||
on: 'on', | ||
oneTime: 'One time', | ||
oneTimeDonation: 'One-time Donations/Tips', | ||
print: 'Print', | ||
recoveryKeys: 'Recovery Key', | ||
recurring: 'Recurring', | ||
recurringDonations: 'Recurring Donations', | ||
remove: 'remove', | ||
restore: 'Restore', | ||
rewardsBackupText1: 'Backup your Wallet', | ||
rewardsBackupText2: 'Keep this anonymized recovery key for your Brave wallet in the safe place in case you lose access to this browser. Your funds are safe as long as you keep this recovery key either on a paper or in a device with preferably no internet connection.', | ||
rewardsBannerText1: 'Thanks for stopping by. We joined Brave’s vision of protecting your privacy because we believe that fans like you would support us in our effort to keep the web a clean and safe place to be.', | ||
rewardsBannerText2: 'Your donation is much appreciated and it encourages us to continue to improve our content.', | ||
rewardsContribute: 'Brave Contribute', | ||
rewardsContributeAttention: 'Your attention metric', | ||
rewardsContributeText1: 'You’re currently supporting', | ||
rewardsContributeVisited: 'Site visited', | ||
rewardsOffText1: 'Do you know that you’ve been paying for the web content with your data for the digital ads? You didn’t have a voice in it and worse, you’re exposed to privacy and security risks.', | ||
rewardsOffText2: 'Brave Rewards allows you to take control back.', | ||
rewardsOffText3: 'How does it work?', | ||
rewardsOffText4: 'Your attention is valuable. Get paid for the ads. And pay directly the favorite content creators at your will. That way, they can grow and continue delivering the content that delights you.', | ||
rewardsPanelEmptyText1: 'Sadly, no tokens yet.', | ||
rewardsPanelEmptyText2: '3 ways to fill your wallet:', | ||
rewardsPanelEmptyText3: 'You can add funds.', | ||
rewardsPanelEmptyText4: 'You can earn tokens from Brave Ads.', | ||
rewardsPanelEmptyText5: 'Occasionally, you will also received token grants from Brave. So keep an eye out for the alert!', | ||
rewardsPanelOffText1: 'Get Rewarded for Browsing!', | ||
rewardsPanelOffText2: 'Earn tokens for your attention to ads and pay it forward to support content creators you value!', | ||
rewardsPanelText1: 'Add, withdraw and manage funds at', | ||
rewardsPanelText2: 'Brave wallet is managed by', | ||
rewardsRestoreText1: 'Restore your Wallet', | ||
rewardsRestoreText2: 'Enter the recovery key to restore your Brave wallet. Make sure that the current wallet doesn’t have any balance or is backed up safely. Restoring a wallet replaces the current wallet and you will loose any balance if you don’t back up its recovery key.', | ||
rewardsRestoreText3: 'Enter your recovery key or', | ||
rewardsSummary: 'Rewards Summary', | ||
rewardsWhy: 'Why Brave Rewards…', | ||
saveAsFile: 'Save as File', | ||
seeAllItems: 'See all {{numItems}} items', | ||
seeAllSites: 'See all {{numSites}} sites', | ||
sendDonation: 'Send my donation', | ||
sendTip: 'Send my Tip', | ||
settings: 'Settings', | ||
siteVisited: 'Site visited', | ||
sites: 'sites', | ||
tipOnLike: 'Tip on like', | ||
tokenBalance: 'Token balance', | ||
tokenGrant: 'Token Grant', | ||
tokens: 'tokens', | ||
type: 'Type', | ||
verifiedPublisher: 'Brave Verified Publisher', | ||
walletActivity: 'Wallet Activity/ Monthly Statement', | ||
walletBalance: 'wallet balance', | ||
welcome: 'Welcome!', | ||
yourWallet: 'Your wallet' | ||
}; | ||
|
||
export default locale; |
Oops, something went wrong.