Skip to content

Commit

Permalink
Merge Mastodon v.1.1.1 into the tootcafe branch (#4)
Browse files Browse the repository at this point in the history
* added Esperanto (eo)

* Added Esperanto translation inside the javascripts folder

* add persistance to Postresql container

* add volume for redis container

* add mastodon.cloud to List of instances

* Update List-of-Mastodon-instances.md

* Add niu.moe, cuz it's kawaii

* Added im-in.space

* Fix wrong url in scalingo.json

* Make scalingo doc clearer

* Add social.bytestemplar.com to instances list

* Update Production-guide.md

Corrected spelling error for "install"

* Added digitalhumanities.club instance

* added instance

* Update components.scss

Use nicer scrollbars in MS edge

* Adding masto.raildecake.fr, french instance 🌻🐘

* Add good-dragon.com

* Update description on good-dragon.com

* Add Rich.GOP

* Update List-of-Mastodon-instances.md

* Adds mtndevelopment

* Update List-of-Mastodon-instances.md

* Add mastodon.nuzgo.net

* Description in instance list for mastodon.ninetailed.uk

* Added off-the-clock.us to the list of instances

* Add Northeastern University Mastodon

* Add infinimatix.net to instance list

* Add mastodon.elao.com instance

* Update List-of-Mastodon-instances.md

* Optimize Dockerfile

Optimize Dockerfile, reduce build time.

* Update List-of-Mastodon-instances.md

Add mastodon.land instance

* Added an instance to the list

Just launched https://hackertribe.io/, added it to the list.

* Updates slugignore.

* add my instance

* Add meow.social

* Update List-of-Mastodon-instances.md

* Linux users must enable NFS for Vagrant

* Add an instance.

* Update List-of-Mastodon-instances.md

* Update List-of-Mastodon-instances.md

* Add manx.social instance

* add metadata to Dockerfile

* add Docker microbadger to README.md

* Added pericles.world in the list of instances

* Reduce size of background-photo.jpeg

Reduced by running through `guetzli` image optimizer.

* Add a couple of network performance tweaks to Vagrantfile.

* Added masto.razrnet.fr

* Low-hanging fruit of query optimization, these indices were missing

* Update Production-guide.md

Under ## General dependencies:
apt-get needs sudo and install was typed wrongly.

* updated instance hostname

* Email service options :P

Small addition in case people want email service options, sparkpost.com gives you 100k/mo free

* Rewrite Atom generation from stream entries to use Ox instead of Nokogiri (mastodon#1124)

* Rewrite Atom generation from stream entries to use Ox instead of Nokogiri::Builder

StreamEntry is now limited to only statuses, which allows some optimization. Removed
extra queries on AccountsController#show. AtomSerializer instead of AtomBuilderHelper
used in AccountsController#show, StreamEntriesController#show, StreamEntryRenderer
and PubSubHubbub::DistributionWorker

PubSubHubbub::DistributionWorker moves n+1 DomainBlock query to PubSubHubbub::DeliveryWorker
instead.

All Salmon slaps that aren't based on StreamEntry still use AtomBuilderHelper and Nokogiri

* All Salmon slaps now use Ox instead of Nokogiri. No touch from status on account

* Update List-of-Mastodon-instances.md

* Force UTF8 encoding on generated XML (mastodon#1140)

* Re-add forgotten <author> element on standalone <entry>

* Allow setting of default language through config

Setting of locale in controller extracted to Localized concern,
the doorkeeper authorized applications controller moved under
custom namespace with inclusion of Localized, which resolves the
"it sometimes appears in a different random language" bug

* Update Finnish translations, add sample Minio config (mastodon#954)

* Fix nil#object_type error

* Moved into a comment per feedback

* Update heroku instructions

* Add specs for media attachment validations

There are currently not specs for the two media validations that are performed
by `PostStatusService`. This adds specs for the validations that ensure that you
cannot attach more than four files, and that a status cannot have both image and
video attachments.

* DRY up reblog vs original status check

Checking reblog vs original status was happening in multiple places
across the app. For views, this logic was encapsulated in a helper
method named `proper_status` but in the other layers of the app, the
logic was duplicated.

Because the logic is used at all layers of the app, we extracted it into
a `Status#proper` method on the model and changed all uses of the logic
to use this method. There is now a single source of truth for this
condition.

We added test coverage to untested methods that got refactored.

* Add specs for PostStatusService

This implements all pending specs, and adds additional coverage for the
following functionality:

* Normal status creation
* Creating a reply status
* Creating a sensitive status
* Creating a status with spoiler text
* A status with no spoiler text gets an empty string for spoiler text
* Creating a status with custom visibility
* Creating a status for an application
* Processing mentions
* Processing Hashtags
* Pinging PuSH hubs
* Crawling links
* Attaching media

* Use I18n for media attachment validation errors

These are currently user facing errors, but are not localized. This adds the
ability for these messages to be localized.

* Add mastodon.fun

* change suggested cipher for nginx

* typo

* Implement pending specs on Status

Implement the two pending specs on `Status`: `reblogs_count` and
`favourites_count`.

* Fix npm/yarn cache cleaning

* Adds Oulipo.social to Mastodons list

This is a Mastodon with a particular constraint about
what symbols you can post.

* Add indigo.zone to list of instances

* Update Heroku-guide.md

Removing some of the confusion around what format S3 bucket names and regions should be entered as well as providing an example of an S3 policy that follows best security practices for this sort of thing.

* Update Heroku-guide.md

Cleaning up the heroku admin command bit to match the form used in Administration-guide.md and clarify the wording a bit.

* Update Administration-guide.md

the syntax for running the rake task wasn't correct.

* Add HackerNewsBot

I have created a bot that will post Hacker News stories with 100+ points. Adding it to the list.

* Fix mastodon#801 - Respect webfinger's canonical response of username/domain

* Fix mastodon#1165 - before_action was called before protect_from_forgery

* mastodon#1141 on remote follow

The async action is send before persist, account.id not yet generated

Pull queue receive 'nil' so no profile update.

* fixed a sentence in readme

* Add SVG version of logo to repo

* Close instance list to additions

* Fix my URL

Update my URL since toot.zone was shut down.

* Add reference to Elixir client for Mastodon API

* Use Setting.site_title value for `og:site_name` occurrences (mastodon#1194)

* Add helper method to return Setting.site_title

* Use site_title helper in application layout

* Use site_title value for og:site_name

* Add some missing strings to prevent some React warning in the console (mastodon#1230)

* French translation update (mastodon#1188)

* Update fr.yml

one typo fix

* Update simple_form.fr.yml

one translation consistency

* Updated about page in Finnish language (mastodon#1170)

* update faq with default language

* update translation for about page

* update Minio config

Thanks to @Gargon for helping me. I hope this will help others as well

* update import and export translation

* translate emails to finnish

* add finnish translation for emails

* add finnish translation for emails

* add finnish translation

* add missing dot

* update finnish language to emails

* add finnish translation for emails

* add dot and fix typo

* updated some minor typos

* remove language change due breaking emails

And by dev request

* updated minio config by dev request

* updated about page translation

* Revert "add persistance to Postresql container" (mastodon#1251)

* Add OTP_SECRET to Heroku app.json (mastodon#1246)

* Update mastodon.nuzgo.net (mastodon#1242)

Add ipv6 support

* Update simple_form.de.yml (mastodon#971)

* Fixed two translation errors (mastodon#1139)

Changed followers from Follower to Folger and following from Gefolgt to Folgt, to make it identical with the translation in de.jsx

* Updated German translation (mastodon#1248)

Fixed various spelling and grammar mistakes.
Used more gender-neutral language.

* Update mastodon.brussels instance name on List of Instances

Correct mastodon.brussels.fr to mastodon.brussels

* Add titles to more icons, and change clear notifications icon. (mastodon#1101)

* Update french translation (mastodon#1148)

Add french translation for emails sent

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

Add non-breaking spaces

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

changes and fixes to the nbsps

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

French update

a few fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

* Fix mastodon#1141, fix mastodon#1126 - Avatar/profile info fetching (mastodon#1215)

* Fix mastodon#1141, fix mastodon#1126 - Work through UpdateRemoteProfileService for both <feed> and <entry> top-level tags

* Improve code quality, remove line unrelated to fix

* Add mst3k.interlinked.me to list of instances (mastodon#1235)

* Improve about page responsiveness (mastodon#1252)

* Improve responsiveness of registration form and closed banner (mastodon#1265)

* Fix mastodon#795, fix mastodon#704, fix mastodon#835 - 2FA requires confirmation to be enabled (mastodon#1278)

* Fix mastodon#795, fix mastodon#704, fix mastodon#835 - 2FA requires confirmation to be enabled
TOTP secret is not shown again after 2FA is enabled

* Clean up

* Make public timelines API not require user context/app credentials (mastodon#1291)

* Make /api/v1/timelines/public and /api/v1/timelines/tag/:id public
Fix mastodon#1156 - respect query params when generating pagination links in API

* Apply pagination fix to more APIs

* Adds user confirmation rake task (mastodon#1300)

* Adds task to confirm user by email.

* Adds documentation for manual confirmation.

* Allows setting log level in env variable (mastodon#1290)

* Allows setting log level in env variable.

* Made changes based on feedback in mastodon#1290.

* Add env variable to disable prepared statements (mastodon#1293)

* Fix nonworking clear notices button (mastodon#1316)

* Ignore implied formats for catch all route requests (mastodon#1340)

A request to `/test` would show the custom 404 page, but a request to
`/test.test` would return a 404 with an empty body.

This change ignores the format on incoming catch all route requests, so that the
html 404 page is returned on these requests.

* Search cleanup (mastodon#1333)

* Clean up SQL output in Tag and Account search methods

* Add basic coverage for Tag.search_for

* Add coverage for Account.search_for

* Add coverage for Account.advanced_search_for

* Fixes mastodon#1311 margin shouldn't stay fixed (mastodon#1312)

* Clean up about page (mastodon#1282)

* Add InstancePresenter to expose site details

* Clean up about controller, use instance presenter

* add empty notifications french translation (mastodon#1111)

* French typo (mastodon#1257)

* French typo

* Datetime french translation

* French translation update (mastodon#1271)

* Update confirmation_instructions.fr.html.erb

consistency across the French translation

* Update 

consistency across the French translation

* Update fr.yml

a bunch of consistency across the French translation + a few typos

* Update doorkeeper.fr.yml

consistency across the French translation (punctuation)

* Update fr.jsx (mastodon#1329)

* Update fr.jsx

* Remove duplicate translation

* Helper cleanup (mastodon#1348)

* Remove unused helper files

* Add coverage for application helper

* Add coverage for StreamEntriesHelper #display_name

* Allow users to update their Account in the API (mastodon#1179)

* Allow users to update their Account in the API

It would be nice for API clients to be able to allow users to update
their accounts without having to wrap Mastodon in a web view. This patch
adds an API endpoint to let users submit a PATCH for their account.

Signed-off-by: David Celis <me@davidcel.is>

* Add /api/v1/accounts/update_credentials to the API docs

Signed-off-by: David Celis <me@davidcel.is>

* Add comment to settings.yml to nudge admins towards editing values via Web UI (mastodon#1289)

* Put a useful message for new admins on /about/more

I totally failed to realize this file was just defaults.  I think
this message would be a good default for people like me.

* Revert default site description, expand comment

This will keep setup-related stuff from leaking into public views,
while still hopefully keeping over-eager admins from editing this
file unnecessarily before RTFMing.  (e.g., me)

* Minor change on API.md (mastodon#1352)

* Minor API.md changes (mastodon#1351)

* Use HTTP Accept-Language to detect locale (mastodon#1166)

* Use HTTP Accept-Language to detect locale

* Fix gem order to comply with codeclimate

* Sort gem to comply with rubocop

* I18n.default_locale fallback when there is no accept-language header

* Get handle from atom feed's author/email field instead of guessing from URL (mastodon#1344)

The goal of this change is to enhance Mastodon's handling of remote domains
for which the APIs reside on a different host (see issue mastodon#1032).

Indeed, when a remote user unknown to Mastodon is mentionned, only its profile
URL (e.g. https://social.example.org/users/User) is known, and Mastodon has to
build a @username@domain handle for it. To do so, Mastodon fetches the user's
atom feed (e.g., https://social.example.org/users/User.atom) and uses its
content to get the username part of the handle, and the URL's host part to
build the domain (e.g., @user@social.example.org). This handle is then used
for a Webfinger request.

In the case where example.org serves the Webfinger info for @user@example.org
and all feeds and APIs are hosted at social.example.org, Mastodon will still
build @user@social.example.org and fail at resolving the account's details
through Webfinger.

This patch changes this behaviour by using the author's email address from
the atom feed to build the handle. In Mastodon-generated atom feeds, the
email address is always the handle it expects for federation.

* update portuguese translation (mastodon#1280)

added the missing fields and improved the translation

* Minor change to Entity on API.md (Relationship) (mastodon#1356)

* Fix /api/v1/accounts/update_credentials tests (mastodon#1357)

* Fix mastodon#1339 - better Atom titles (mastodon#1343)

* Do not store last visited URL from API controllers (mastodon#1330)

Sign-in redirects you back to last visited URL, but in case of API requests,
this sometimes redirected users to an API URL that, of course, greeted them
with an {"error":"The access token is invalid"}
  • Loading branch information
nolanlawson authored Apr 11, 2017
1 parent 9d22fde commit 6137355
Show file tree
Hide file tree
Showing 156 changed files with 2,296 additions and 683 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ public/assets
node_modules
storybook
neo4j
vendor/bundle
18 changes: 18 additions & 0 deletions .env.production.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ OTP_SECRET=
# Only allow registrations with the following e-mail domains
# EMAIL_DOMAIN_WHITELIST=example1.com|example2.de|etc

# Optionally change default language
# DEFAULT_LOCALE=de

# E-mail configuration
# Note: Mailgun and SparkPost (https://sparkpo.st/smtp) each have good free tiers
SMTP_SERVER=smtp.mailgun.org
SMTP_PORT=587
SMTP_LOGIN=
Expand All @@ -44,8 +48,22 @@ SMTP_FROM_ADDRESS=notifications@example.com
# S3_PROTOCOL=http
# S3_HOSTNAME=192.168.1.123:9000

# S3 (Minio Config (optional) Please check Minio instance for details)
# S3_ENABLED=true
# S3_BUCKET=
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# S3_REGION=
# S3_PROTOCOL=https
# S3_HOSTNAME=
# S3_ENDPOINT=

# Optional alias for S3 if you want to use Cloudfront or Cloudflare in front
# S3_CLOUDFRONT_HOST=

# Streaming API integration
# STREAMING_API_BASE_URL=

# Advanced settings
# If you need to use pgBouncer, you need to disable prepared statements:
# PREPARED_STATEMENTS=false
3 changes: 3 additions & 0 deletions .slugignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules/
.cache/
docs/
spec/
storybook/
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
FROM ruby:2.3.1-alpine

LABEL maintainer="https://github.com/tootsuite/mastodon" \
description="A GNU Social-compatible microblogging server"

ENV RAILS_ENV=production \
NODE_ENV=production

EXPOSE 3000 4000

WORKDIR /mastodon

COPY . /mastodon
COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/

RUN BUILD_DEPS=" \
postgresql-dev \
Expand All @@ -24,8 +29,11 @@ RUN BUILD_DEPS=" \
&& npm install -g npm@3 && npm install -g yarn \
&& bundle install --deployment --without test development \
&& yarn \
&& npm cache clean \
&& yarn cache clean \
&& npm -g cache clean \
&& apk del $BUILD_DEPS \
&& rm -rf /tmp/* /var/cache/apk/*

COPY . /mastodon

VOLUME /mastodon/public/system /mastodon/public/assets
36 changes: 19 additions & 17 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,38 @@ gem 'paperclip', '~> 5.1'
gem 'paperclip-av-transcoder'
gem 'aws-sdk', '>= 2.0'

gem 'http'
gem 'httplog'
gem 'addressable'
gem 'nokogiri'
gem 'link_header'
gem 'ostatus2'
gem 'goldfinger'
gem 'devise'
gem 'devise-two-factor'
gem 'doorkeeper'
gem 'rabl'
gem 'rqrcode'
gem 'twitter-text'
gem 'oj'
gem 'hiredis'
gem 'redis', '~>3.2', require: ['redis', 'redis/connection/hiredis']
gem 'fast_blank'
gem 'goldfinger'
gem 'hiredis'
gem 'htmlentities'
gem 'simple_form'
gem 'will_paginate'
gem 'http'
gem 'http_accept_language'
gem 'httplog'
gem 'link_header'
gem 'nokogiri'
gem 'oj'
gem 'ostatus2'
gem 'ox'
gem 'rabl'
gem 'rack-attack'
gem 'rack-cors', require: 'rack/cors'
gem 'rack-timeout'
gem 'rails-settings-cached'
gem 'redis', '~>3.2', require: ['redis', 'redis/connection/hiredis']
gem 'rqrcode'
gem 'ruby-oembed', require: 'oembed'
gem 'sidekiq'
gem 'sidekiq-unique-jobs'
gem 'rails-settings-cached'
gem 'simple-navigation'
gem 'simple_form'
gem 'statsd-instrument'
gem 'ruby-oembed', require: 'oembed'
gem 'rack-timeout'
gem 'twitter-text'
gem 'tzinfo-data'
gem 'will_paginate'

gem 'react-rails'
gem 'browserify-rails'
Expand Down
6 changes: 5 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
http-form_data (1.0.1)
http_accept_language (2.1.0)
http_parser.rb (0.6.0)
httplog (0.3.2)
colorize
Expand Down Expand Up @@ -240,6 +241,7 @@ GEM
addressable (~> 2.4)
http (~> 2.0)
nokogiri (~> 1.6)
ox (2.4.11)
paperclip (5.1.0)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -472,6 +474,7 @@ DEPENDENCIES
hiredis
htmlentities
http
http_accept_language
httplog
i18n-tasks (~> 0.9.6)
jquery-rails
Expand All @@ -482,6 +485,7 @@ DEPENDENCIES
nokogiri
oj
ostatus2
ox
paperclip (~> 5.1)
paperclip-av-transcoder
pg
Expand Down Expand Up @@ -520,4 +524,4 @@ RUBY VERSION
ruby 2.3.1p112

BUNDLED WITH
1.14.3
1.14.5
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq -q default -q mailers -q push
worker: bundle exec sidekiq -q default -q push -q pull -q mailers
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Click on the screenshot to watch a demo of the UI:

[youtube_demo]: https://www.youtube.com/watch?v=YO1jQ8_rAMU

Focus of the project on a clean REST API and a good user interface. Ruby on Rails is used for the back-end, while React.js and Redux are used for the dynamic front-end. A static front-end for public resources (profiles and statuses) is also provided.
The project focus is a clean REST API and a good user interface. Ruby on Rails is used for the back-end, while React.js and Redux are used for the dynamic front-end. A static front-end for public resources (profiles and statuses) is also provided.

If you would like, you can [support the development of this project on Patreon][patreon]. Alternatively, you can donate to this BTC address: `17j2g7vpgHhLuXhN4bueZFCvdxxieyRVWd`

Expand Down Expand Up @@ -65,6 +65,8 @@ Consult the example configuration file, `.env.production.sample` for the full li

## Running with Docker and Docker-Compose

[![](https://images.microbadger.com/badges/version/gargron/mastodon.svg)](https://microbadger.com/images/gargron/mastodon "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/gargron/mastodon.svg)](https://microbadger.com/images/gargron/mastodon "Get your own image badge on microbadger.com")

The project now includes a `Dockerfile` and a `docker-compose.yml`. You need to turn `.env.production.sample` into `.env.production` with all the variables set before you can:

docker-compose build
Expand Down
14 changes: 12 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,26 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb|
vb.name = "mastodon"
vb.customize ["modifyvm", :id, "--memory", "1024"]

# Disable VirtualBox DNS proxy to skip long-delay IPv6 resolutions.
# https://github.com/mitchellh/vagrant/issues/1172
vb.customize ["modifyvm", :id, "--natdnsproxy1", "off"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off"]

# Use "virtio" network interfaces for better performance.
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
vb.customize ["modifyvm", :id, "--nictype2", "virtio"]

end

config.vm.hostname = "mastodon.dev"

# This uses the vagrant-hostsupdater plugin, and lets you
# access the development site at http://mastodon.dev.
# To install:
# $ vagrant plugin install hostsupdater
# $ vagrant plugin install vagrant-hostsupdater
if defined?(VagrantPlugins::HostsUpdater)
config.vm.network :private_network, ip: "192.168.42.42"
config.vm.network :private_network, ip: "192.168.42.42", nictype: "virtio"
config.hostsupdater.remove_on_suspend = false
end

Expand Down
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"description": "The secret key base",
"generator": "secret"
},
"OTP_SECRET": {
"description": "One-time password secret",
"generator": "secret"
},
"SINGLE_USER_MODE": {
"description": "Should the instance run in single user mode? (Disable registrations, redirect to front page)",
"value": "false",
Expand Down
Binary file modified app/assets/images/background-photo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/assets/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const ColumnCollapsable = React.createClass({

propTypes: {
icon: React.PropTypes.string.isRequired,
title: React.PropTypes.string,
fullHeight: React.PropTypes.number.isRequired,
children: React.PropTypes.node,
onCollapse: React.PropTypes.func
Expand All @@ -39,13 +40,13 @@ const ColumnCollapsable = React.createClass({
},

render () {
const { icon, fullHeight, children } = this.props;
const { icon, title, fullHeight, children } = this.props;
const { collapsed } = this.state;
const collapsedClassName = collapsed ? 'collapsable-collapsed' : 'collapsable';

return (
<div style={{ position: 'relative' }}>
<div style={{...iconStyle }} className={`column-icon ${collapsedClassName}`} onClick={this.handleToggleCollapsed}><i className={`fa fa-${icon}`} /></div>
<div title={`${title}`} style={{...iconStyle }} className={`column-icon ${collapsedClassName}`} onClick={this.handleToggleCollapsed}><i className={`fa fa-${icon}`} /></div>

<Motion defaultStyle={{ opacity: 0, height: 0 }} style={{ opacity: spring(collapsed ? 0 : 100), height: spring(collapsed ? 0 : fullHeight, collapsed ? undefined : { stiffness: 150, damping: 9 }) }}>
{({ opacity, height }) =>
Expand Down
3 changes: 2 additions & 1 deletion app/assets/javascripts/components/containers/mastodon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import pt from 'react-intl/locale-data/pt';
import hu from 'react-intl/locale-data/hu';
import uk from 'react-intl/locale-data/uk';
import fi from 'react-intl/locale-data/fi';
import eo from 'react-intl/locale-data/eo';
import getMessagesForLocale from '../locales';
import { hydrateStore } from '../actions/store';
import createStream from '../stream';
Expand All @@ -59,7 +60,7 @@ const browserHistory = useRouterHistory(createBrowserHistory)({
basename: '/web'
});

addLocaleData([...en, ...de, ...es, ...fr, ...pt, ...hu, ...uk, ...fi]);
addLocaleData([...en, ...de, ...es, ...fr, ...pt, ...hu, ...uk, ...fi, ...eo]);

const Mastodon = React.createClass({

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import SettingToggle from '../../notifications/components/setting_toggle';
import SettingText from './setting_text';

const messages = defineMessages({
filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' }
filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },
settings: { id: 'home.settings', defaultMessage: 'Column settings' }
});

const outerStyle = {
Expand Down Expand Up @@ -39,7 +40,7 @@ const ColumnSettings = React.createClass({
const { settings, onChange, onSave, intl } = this.props;

return (
<ColumnCollapsable icon='sliders' fullHeight={209} onCollapse={onSave}>
<ColumnCollapsable icon='sliders' title={intl.formatMessage(messages.settings)} fullHeight={209} onCollapse={onSave}>
<div className='column-settings--outer' style={outerStyle}>
<span className='column-settings--section' style={sectionStyle}><FormattedMessage id='home.column_settings.basic' defaultMessage='Basic' /></span>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import { defineMessages, injectIntl } from 'react-intl';

const messages = defineMessages({
clear: { id: 'notifications.clear', defaultMessage: 'Clear notifications' }
});

const iconStyle = {
fontSize: '16px',
padding: '15px',
Expand All @@ -8,14 +14,22 @@ const iconStyle = {
zIndex: '2'
};

const ClearColumnButton = ({ onClick }) => (
<div className='column-icon' tabindex='0' style={iconStyle} onClick={onClick}>
<i className='fa fa-trash' />
</div>
);
const ClearColumnButton = React.createClass({

ClearColumnButton.propTypes = {
onClick: React.PropTypes.func.isRequired
};
propTypes: {
onClick: React.PropTypes.func.isRequired,
intl: React.PropTypes.object.isRequired
},

render () {
const { intl } = this.props;

return (
<div title={intl.formatMessage(messages.clear)} className='column-icon' tabIndex='0' style={iconStyle} onClick={this.props.onClick}>
<i className='fa fa-eraser' />
</div>
);
}
})

export default ClearColumnButton;
export default injectIntl(ClearColumnButton);
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import PureRenderMixin from 'react-addons-pure-render-mixin';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ColumnCollapsable from '../../../components/column_collapsable';
import SettingToggle from './setting_toggle';

const messages = defineMessages({
settings: { id: 'notifications.settings', defaultMessage: 'Column settings' }
});

const outerStyle = {
padding: '15px'
};
Expand All @@ -30,14 +34,14 @@ const ColumnSettings = React.createClass({
mixins: [PureRenderMixin],

render () {
const { settings, onChange, onSave } = this.props;
const { settings, intl, onChange, onSave } = this.props;

const alertStr = <FormattedMessage id='notifications.column_settings.alert' defaultMessage='Desktop notifications' />;
const showStr = <FormattedMessage id='notifications.column_settings.show' defaultMessage='Show in column' />;
const soundStr = <FormattedMessage id='notifications.column_settings.sound' defaultMessage='Play sound' />;

return (
<ColumnCollapsable icon='sliders' fullHeight={616} onCollapse={onSave}>
<ColumnCollapsable icon='sliders' title={intl.formatMessage(messages.settings)} fullHeight={616} onCollapse={onSave}>
<div className='column-settings--outer' style={outerStyle}>
<span className='column-settings--section' style={sectionStyle}><FormattedMessage id='notifications.column_settings.follow' defaultMessage='New followers:' /></span>

Expand Down Expand Up @@ -77,4 +81,4 @@ const ColumnSettings = React.createClass({

});

export default ColumnSettings;
export default injectIntl(ColumnSettings);
Loading

0 comments on commit 6137355

Please sign in to comment.