From 7e14eefc819ce27f45406452a4f8e2039d0f0886 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 26 Sep 2016 23:55:21 +0200 Subject: [PATCH] Replace logo, fix #57 - delete/unreblog/unfavourite API, fix #45 - app registration API --- app/assets/images/logo.png | Bin 0 -> 24218 bytes .../components/actions/interactions.jsx | 20 +++++ app/assets/stylesheets/application.scss | 82 +++++------------- app/controllers/api/apps_controller.rb | 13 +++ app/controllers/api/statuses_controller.rb | 17 ++++ app/controllers/api_controller.rb | 4 + app/controllers/auth/sessions_controller.rb | 6 ++ app/controllers/home_controller.rb | 2 +- .../oauth/applications_controller.rb | 18 ---- app/helpers/api/apps_helper.rb | 2 + app/helpers/oauth/applications_helper.rb | 2 - app/services/unfavourite_service.rb | 12 +++ app/views/api/apps/create.rabl | 4 + app/views/application/_logo.html.erb | 11 --- app/views/layouts/auth.html.haml | 2 +- config/application.rb | 6 -- config/initializers/doorkeeper.rb | 2 +- config/routes.rb | 13 +-- ...926213048_remove_owner_from_application.rb | 7 ++ db/schema.rb | 5 +- public/favicon.ico | Bin 2319 -> 927 bytes spec/controllers/api/apps_controller_spec.rb | 26 ++++++ .../api/statuses_controller_spec.rb | 58 +++++++++++++ .../auth/sessions_controller_spec.rb | 2 +- .../oauth/applications_controller_spec.rb | 18 ---- spec/helpers/api/apps_helper_spec.rb | 15 ++++ .../helpers/oauth/applications_helper_spec.rb | 5 -- 27 files changed, 216 insertions(+), 136 deletions(-) create mode 100644 app/assets/images/logo.png create mode 100644 app/controllers/api/apps_controller.rb delete mode 100644 app/controllers/oauth/applications_controller.rb create mode 100644 app/helpers/api/apps_helper.rb delete mode 100644 app/helpers/oauth/applications_helper.rb create mode 100644 app/services/unfavourite_service.rb create mode 100644 app/views/api/apps/create.rabl delete mode 100644 app/views/application/_logo.html.erb create mode 100644 db/migrate/20160926213048_remove_owner_from_application.rb create mode 100644 spec/controllers/api/apps_controller_spec.rb delete mode 100644 spec/controllers/oauth/applications_controller_spec.rb create mode 100644 spec/helpers/api/apps_helper_spec.rb delete mode 100644 spec/helpers/oauth/applications_helper_spec.rb diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..3a5a743c0ca10a039ea0bf34e46e0880e8290dfe GIT binary patch literal 24218 zcmXtAV{l|`x9!-rZ9AD*lVoDswylnBJDJSHwylY6XJQ)@eEr_4`{VReb$)c8+FX0B zeL6}>K?(^TA07YzAjwEesDRF~|1MZ)&}X$)O+M&=Hj$N*05AX&0c-LKo@byta8AgIi5ev)0gWXwcMN=}rVV*ZJ*5l&Bt#Xxs3;TmhusIjK}M1$ zM%}>;%Fi9x6*3UEgkfx6EH||hG&)@mQlg+CN~UPYe2zCf z&wdcZ!nr#hsROsc@0b#|8-y}@&sJ?nI1;S|hqcj3WKZS*J;Qhss~eYVieM%;Q1k*4 z1x0eK+56R3TT7!xZo)>U54D-i$xIu1*v5Enzae5*NF+B5Qa6G9M< zzvP~p16QfT%oNddBKegz_~5!~_veEFFc9qIdKsp5TH;H?lC;#Y?n@4!NOt1|=4qv< z<5qfg!eV-U0+G+V{)tKL6>GDg3FpPTR0`Mmrco<75L+4Y;lfoo!d3?aP{#%gu_XII z0dY_~r%)2`#+Xop&|j296hoYt`PM~~JG%ci+5!nb`0p%i1{pApJh_!E$#osyiBEX0 ztmNBmOjj&Z9y4n>cZy!gna$Do?@z9FsR53pH#CF&@4BGxo7&dZ@NdV?Fd%7(`}CP6p2^{YcZNC(Y8Juop%@@?xdZ(@IM7f<1cMG9p;cRvb+ ztsgW22^>4h@w^qlnu%E0-&KbH_E!$)2fPqD=7hu>4$yU|5#uZ_uX6K+fGwuXni zu7JWMNAj-ws|Yf{@NcUpYr@v-S(M%d|Hww=F{>v^0tPp!+yKcrRd-Zq*a)w$mwGqN zrGqPreg4mP{b0*9YKgF+PO|r-H=|F(c)YQ>Q?4GkJ_JaChBesBS2;J)fmQx8w%pr4 z<U9&E%c}!!uS8OC8zt?6KLZGl{JEm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M<-zE4p#)9rGUt5fIjmP~^|H)V4)i4Lo*muw3bK{|G|`fj z;B>0U|6<4T$mLu};J!Bp~o|mC-PTP&F~bTv=?9Ab$;|GGP37 z1US|`g~q$F@C=3Kc4*Yhg};tCx&dHi&&uNKZmxT5?&fSD!3-}Cq-`Iw~4(g8}oON?Hj+?y)2}suxfIkNC2sc(*6)sdjP$4;1ubyA7Y*%MRcPEW*HL@_Dae~#*ZH(}aqLHydDmBo+U686X40^e~k0W$4QX7)oMAt-!ECnQ3&^S~! z#CGIE%l``g%PBh+of?Ac@JmuTW3M7JZ+zlP$Dv$G!uMYy@b?m4JUoB#id)luxz!m+ zm&{*zTLF&%@FW5cL7p1Y9+`I1kpd)J{nQV{?AldX;95xIOL8I)_Cp5IpF!O??KYXV z_p5rsEj!Dz$@zN){RM=-8=ilUYj2JFxf#iJUEP#&% z@Mu8af;8_v*3;o?9{rEl<6y3qAsV@&dL9!euu94)Oj(nzhMz}&c^`pSL%ML!`S;j! zY!@6ekSW8ky*mJ$1Lzz94+U`7px70%jY{dUqDB@p#74n{p_8xf%yMn(tT(*_Am|x~ z`$fEkz*_)Zx@Tqas$;8t%s>t_XCc6|1l=FN10mcW#J$l7OcW1R7IF$9Ptt@^_6WUd zM9sKlDxp|i-q9MzjRZdo;9USN6Y#F#%Hl_kt>`fWIUM2G9U$CiWGFlfz?p>Z4RBtr zhS5`daO1Ag { + api(getState).post(`/api/statuses/${status.get('id')}/unreblog`).then(response => { + // + }).catch(error => { + // + }); + }; +}; + export function reblogRequest(status) { return { type: REBLOG_REQUEST, @@ -57,6 +67,16 @@ export function favourite(status) { }; }; +export function unfavourite(status) { + return (dispatch, getState) => { + api(getState).post(`/api/statuses/${status.get('id')}/unfavourite`).then(response => { + // + }).catch(error => { + // + }); + }; +}; + export function favouriteRequest(status) { return { type: FAVOURITE_REQUEST, diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index fd0e257a7..84f15eaca 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -59,7 +59,7 @@ table { body { font-family: 'Roboto', sans-serif; - background: #282c37 image-url('background-photo.jpeg'); + background: #282c37 image-url('background-photo.jpg'); background-size: cover; background-attachment: fixed; font-size: 13px; @@ -104,10 +104,29 @@ body { font-size: 48px; font-weight: 500; + img { + display: block; + margin: 20px auto; + width: 180px; + height: 180px; + } + a { color: inherit; text-decoration: none; outline: 0; + + img { + opacity: 0.8; + transition: all 0.8s ease; + } + + &:hover { + img { + opacity: 1; + transition-duration: 0.2s; + } + } } small { @@ -313,67 +332,6 @@ body { } } -.turbolinks-progress-bar { - background-color: #2b90d9; -} - -.mastodon { - $head: #282c37; - $tusk: #d9e1e8; - $backdrop: #2b90d9; - $highlight: 18%; - - .mastodon-backdrop { - fill: $backdrop; - } - - #mastodon-ear { - fill: lighten($head, 5%); - - &:hover, &.highlight { - fill: lighten($head, $highlight); - } - } - - #mastodon-head-backdrop { - fill: darken($head, 5%); - - &:hover, &.highlight { - fill: darken($head, 5%); - } - } - - #mastodon-nose, #mastodon-cheek, #mastodon-forehead, #mastodon-backhead { - fill: $head; - - &:hover, &.highlight { - fill: lighten($head, $highlight); - } - } - - #mastodon-tusk-front { - fill: lighten($tusk, 5%); - } - - #mastodon-tusk-back { - fill: $tusk; - - &:hover, &.highlight { - fill: lighten($tusk, $highlight); - } - } - - .mastodon-shape { - transition: all 0.8s ease; - stroke: transparent; - stroke-width: 0px; - - &:hover, &.highlight { - transition-duration: 0.2s; - } - } -} - @import 'accounts'; @import 'stream_entries'; @import 'components' diff --git a/app/controllers/api/apps_controller.rb b/app/controllers/api/apps_controller.rb new file mode 100644 index 000000000..629cb2416 --- /dev/null +++ b/app/controllers/api/apps_controller.rb @@ -0,0 +1,13 @@ +class Api::AppsController < ApplicationController + respond_to :json + + def create + @app = Doorkeeper::Application.create!(app_params) + end + + private + + def app_params + params.permit(:name, :redirect_uri) + end +end diff --git a/app/controllers/api/statuses_controller.rb b/app/controllers/api/statuses_controller.rb index f68f298d8..44fb40bae 100644 --- a/app/controllers/api/statuses_controller.rb +++ b/app/controllers/api/statuses_controller.rb @@ -17,16 +17,33 @@ class Api::StatusesController < ApiController render action: :show end + def destroy + @status = Status.where(account_id: current_user.account).find(params[:id]) + RemoveStatusService.new.(@status) + render_empty + end + def reblog @status = ReblogService.new.(current_user.account, Status.find(params[:id])).reload render action: :show end + def unreblog + RemoveStatusService.new.(Status.where(account_id: current_user.account, reblog_of_id: params[:id]).first!) + @status = Status.find(params[:id]) + render action: :show + end + def favourite @status = FavouriteService.new.(current_user.account, Status.find(params[:id])).status.reload render action: :show end + def unfavourite + @status = UnfavouriteService.new.(current_user.account, Status.find(params[:id])).status.reload + render action: :show + end + def home @statuses = Feed.new(:home, current_user.account).get(20, params[:max_id]).to_a end diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index cbe7141b9..e3ac9fc67 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -27,4 +27,8 @@ class ApiController < ApplicationController def current_user super || current_resource_owner end + + def render_empty + render json: {}, status: 200 + end end diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb index fe0adc9bb..1418ab2ca 100644 --- a/app/controllers/auth/sessions_controller.rb +++ b/app/controllers/auth/sessions_controller.rb @@ -8,4 +8,10 @@ class Auth::SessionsController < Devise::SessionsController remember_me(resource) end end + + protected + + def after_sign_in_path_for(_resource) + root_path + end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index f159c3df8..6b52b704d 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -7,7 +7,7 @@ class HomeController < ApplicationController @mentions = Feed.new(:mentions, current_user.account).get(20) @token = find_or_create_access_token.token end - + private def find_or_create_access_token diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb deleted file mode 100644 index 47935bf7c..000000000 --- a/app/controllers/oauth/applications_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Oauth::ApplicationsController < Doorkeeper::ApplicationsController - before_action :authenticate_user! - - def index - @applications = current_user.oauth_applications - end - - def create - @application = Doorkeeper::Application.new(application_params) - @application.owner = current_user - - if @application.save - redirect_to oauth_application_url(@application) - else - render :new - end - end -end diff --git a/app/helpers/api/apps_helper.rb b/app/helpers/api/apps_helper.rb new file mode 100644 index 000000000..f6b0c6635 --- /dev/null +++ b/app/helpers/api/apps_helper.rb @@ -0,0 +1,2 @@ +module Api::AppsHelper +end diff --git a/app/helpers/oauth/applications_helper.rb b/app/helpers/oauth/applications_helper.rb deleted file mode 100644 index 2c1818055..000000000 --- a/app/helpers/oauth/applications_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module Oauth::ApplicationsHelper -end diff --git a/app/services/unfavourite_service.rb b/app/services/unfavourite_service.rb new file mode 100644 index 000000000..2491c194f --- /dev/null +++ b/app/services/unfavourite_service.rb @@ -0,0 +1,12 @@ +class UnfavouriteService < BaseService + def call(account, status) + favourite = Favourite.find_by!(account: account, status: status) + favourite.destroy! + + unless status.local? + NotificationWorker.perform_async(favourite.stream_entry.id, status.account_id) + end + + favourite + end +end diff --git a/app/views/api/apps/create.rabl b/app/views/api/apps/create.rabl new file mode 100644 index 000000000..1ff6469a4 --- /dev/null +++ b/app/views/api/apps/create.rabl @@ -0,0 +1,4 @@ +object @app +attributes :id, :redirect_uri +node(:client_id) { |app| app.uid } +node(:client_secret) { |app| app.secret } diff --git a/app/views/application/_logo.html.erb b/app/views/application/_logo.html.erb deleted file mode 100644 index 21fa4f657..000000000 --- a/app/views/application/_logo.html.erb +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/app/views/layouts/auth.html.haml b/app/views/layouts/auth.html.haml index bddba570a..54aa07e2c 100644 --- a/app/views/layouts/auth.html.haml +++ b/app/views/layouts/auth.html.haml @@ -3,7 +3,7 @@ .logo-container %h1 = link_to root_path do - = render partial: 'application/logo', locals: { dim: 200 } + = image_tag 'logo.png' %small= Rails.configuration.x.local_domain .form-container diff --git a/config/application.rb b/config/application.rb index 81205de32..f6a5f6f9e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -27,12 +27,6 @@ module Mastodon config.active_job.queue_adapter = :sidekiq - config.to_prepare do - # Doorkeeper::ApplicationsController.layout 'dashboard' - # Doorkeeper::AuthorizedApplicationsController.layout 'dashboard' - Doorkeeper::AuthorizationsController.layout 'auth' - end - config.middleware.use Rack::Attack config.middleware.use Rack::Deflater diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 0d6574d9f..2c02d2b54 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -45,7 +45,7 @@ Doorkeeper.configure do # Optional parameter :confirmation => true (default false) if you want to enforce ownership of # a registered application # Note: you must also run the rails g doorkeeper:application_owner generator to provide the necessary support - enable_application_owner :confirmation => true + # enable_application_owner :confirmation => true # Define access token scopes for your provider # For more information go to diff --git a/config/routes.rb b/config/routes.rb index 51f1f86da..737dbbecf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,9 +7,7 @@ Rails.application.routes.draw do mount Sidekiq::Web => '/sidekiq' end - use_doorkeeper do - controllers applications: 'oauth/applications' - end + use_doorkeeper get '.well-known/host-meta', to: 'xrd#host_meta', as: :host_meta get '.well-known/webfinger', to: 'xrd#webfinger', as: :webfinger @@ -31,7 +29,7 @@ Rails.application.routes.draw do resource :settings, only: [:show, :update] resources :media, only: [:show] - + namespace :api do # PubSubHubbub resources :subscriptions, only: [:show] @@ -41,7 +39,7 @@ Rails.application.routes.draw do post '/salmon/:id', to: 'salmon#update', as: :salmon # JSON / REST API - resources :statuses, only: [:create, :show] do + resources :statuses, only: [:create, :show, :destroy] do collection do get :home get :mentions @@ -51,13 +49,16 @@ Rails.application.routes.draw do get :context post :reblog + post :unreblog post :favourite + post :unfavourite end end resources :follows, only: [:create] resources :media, only: [:create] - + resources :apps, only: [:create] + resources :accounts, only: [:show] do collection do get :relationships diff --git a/db/migrate/20160926213048_remove_owner_from_application.rb b/db/migrate/20160926213048_remove_owner_from_application.rb new file mode 100644 index 000000000..a42f53a29 --- /dev/null +++ b/db/migrate/20160926213048_remove_owner_from_application.rb @@ -0,0 +1,7 @@ +class RemoveOwnerFromApplication < ActiveRecord::Migration[5.0] + def change + remove_index :oauth_applications, [:owner_id, :owner_type] + remove_column :oauth_applications, :owner_id, :integer, null: true + remove_column :oauth_applications, :owner_type, :string, null: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 712776215..f0d7cf5d3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160920003904) do +ActiveRecord::Schema.define(version: 20160926213048) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -114,10 +114,7 @@ ActiveRecord::Schema.define(version: 20160920003904) do t.string "scopes", default: "", null: false t.datetime "created_at" t.datetime "updated_at" - t.integer "owner_id" - t.string "owner_type" t.boolean "superapp", default: false, null: false - t.index ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree end diff --git a/public/favicon.ico b/public/favicon.ico index 84a0b854c534e10a79f340b3aab87d56ed6a31a6..3673ac0d5467a6d5f88ae0ec01827b1a2b539c06 100644 GIT binary patch delta 901 zcmV;01A6?A5}yYU000310RS*C00031AOML2kq{|=15imsK~!jg)!Ivo9Yque@ZWS4 zj2g%I0)?31orxm2O*SUr3tVdALU0rCfr1}E!AN3U_yNS7I-q3bN)UA8#(*(d>8PU^ zqas8X5(7>&lZkU(RJXae(^dD;J#+j1;lRCps?PaWS9SL}r)ows*oi&ZjSlX@EViJF zWt_u*PdJ4y@ELw+$p2W_j#u%$Kyn=U4hOMqBZ<#r0jo8Lmt__2Vs1T&Z^jX<y$-}<16jm9O_AS+^Xo`DCd+uNF8OD0$@<>))NEYB({;$NO^AH& zAl7m&B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