ishapi 0.1.8.177 → 0.1.8.181

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d2316758e2797aeecb65f3e8cacdb034902a7271f8518da15707050bf64e097
4
- data.tar.gz: ba8bc72419963ea42441cee3dfd3b537aa79d3bf8dd21ff5fa4f44f7e77b37c7
3
+ metadata.gz: 7ef65cf53c1c9ed63d5118cba183a30c1958a00c5a7e45d23fc15e32605782f4
4
+ data.tar.gz: 3be58b188615387a0ed57107bb1ba3378327838bb4ec48f012ead15ca0cc8dab
5
5
  SHA512:
6
- metadata.gz: 33e25407dddeeafa0fe7e80e3483c0e674ebb36028644f69c4b37c2ac03787d93568cddad0ce6981d4c63c0f527c754a4bb572e6d4a8d622e215d212c9e9b22b
7
- data.tar.gz: cfed72d717b27f1c7f303eace2491441f0e5108f2536a51fdedaf7c1ed00735012a16b2db13422e4dc6f93aff33a008e4a5b843685fd26fc4c443f3f22fcea60
6
+ metadata.gz: 292432e6e0f2d4410b0440d849a7cea5409bc52cc8cb03e2f30befdb80de9296a8b560e70ae22368aa55c50a8e3007d42698920d607fd88e451977e98a41b26a
7
+ data.tar.gz: 015ca8524e54cee60bae0bfac3afe86c092856cd3028091963a2b4e3eab9ddb6e128025512762f35419aaed2e47ce2fdbf059c9c0e597e1278610492fcce3bb7
@@ -13,6 +13,8 @@ class Ishapi::MapsController < Ishapi::ApplicationController
13
13
 
14
14
  @markers = @map.markers.permitted_to(current_user.profile)
15
15
 
16
+ @tags = @map.tags
17
+
16
18
  # case @map.ordering_type
17
19
  # when ::Gameui::Map::ORDERING_TYPE_ALPHABETIC
18
20
  # @markers = @markers.order_by( name: :asc )
@@ -3,8 +3,22 @@ require_dependency "ishapi/application_controller"
3
3
  module Ishapi
4
4
  class NewsitemsController < ApplicationController
5
5
 
6
- before_action :check_profile # , except: [ :index ] # @TODO: this is fucked
7
- # before_action :check_multiprofile, only: [ :index ]
6
+ before_action :check_profile
7
+
8
+ def destroy
9
+ n = Newsitem.find params[:id]
10
+
11
+ puts! n.map.creator_profile.id, 'ze id'
12
+ puts! current_user.profile.id, 'ze2 id'
13
+
14
+ authorize! :destroy, n
15
+ flag = n.destroy
16
+ if flag
17
+ render json: { status: 'ok' }, status: :ok
18
+ else
19
+ render json: { message: "No luck: #{n.errors.full_messages.join(", ")}." }, status: 400
20
+ end
21
+ end
8
22
 
9
23
  def index
10
24
  if params[:domain]
@@ -6,7 +6,7 @@ class Ishapi::Ability
6
6
  #
7
7
  # signed in user
8
8
  #
9
- unless user.blank?
9
+ if !user.blank?
10
10
 
11
11
  # if user.profile && user.profile.sudoer?
12
12
  # can :manage, :all
@@ -14,7 +14,9 @@ class Ishapi::Ability
14
14
 
15
15
  can [ :my_index ], Gallery
16
16
  can [ :show ], Gallery do |gallery|
17
- gallery.user_profile == user.profile
17
+ gallery.user_profile == user.profile || # my own
18
+ (!gallery.is_trash && gallery.is_public ) || # public
19
+ (!gallery.is_trash && gallery.shared_profiles.include?( user.profile ) ) # shared with me
18
20
  end
19
21
 
20
22
  can [ :do_purchase ], ::Gameui
@@ -22,6 +24,10 @@ class Ishapi::Ability
22
24
  map.creator_profile == user.profile
23
25
  end
24
26
 
27
+ can [ :destroy ], Newsitem do |n|
28
+ n.map.creator_profile.id == user.profile.id
29
+ end
30
+
25
31
  can [ :create, :unlock ], ::Ish::Payment
26
32
 
27
33
  can [ :buy_stars ], ::Ish::UserProfile
@@ -54,6 +54,10 @@ json.cache! this_key do
54
54
  json.partial! 'ishapi/galleries/index', galleries: @galleries
55
55
  end
56
56
 
57
+ if @tags
58
+ json.partial! 'ishapi/tags/index', tags: @tags
59
+ end
60
+
57
61
  end
58
62
  end
59
63
 
@@ -16,6 +16,7 @@ json.markers do
16
16
  json.title_img_path marker.title_image ? marker.title_image.image.url(:thumb) : image_missing
17
17
  json.item_type marker.item_type
18
18
  json.url marker.url
19
+ json.asset3d_path marker.asset3d ? marker.asset3d.object.url : ''
19
20
 
20
21
  ## @TODO: this is copy-pasted and should be abstracted.
21
22
  destination = marker.destination
@@ -5,7 +5,7 @@
5
5
  json.n_newsitems newsitems.count
6
6
  json.newsitems do
7
7
  json.array! newsitems do |item|
8
- json.id item.id.to_s
8
+ json.newsitem_id item.id.to_s
9
9
  json.name item.name
10
10
  json.created_at item.created_at
11
11
  json.updated_at item.updated_at
@@ -5,6 +5,7 @@
5
5
 
6
6
  json.tags do
7
7
  json.array! tags do |tag|
8
+ json.id tag.id.to_s
8
9
  json.name tag.name
9
10
  json.slug tag.slug
10
11
  end
data/config/routes.rb CHANGED
@@ -29,6 +29,9 @@ Ishapi::Engine.routes.draw do
29
29
  post 'videos', to: 'videos#index'
30
30
  end
31
31
 
32
+ # N
33
+ delete 'newsitems/:id', to: 'newsitems#destroy'
34
+
32
35
  post 'do_purchase', to: 'gameui#do_purchase' # @TODO: rename to just purchase, or destroy endpoint
33
36
  post 'payments', :to => 'payments#create'
34
37
  post 'payments2', :to => 'payments#create2' # @TODO: change
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.177
4
+ version: 0.1.8.181
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2022-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails