about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2018-03-23 10:17:18 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2018-03-23 10:17:18 +0000
commit03b2f701e755b2dcc013619d8e234fdec315c418 (patch)
treeab2bb62e747d568e88d4208f2c57f8a67f3a8a1a /app
parent9c3e4bdead953fb67fde32f5ef5db39ed2974362 (diff)
parentecdc5957a34b7f7a7a342c631690802d79d13f37 (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/features/ui/components/columns_area.js4
-rw-r--r--app/javascript/mastodon/locales/oc.json44
-rw-r--r--app/models/account.rb4
-rw-r--r--app/serializers/activitypub/note_serializer.rb2
-rw-r--r--app/serializers/rest/status_serializer.rb2
5 files changed, 29 insertions, 27 deletions
diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js
index e82c46402..05cdb4e3b 100644
--- a/app/javascript/mastodon/features/ui/components/columns_area.js
+++ b/app/javascript/mastodon/features/ui/components/columns_area.js
@@ -28,6 +28,8 @@ const componentMap = {
   'LIST': ListTimeline,
 };
 
+const shouldHideFAB = path => path.match(/^\/statuses\//);
+
 @component => injectIntl(component, { withRef: true })
 export default class ColumnsArea extends ImmutablePureComponent {
 
@@ -153,7 +155,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
     this.pendingIndex = null;
 
     if (singleColumn) {
-      const floatingActionButton = this.context.router.history.location.pathname === '/statuses/new' ? null : <Link key='floating-action-button' to='/statuses/new' className='floating-action-button'><i className='fa fa-pencil' /></Link>;
+      const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : <Link key='floating-action-button' to='/statuses/new' className='floating-action-button'><i className='fa fa-pencil' /></Link>;
 
       return columnIndex !== -1 ? [
         <ReactSwipeableViews key='content' index={columnIndex} onChangeIndex={this.handleSwipe} onTransitionEnd={this.handleAnimationEnd} animateTransitions={shouldAnimate} springConfig={{ duration: '400ms', delay: '0s', easeFunction: 'ease' }} style={{ height: '100%' }}>
diff --git a/app/javascript/mastodon/locales/oc.json b/app/javascript/mastodon/locales/oc.json
index c7a26c1c6..f93fe29f6 100644
--- a/app/javascript/mastodon/locales/oc.json
+++ b/app/javascript/mastodon/locales/oc.json
@@ -1,9 +1,9 @@
 {
   "account.block": "Blocar @{name}",
   "account.block_domain": "Tot amagar del domeni {domain}",
-  "account.blocked": "Blocked",
+  "account.blocked": "Blocat",
   "account.disclaimer_full": "Aquelas informacions de perfil pòdon èsser incomplètas.",
-  "account.domain_blocked": "Domain hidden",
+  "account.domain_blocked": "Domeni amagat",
   "account.edit_profile": "Modificar lo perfil",
   "account.follow": "Sègre",
   "account.followers": "Seguidors",
@@ -15,9 +15,9 @@
   "account.moved_to": "{name} a mudat los catons a :",
   "account.mute": "Rescondre @{name}",
   "account.mute_notifications": "Rescondre las notificacions de @{name}",
-  "account.muted": "Muted",
-  "account.posts": "Estatuts",
-  "account.posts_with_replies": "Toots with replies",
+  "account.muted": "Mes en silenci",
+  "account.posts": "Tuts",
+  "account.posts_with_replies": "Tuts amb responsas",
   "account.report": "Senhalar @{name}",
   "account.requested": "Invitacion mandada. Clicatz per anullar",
   "account.share": "Partejar lo perfil a @{name}",
@@ -60,10 +60,10 @@
   "compose_form.placeholder": "A de qué pensatz ?",
   "compose_form.publish": "Tut",
   "compose_form.publish_loud": "{publish} !",
-  "compose_form.sensitive.marked": "Media is marked as sensitive",
-  "compose_form.sensitive.unmarked": "Media is not marked as sensitive",
-  "compose_form.spoiler.marked": "Text is hidden behind warning",
-  "compose_form.spoiler.unmarked": "Text is not hidden",
+  "compose_form.sensitive.marked": "Lo mèdia es marcat coma sensible",
+  "compose_form.sensitive.unmarked": "Lo mèdia es pas marcat coma sensible",
+  "compose_form.spoiler.marked": "Lo tèxte es rescondut jos l’avertiment",
+  "compose_form.spoiler.unmarked": "Lo tèxte es pas rescondut",
   "compose_form.spoiler_placeholder": "Escrivètz l’avertiment aquí",
   "confirmation_modal.cancel": "Anullar",
   "confirmations.block.confirm": "Blocar",
@@ -207,28 +207,28 @@
   "privacy.unlisted.short": "Pas-listat",
   "regeneration_indicator.label": "Cargament…",
   "regeneration_indicator.sublabel": "Sèm a preparar vòstre flux d’acuèlh !",
-  "relative_time.days": "fa {number}d",
+  "relative_time.days": "fa {number} d",
   "relative_time.hours": "fa {number}h",
   "relative_time.just_now": "ara",
-  "relative_time.minutes": "fa {number}min",
+  "relative_time.minutes": "fa {number} min",
   "relative_time.seconds": "fa {number}s",
   "reply_indicator.cancel": "Anullar",
-  "report.forward": "Forward to {target}",
-  "report.forward_hint": "The account is from another server. Send an anonymized copy of the report there as well?",
-  "report.hint": "The report will be sent to your instance moderators. You can provide an explanation of why you are reporting this account below:",
+  "report.forward": "Far sègre a {target}",
+  "report.forward_hint": "Lo compte ven d’un autre servidor. Volètz mandar una còpia anonima del rapòrt enlai tanben ?",
+  "report.hint": "Lo moderator de l’instància aurà lo rapòrt. Podètz fornir una explicacion de vòstre senhalament aquí dejós :",
   "report.placeholder": "Comentaris addicionals",
   "report.submit": "Mandar",
   "report.target": "Senhalar {target}",
   "search.placeholder": "Recercar",
   "search_popout.search_format": "Format recèrca avançada",
-  "search_popout.tips.full_text": "Simple text returns statuses you have written, favourited, boosted, or have been mentioned in, as well as matching usernames, display names, and hashtags.",
+  "search_popout.tips.full_text": "Un tèxte simple que tòrna los estatuts qu’avètz escriches, mes en favorits, partejats, o ont sètz mencionat, e tanben los noms d’utilizaires, escais-noms e etiquetas que correspondonas.",
   "search_popout.tips.hashtag": "etiqueta",
   "search_popout.tips.status": "estatut",
   "search_popout.tips.text": "Lo tèxt brut tòrna escais, noms d’utilizaire e etiquetas correspondents",
   "search_popout.tips.user": "utilizaire",
-  "search_results.accounts": "People",
-  "search_results.hashtags": "Hashtags",
-  "search_results.statuses": "Toots",
+  "search_results.accounts": "Monde",
+  "search_results.hashtags": "Etiquetas",
+  "search_results.statuses": "Tuts",
   "search_results.total": "{count, number} {count, plural, one {resultat} other {resultats}}",
   "standalone.public_title": "Una ulhada dedins…",
   "status.block": "Blocar @{name}",
@@ -244,7 +244,7 @@
   "status.mute_conversation": "Rescondre la conversacion",
   "status.open": "Desplegar aqueste estatut",
   "status.pin": "Penjar al perfil",
-  "status.pinned": "Pinned toot",
+  "status.pinned": "Tut penjat",
   "status.reblog": "Partejar",
   "status.reblogged_by": "{name} a partejat",
   "status.reply": "Respondre",
@@ -254,9 +254,9 @@
   "status.sensitive_warning": "Contengut sensible",
   "status.share": "Partejar",
   "status.show_less": "Tornar plegar",
-  "status.show_less_all": "Show less for all",
+  "status.show_less_all": "Los tornar plegar totes",
   "status.show_more": "Desplegar",
-  "status.show_more_all": "Show more for all",
+  "status.show_more_all": "Los desplegar totes",
   "status.unmute_conversation": "Tornar mostrar la conversacion",
   "status.unpin": "Tirar del perfil",
   "tabs_bar.federated_timeline": "Flux public global",
@@ -267,7 +267,7 @@
   "upload_area.title": "Lisatz e depausatz per mandar",
   "upload_button.label": "Ajustar un mèdia",
   "upload_form.description": "Descripcion pels mal vesents",
-  "upload_form.focus": "Crop",
+  "upload_form.focus": "Retalhar",
   "upload_form.undo": "Anullar",
   "upload_progress.label": "Mandadís…",
   "video.close": "Tampar la vidèo",
diff --git a/app/models/account.rb b/app/models/account.rb
index 16a256bfc..821f1e64c 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -48,7 +48,7 @@
 
 class Account < ApplicationRecord
   USERNAME_RE = /[a-z0-9_]+([a-z0-9_\.]+[a-z0-9_]+)?/i
-  MENTION_RE  = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE}?)(?:@[a-z0-9\.\-]+[a-z0-9]+)?)/i
+  MENTION_RE  = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[a-z0-9\.\-]+[a-z0-9]+)?)/i
 
   include AccountAvatar
   include AccountFinderConcern
@@ -71,7 +71,7 @@ class Account < ApplicationRecord
   validates :username, uniqueness: { scope: :domain, case_sensitive: true }, if: -> { !local? && will_save_change_to_username? }
 
   # Local user validations
-  validates :username, format: { with: /\A#{USERNAME_RE}\z/i }, length: { maximum: 30 }, if: -> { local? && will_save_change_to_username? }
+  validates :username, format: { with: /\A[a-z0-9_]+\z/i }, length: { maximum: 30 }, if: -> { local? && will_save_change_to_username? }
   validates_with UniqueUsernameValidator, if: -> { local? && will_save_change_to_username? }
   validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? }
   validates :display_name, length: { maximum: 30 }, if: -> { local? && will_save_change_to_display_name? }
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb
index abaf29047..ddafb540d 100644
--- a/app/serializers/activitypub/note_serializer.rb
+++ b/app/serializers/activitypub/note_serializer.rb
@@ -57,7 +57,7 @@ class ActivityPub::NoteSerializer < ActiveModel::Serializer
   end
 
   def virtual_tags
-    object.mentions.order(:id) + object.tags + object.emojis
+    object.mentions.to_a.sort_by(&:id) + object.tags + object.emojis
   end
 
   def atom_uri
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb
index 67da92cd5..fe3dc9bfc 100644
--- a/app/serializers/rest/status_serializer.rb
+++ b/app/serializers/rest/status_serializer.rb
@@ -87,7 +87,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
   end
 
   def ordered_mentions
-    object.mentions.order(:id)
+    object.mentions.to_a.sort_by(&:id)
   end
 
   class ApplicationSerializer < ActiveModel::Serializer