diff --git a/app/Activity.php b/app/Activity.php new file mode 100644 index 000000000..e4b8b9f97 --- /dev/null +++ b/app/Activity.php @@ -0,0 +1,10 @@ +context = $context; + return $this; + } + + public function setActor($profile) + { + $this->actor = $profile; + return $this; + } + + public function setActorActivity($activity) + { + $this->activity = $activity; + $this->setPublishedAt($activity->created_at->format('Y-m-d\Th:i:s\Z')); + return $this; + } + + public function setTo($audience) + { + $this->to = $audience; + return $this; + } + + public function setCc($audience) + { + $this->cc = $audience; + return $this; + } + + public function setBcc($audience) + { + $this->bcc = $audience; + return $this; + } + + public function setPublishedAt($timestamp) + { + $this->publishedAt = $timestamp; + return $this; + } + + public function audience($audience) + { + $this->setAudience($audience); + $this->buildAudience(); + return $this; + } + + public function setAudience($audience) + { + if(in_array($audience, $this->audience)) { + $this->audience = $audience; + } + return $this; + } + + public function buildAudience() + { + switch ($this->audience) { + case 'public': + $this->to = [ + $this->context . '#Public' + ]; + $this->cc = [ + $this->actor->permalink('/followers') + ]; + break; + + case 'unlisted': + $this->to = [ + $this->actor->permalink('/followers') + ]; + $this->cc = [ + $this->context . '#Public' + ]; + break; + + case 'private': + $this->to = [ + $this->actor->permalink('/followers') + ]; + break; + + default: + # code... + break; + } + return $this; + } + + public function get() + { + return $this->getJson(); + } + + public function getJson() + { + return json_encode($this->response); + } + + public function getArray() + { + return $this->response; + } +} \ No newline at end of file diff --git a/database/migrations/2018_09_11_202435_create_activities_table.php b/database/migrations/2018_09_11_202435_create_activities_table.php new file mode 100644 index 000000000..378393356 --- /dev/null +++ b/database/migrations/2018_09_11_202435_create_activities_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->bigInteger('to_id')->unsigned()->nullable(); + $table->bigInteger('from_id')->unsigned()->nullable(); + $table->string('object_type')->nullable(); + $table->json('data')->nullable(); + $table->timestamp('processed_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('activities'); + } +} diff --git a/resources/lang/ar/auth.php b/resources/lang/ar/auth.php new file mode 100644 index 000000000..d27bd4d9f --- /dev/null +++ b/resources/lang/ar/auth.php @@ -0,0 +1,19 @@ + 'لم نعثر على هذه المعطيات في سجلاتنا.', + 'throttle' => 'لقد قمت بعدة محاولات. يُرجى إعادة المحاولة لاحقًا بعد مُضيّ :seconds ثوان.', + +]; diff --git a/resources/lang/ar/navmenu.php b/resources/lang/ar/navmenu.php new file mode 100644 index 000000000..f3078de84 --- /dev/null +++ b/resources/lang/ar/navmenu.php @@ -0,0 +1,14 @@ + 'معاينة ملفي الشخصي', + 'myTimeline' => 'خيطي الزمني', + 'publicTimeline' => 'الخيط الزمني العام', + 'remoteFollow' => 'المتابَعة عند بُعد', + 'settings' => 'الإعدادات', + 'admin' => 'المدير', + 'logout' => 'خروج', + 'directMessages' => 'الرسائل المباشرة', + +]; diff --git a/resources/lang/ar/notification.php b/resources/lang/ar/notification.php new file mode 100644 index 000000000..3049fc7eb --- /dev/null +++ b/resources/lang/ar/notification.php @@ -0,0 +1,10 @@ + 'أُعجِب بصورتك.', + 'startedFollowingYou' => 'يُتابِعك الآن.', + 'commented' => 'علّق على منشورك.', + 'mentionedYou' => 'أشار إليك.', + +]; diff --git a/resources/lang/ar/pagination.php b/resources/lang/ar/pagination.php new file mode 100644 index 000000000..7222aa3a8 --- /dev/null +++ b/resources/lang/ar/pagination.php @@ -0,0 +1,19 @@ + '« التالي', + 'next' => 'العودة »', + +]; diff --git a/resources/lang/ar/passwords.php b/resources/lang/ar/passwords.php new file mode 100644 index 000000000..53f1dbdf3 --- /dev/null +++ b/resources/lang/ar/passwords.php @@ -0,0 +1,22 @@ + 'ينبغي أن يكون طول الكلمة السرية أزيَد مِن ستة حروف و تكون نفسها متطابقة.', + 'reset' => 'تم إعادة تعيين كلمتك السرية!', + 'sent' => 'لقد قمنا بإرسال رسالة مع رابط لإعادة تعيين الكلمة السرية!', + 'token' => 'رمز إعادة تعيين الكلمة السرية هذا لم يعد صالحًا.', + 'user' => "تعذّر علينا العثور على مستخدِم له عنوان البريد الإلكتروني هذا.", + +]; diff --git a/resources/lang/ar/profile.php b/resources/lang/ar/profile.php new file mode 100644 index 000000000..4f5adcb7a --- /dev/null +++ b/resources/lang/ar/profile.php @@ -0,0 +1,12 @@ + 'لم يقم هذا المستخدِم بنشر أي منشور بعد!', + 'emptyFollowers' => 'ليس لهذا المستخدِم متابِعون بعد!', + 'emptyFollowing' => 'هذا المستخدِم لا يتابع أحدًا بعد!', + 'emptySaved' => 'لم تقم بحفظ أي منشور بعد!', + 'savedWarning' => 'لا يمكنك عرض إلا ما قمت بالإحتفاظ به', + 'privateProfileWarning' => 'هذا الحساب خاص', + 'alreadyFollow' => 'أنت تتبع :username?', + 'loginToSeeProfile' => 'قصد عرض صوَرهم و فيديوهاتهت.', +]; diff --git a/resources/lang/ar/timeline.php b/resources/lang/ar/timeline.php new file mode 100644 index 000000000..a833c8b24 --- /dev/null +++ b/resources/lang/ar/timeline.php @@ -0,0 +1,7 @@ + 'إنّ خيطك الزمني فارغ.', + +]; diff --git a/resources/lang/ar/validation.php b/resources/lang/ar/validation.php new file mode 100644 index 000000000..77d230221 --- /dev/null +++ b/resources/lang/ar/validation.php @@ -0,0 +1,122 @@ + 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', + 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', + 'between' => [ + 'numeric' => 'The :attribute must be between :min and :max.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', + ], + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'email' => 'The :attribute must be a valid email address.', + 'exists' => 'The selected :attribute is invalid.', + 'file' => 'The :attribute must be a file.', + 'filled' => 'The :attribute field must have a value.', + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'ipv4' => 'The :attribute must be a valid IPv4 address.', + 'ipv6' => 'The :attribute must be a valid IPv6 address.', + 'json' => 'The :attribute must be a valid JSON string.', + 'max' => [ + 'numeric' => 'The :attribute may not be greater than :max.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', + ], + 'mimes' => 'The :attribute must be a file of type: :values.', + 'mimetypes' => 'The :attribute must be a file of type: :values.', + 'min' => [ + 'numeric' => 'The :attribute must be at least :min.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', + ], + 'not_in' => 'The selected :attribute is invalid.', + 'not_regex' => 'The :attribute format is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'present' => 'The :attribute field must be present.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ + 'numeric' => 'The :attribute must be :size.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', + ], + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'uploaded' => 'The :attribute failed to upload.', + 'url' => 'The :attribute format is invalid.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +]; diff --git a/resources/views/profile/partial/private-info.blade.php b/resources/views/profile/partial/private-info.blade.php index 20a779098..5c687a7c1 100644 --- a/resources/views/profile/partial/private-info.blade.php +++ b/resources/views/profile/partial/private-info.blade.php @@ -41,7 +41,7 @@ @endif
{{$user->bio}}
-{{str_limit($user->website, 30)}}
+{{str_limit($user->website, 30)}}
diff --git a/resources/views/profile/partial/user-info.blade.php b/resources/views/profile/partial/user-info.blade.php index 5b48ddf86..3ca87c999 100644 --- a/resources/views/profile/partial/user-info.blade.php +++ b/resources/views/profile/partial/user-info.blade.php @@ -81,7 +81,7 @@ @endif{{$user->bio}}
- + diff --git a/resources/views/profile/show.blade.php b/resources/views/profile/show.blade.php index 885d2388a..0b20c77b6 100644 --- a/resources/views/profile/show.blade.php +++ b/resources/views/profile/show.blade.php @@ -32,11 +32,13 @@