Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.md4
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock6
-rw-r--r--app/assets/stylesheets/mobile/header.scss18
-rw-r--r--app/controllers/photos_controller.rb10
-rw-r--r--app/views/layouts/_drawer.mobile.haml3
-rw-r--r--app/views/shared/_links.haml2
-rw-r--r--docker/develop/docker-compose.yml10
-rw-r--r--features/support/env.rb6
-rwxr-xr-xscript/diaspora-dev18
-rw-r--r--spec/controllers/photos_controller_spec.rb13
11 files changed, 76 insertions, 16 deletions
diff --git a/Changelog.md b/Changelog.md
index 60c334f4f..d288d64b0 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -35,7 +35,7 @@ With this release, we switched from `unicorn` to `puma` to run our applications.
We use yarn to install the frontend dependencies now, so you need to have that installed. See here for how to install it: https://yarnpkg.com/en/docs/install
## Refactor
-* Add bootstrapping for using ECMAScript 6 with automatic transpiling for compatibility [#7581](https://github.com/diaspora/diaspora/pull/7581)
+* Add bootstrapping for using ECMAScript 6 with automatic transpiling for compatibility [#7581](https://github.com/diaspora/diaspora/pull/7581) [#8397](https://github.com/diaspora/diaspora/pull/8397)
* Remove backporting of mention syntax [#7788](https://github.com/diaspora/diaspora/pull/7788)
* Enable Content-Security-Policy header by default [#7781](https://github.com/diaspora/diaspora/pull/7781)
* Do not show getting started after account import [#8036](https://github.com/diaspora/diaspora/pull/8036)
@@ -52,6 +52,8 @@ We use yarn to install the frontend dependencies now, so you need to have that i
* Photo-upload file picker now correctly restricts possible file types [#8205](https://github.com/diaspora/diaspora/pull/8205)
* Make inline code inside links show the link color [#8387](https://github.com/diaspora/diaspora/pull/8387)
* Fix fetching public posts on first account search was missing some data [#8390](https://github.com/diaspora/diaspora/pull/8390)
+* Add redirect from mobile UI photo URLs to post when not using mobile UI [#8400](https://github.com/diaspora/diaspora/pull/8400)
+* Escape mentions before markdown parsing in mobile UI [#8398](https://github.com/diaspora/diaspora/pull/8398)
## Features
* Add client-side cropping of profile image uploads [#7581](https://github.com/diaspora/diaspora/pull/7581)
diff --git a/Gemfile b/Gemfile
index 3a1a2dd91..bcb823d83 100644
--- a/Gemfile
+++ b/Gemfile
@@ -87,12 +87,12 @@ gem "uuid", "2.3.9"
# JavaScript
+gem "babel-transpiler", "0.7.0"
gem "handlebars_assets", "0.23.9"
gem "jquery-rails", "4.5.0"
gem "jquery-ui-rails", "5.0.5"
gem "js_image_paths", "0.2.0"
gem "js-routes", "2.2.4"
-gem "sprockets-es6", "0.9.2"
# Localization
diff --git a/Gemfile.lock b/Gemfile.lock
index a45b16517..be3662252 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -679,10 +679,6 @@ GEM
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
- sprockets-es6 (0.9.2)
- babel-source (>= 5.8.11)
- babel-transpiler
- sprockets (>= 3.0.0)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
@@ -780,6 +776,7 @@ DEPENDENCIES
apparition (= 0.6.0)
asset_sync (= 2.15.2)
autoprefixer-rails (= 10.4.7.0)
+ babel-transpiler (= 0.7.0)
bootstrap-sass (= 3.4.1)
bootstrap-switch-rails (= 3.3.3)
capybara (= 3.35.3)
@@ -868,7 +865,6 @@ DEPENDENCIES
simple_captcha2 (= 0.5.0)
simplecov (= 0.21.2)
sinon-rails (= 1.15.0)
- sprockets-es6 (= 0.9.2)
sprockets-rails (= 3.4.2)
string-direction (= 1.2.2)
terser (= 1.1.10)
diff --git a/app/assets/stylesheets/mobile/header.scss b/app/assets/stylesheets/mobile/header.scss
index 159e6a536..9e532921b 100644
--- a/app/assets/stylesheets/mobile/header.scss
+++ b/app/assets/stylesheets/mobile/header.scss
@@ -145,6 +145,9 @@ $mobile-navbar-height: 46px;
bottom: 0;
overflow: auto;
width: 100%;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
li {
font-size: 1.8rem;
@@ -195,6 +198,21 @@ $mobile-navbar-height: 46px;
margin: 0;
padding: 0;
}
+
+ .info-links {
+ li {
+ font-size: 1.2rem;
+ line-height: 1.2;
+ }
+
+ a {
+ padding: 8px 25px;
+ }
+
+ .switch-to-touch {
+ display: none;
+ }
+ }
}
#main-nav, #drawer {
diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb
index c9447b495..e7a827de4 100644
--- a/app/controllers/photos_controller.rb
+++ b/app/controllers/photos_controller.rb
@@ -13,9 +13,17 @@ class PhotosController < ApplicationController
current_user.photos_from(Person.find_by(guid: params[:person_id])).where(id: params[:id]).first
else
Photo.where(id: params[:id], public: true).first
- end
+ end
raise ActiveRecord::RecordNotFound unless @photo
+
+ respond_to do |format|
+ format.html {
+ post = @photo.status_message
+ redirect_to post ? post_path(post) : @photo.url
+ }
+ format.mobile { render "photos/show" }
+ end
end
def index
diff --git a/app/views/layouts/_drawer.mobile.haml b/app/views/layouts/_drawer.mobile.haml
index 61b6045dc..5087bec2d 100644
--- a/app/views/layouts/_drawer.mobile.haml
+++ b/app/views/layouts/_drawer.mobile.haml
@@ -61,3 +61,6 @@
= t("admins.admin_bar.report")
%li= link_to t("layouts.application.switch_to_standard_mode"), toggle_mobile_path
%li= link_to t("layouts.header.logout"), destroy_user_session_path, method: :delete
+
+ %ul.info-links
+ = render "shared/links"
diff --git a/app/views/shared/_links.haml b/app/views/shared/_links.haml
index 6dc53c6e2..b724c0d25 100644
--- a/app/views/shared/_links.haml
+++ b/app/views/shared/_links.haml
@@ -4,8 +4,8 @@
source_url.to_s,
title: t("layouts.application.source_package")
%li= link_to t("layouts.application.statistics_link"), statistics_path
-%li= link_to t("layouts.application.switch_to_touch_optimized_mode"), toggle_mobile_path
- if AppConfig.settings.terms.enable?
%li= link_to t("_terms"), terms_path
- unless AppConfig.admins.podmin_email.nil?
%li= mail_to AppConfig.admins.podmin_email, t("_podmin_mail")
+%li.switch-to-touch= link_to t("layouts.application.switch_to_touch_optimized_mode"), toggle_mobile_path
diff --git a/docker/develop/docker-compose.yml b/docker/develop/docker-compose.yml
index 8b41d6ed7..46e38d2e9 100644
--- a/docker/develop/docker-compose.yml
+++ b/docker/develop/docker-compose.yml
@@ -23,8 +23,8 @@ services:
ports:
- ${DIASPORA_DOCKER_PORT:-3000}:3000
environment:
- - ENVIRONMENT_REDIS=redis://redis
- - SERVER_LISTEN=tcp://0.0.0.0:3000
+ ENVIRONMENT_REDIS: redis://redis
+ SERVER_LISTEN: tcp://0.0.0.0:3000
depends_on:
- "${DIASPORA_DOCKER_DB}"
- redis
@@ -36,14 +36,16 @@ services:
- redis_data:/data
postgresql:
- image: postgres:10.3
+ image: postgres:15
ports:
- 55432:5432
volumes:
- postgresql_data:/var/lib/postgresql
+ environment:
+ POSTGRES_PASSWORD: postgres
mysql:
- image: mariadb:10.2
+ image: mariadb:10.9
ports:
- 53306:3306
volumes:
diff --git a/features/support/env.rb b/features/support/env.rb
index d8cfcbd3a..9297993e1 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -26,7 +26,11 @@ Capybara.server = :webrick
Capybara.register_driver :apparition do |app|
# Pass headless: false here if you need to see the browser
- Capybara::Apparition::Driver.new(app, headless: true)
+ Capybara::Apparition::Driver.new(
+ app,
+ headless: true,
+ browser_options: %i[no_sandbox disable_setuid_sandbox disable_gpu]
+ )
end
Capybara.javascript_driver = :apparition
diff --git a/script/diaspora-dev b/script/diaspora-dev
index 1c5eace04..5bd032ea2 100755
--- a/script/diaspora-dev
+++ b/script/diaspora-dev
@@ -10,7 +10,8 @@ print_usage() {
setup)
echo; echo "Set up the environment for diaspora*"
echo; echo "This command is an alias for the execution of the commands"
- echo "build, config, bundle, migrate and setup-tests, in that order."
+ echo "build, config, pull, bundle, setup-rails and setup-tests, in that order."
+ echo; echo "This command can also be used to update the environment again."
print_usage_header "setup [options]" \
" --force Rebuild image without using Docker's cache;" \
" overwrite existing configuration" \
@@ -80,6 +81,10 @@ print_usage() {
print_usage_header "build [options]" \
" --no-cache Rebuild image without using Docker's cache"
;;
+ pull)
+ echo; echo "Pull docker images needed for the development environment"
+ print_usage_header "pull"
+ ;;
bundle)
echo; echo "Install gems using bundle into $DIASPORA_ROOT"
print_usage_header "bundle"
@@ -158,6 +163,7 @@ print_usage_full() {
echo
echo "Misc. Commands:"
echo " build Build basic diaspora* environment"
+ echo " pull Update docker images"
echo " bundle (Re-)Install gems for diaspora*"
echo " yarn (Re-)Install frontend dependencies for diaspora*"
echo " config Configure diaspora*"
@@ -228,7 +234,11 @@ dia_get_db() {
dia_build() {
if [ $# -gt 0 ] && [ "$1" == "--no-cache" ]; then nocache="--no-cache"; fi
# Build the diaspora Docker container (diaspora:dev-latest)
- dia_docker_compose build $nocache diaspora
+ dia_docker_compose build --pull $nocache diaspora
+}
+
+dia_pull() {
+ dia_docker_compose pull redis $(dia_get_db)
}
dia_bundle() {
@@ -450,6 +460,7 @@ dia_setup() {
set -e
dia_build $build
dia_config $config
+ dia_pull
dia_bundle
dia_setup_rails
dia_setup_tests
@@ -579,6 +590,9 @@ case "$dia_command" in
pronto)
dia_pronto
;;
+ pull)
+ dia_pull
+ ;;
restart)
dia_restart "$@"
;;
diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb
index 4d76435fa..4b6ca7fe4 100644
--- a/spec/controllers/photos_controller_spec.rb
+++ b/spec/controllers/photos_controller_spec.rb
@@ -230,6 +230,19 @@ describe PhotosController, :type => :controller do
expect(response).to be_successful
end
+ it "should redirect to the post of the photo when not on mobile" do
+ alices_post = alice.post(:status_message, text: "Post with photo", to: alice.aspects.first.id, public: false)
+ @alices_photo.update(status_message: alices_post)
+
+ get :show, params: {person_id: alice.person.guid, id: @alices_photo.id}
+ expect(response).to redirect_to(post_path(alices_post))
+ end
+
+ it "should redirect to the photo file when not on mobile and no post exists" do
+ get :show, params: {person_id: alice.person.guid, id: @alices_photo.id}
+ expect(response).to redirect_to(@alices_photo.url)
+ end
+
it "doesn't leak private photos to the public" do
sign_out :user
expect {