ish_manager 0.1.8.46 → 0.1.8.47

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
  SHA1:
3
- metadata.gz: 354913c6726225ce2e17f2d5daedf5f7192a71ff
4
- data.tar.gz: c5214eadaec6ce76e7e76ba422b7535db13f941c
3
+ metadata.gz: 3ebd11be877c4582e3aef3eb253b561b98179fd7
4
+ data.tar.gz: 1fe3f9d000153ecdbd0c3b5390c8202edc7950bf
5
5
  SHA512:
6
- metadata.gz: eceb6bc0a16c47b92de430f97353f4e29901d86878191325a0052cdc40dfd86a3bbe94de9516c6fa0be15d2edfab7b79bf36e13218e6bb5b5f165d7eb7165633
7
- data.tar.gz: 21ebbd5f3ab16eb02e0274b57878e01dd1cf81f8fed88401ff11c25387f9b3b20bbe302961bca21d06b793d639dba29fdb58a5e70cbcfa099ec02246fb495943
6
+ metadata.gz: 2c7a2ef99aa88e236d87830b4f95e81f4529bc7332248d1804e1385bdf5bf3579fbb99e7d53051f4634f8d05027c3b7a57f53691a7586b6cf9b9c29ce00844d5
7
+ data.tar.gz: 536e344c0b5146a5d81624a2942357f8034bab8a88d05846ef40b61c76514b1852b12b7b0f1bafda4b3c4526e022664915e3fb11e5b1b61215efbb73f4bfd559
@@ -15,6 +15,10 @@
15
15
  *= require_self
16
16
  */
17
17
 
18
+
19
+ /**
20
+ * utils
21
+ */
18
22
  .bg-white {
19
23
  background: url('/assets/bg/confectionary.png');
20
24
  padding-bottom: 1em;
@@ -27,6 +31,11 @@ body {
27
31
  .center {
28
32
  text-align: center;
29
33
  }
34
+
35
+ .inline {
36
+ display: inline-block;
37
+ }
38
+
30
39
  .notice {
31
40
  border: 1px solid green;
32
41
  padding: .8em;
@@ -94,4 +103,11 @@ nav.pagination
94
103
  }
95
104
  .descr .float-left {
96
105
  padding-right: 1em;
97
- }
106
+ }
107
+
108
+ /**
109
+ * tags
110
+ */
111
+ ul.tags ul.tags {
112
+ margin-left: 2em;
113
+ }
@@ -23,7 +23,7 @@ module IshManager
23
23
  @galleries_list = Gallery.all.list
24
24
  @videos_list = Video.all.list
25
25
  @user_profiles_list = IshModels::UserProfile.all.list
26
- @tags_list = Tag.all.list
26
+ @tags_list = Tag.list
27
27
  end
28
28
 
29
29
  private
@@ -4,7 +4,7 @@ class IshManager::TagsController < IshManager::ApplicationController
4
4
  before_action :set_lists
5
5
 
6
6
  def index
7
- @tags = Tag.unscoped
7
+ @tags = Tag.unscoped.where( :parent_tag_id => nil ).order_by( :name => :asc )
8
8
  authorize! :index, Tag.new
9
9
  end
10
10
 
@@ -39,6 +39,9 @@ class IshManager::TagsController < IshManager::ApplicationController
39
39
  def update
40
40
  @tag = Tag.unscoped.find params[:id]
41
41
  authorize! :update, @tag
42
+
43
+ # byebug
44
+
42
45
  if @tag.update_attributes params[:tag].permit!
43
46
  flash[:notice] = 'Success.'
44
47
  redirect_to tags_path
@@ -47,7 +50,18 @@ class IshManager::TagsController < IshManager::ApplicationController
47
50
  render :action => :new
48
51
  end
49
52
  end
50
-
53
+
54
+ def destroy
55
+ @tag = Tag.unscoped.find params[:id]
56
+ authorize! :destroy, @tag
57
+ if @tag.destroy
58
+ flash[:notice] = 'Success'
59
+ else
60
+ flash[:alert] = "Cannot destroy tag: #{@tag.errors.messages}"
61
+ end
62
+ redirect_to :action => 'index'
63
+ end
64
+
51
65
  end
52
66
 
53
67
 
@@ -11,6 +11,7 @@
11
11
  %li= link_to 'Profiles', user_profiles_path
12
12
  %li= link_to 'Reports', reports_path
13
13
  %li= link_to 'Sites', sites_path
14
+ %li= link_to 'Tags', tags_path
14
15
  %li= link_to 'Venues', venues_path
15
16
  %li= link_to 'Videos', videos_path
16
17
  %li= link_to 'Users', user_profiles_path
@@ -2,18 +2,28 @@
2
2
  -#
3
3
  -# tags / _form
4
4
  -#
5
-
6
- = form_for @tag, :url => create_tag_path do |f|
5
+
6
+ -#= @tag.inspect
7
+
8
+ = form_for @tag do |f|
7
9
  = f.label :name
8
10
  = f.text_field :name
11
+ %br
12
+
13
+ = f.label :name_seo
14
+ = f.text_field :name_seo
9
15
 
10
16
  %br
11
- = f.label :is_public
17
+ = f.label "parent tag"
18
+ = f.select :parent_tag_id, options_for_select( @tags_list, :selected => ( params[:for_tag] || @tag.parent_tag_id ) )
19
+
20
+ %br
12
21
  = f.check_box :is_public
22
+ = f.label :is_public
13
23
 
14
24
  %br
15
- = f.label :is_trash
16
25
  = f.check_box :is_trash
26
+ = f.label :is_trash
17
27
 
18
28
  %br
19
29
  = f.submit
@@ -3,38 +3,16 @@
3
3
  - is_panel = true
4
4
  %li
5
5
  %div{ :class => is_panel ? 'panel' : '' }
6
- = link_to tag.name, tag_path(tag.name_seo)
6
+ = link_to tag.name, tag_path(tag)
7
+ = link_to '[+]', new_tag_path( :for_tag => tag.id )
8
+ = link_to '[~]', edit_tag_path( tag )
9
+ .inline= button_to '[x]', tag_path( tag ), :method => :delete, :data => { :confirm => 'Are you sure?' }
7
10
  (#{tag.reports.length}) (#{tag.galleries.length}) (#{tag.videos.length})
8
11
 
9
12
  -# .descr= tag.descr
10
13
 
11
14
  - if tag.children_tags.length > 0
12
- %ul
15
+ %ul.tags
13
16
  - tag.children_tags.map do |tt|
14
17
  = render 'ish_manager/tags/item', :tag => tt, :is_panel => false
15
18
 
16
-
17
-
18
-
19
-
20
- -# hidden
21
- - proc do # nothing
22
- - if tag.reports.length > 0
23
- .tag-reports
24
- %h5 Reports
25
- - tag.reports[0..Tag.n_reports-1].each do |report|
26
- = render 'reports/item_mini', :report => report
27
- .item-mini.hide
28
- %h5= link_to '[More Reports]', tag_14path(tag.name_seo)
29
-
30
- - if tag.galleries.length > 0
31
- %h5 Galleries
32
- %ul.tag-galleries
33
- - tag.galleries[0..Tag.n_galleries].each do |gallery|
34
- %li= link_to gallery.name, gallery_path(gallery.galleryname, 0)
35
-
36
- - if tag.videos.length > 0
37
- %h5 Videos
38
- %ul.tag-videos
39
- - tag.videos[0..Tag.n_videos].each do |video|
40
- %li= link_to video.name, video_path(video.youtube_id)
@@ -0,0 +1,4 @@
1
+
2
+ %h3
3
+ Edit Tag #{@tag.name}
4
+ = render 'form', :tag => @tag
@@ -0,0 +1,2 @@
1
+
2
+ = render :form, :tag => @tag
@@ -5,11 +5,13 @@
5
5
  .row
6
6
  .small-12.columns
7
7
  .center
8
- %h1= t('tags.list')
8
+ %h1
9
+ Tags (#{Tag.count})
10
+ = link_to '[+]', new_tag_path
9
11
 
10
- %ul.large-block-grid-2
12
+ %ul.tags
11
13
  - @tags.each do |tag|
12
- = render 'tags/item', :tag => tag
14
+ = render 'item', :tag => tag
13
15
  - if @tags.blank?
14
16
  %li No Tags
15
17
 
@@ -5,20 +5,23 @@
5
5
 
6
6
  .row
7
7
  .large-12.columns
8
- %h1.center On the topic of #{@tag.name}
9
- = render 'ads/leaderboard'
8
+ %h5.center
9
+ = @tag.name
10
+ = link_to '[~]', edit_tag_path( @tag )
11
+ .inline= button_to 'X', tag_path( @tag ), :method => :delete, :data => { :confirm => 'Are you sure?' }
12
+ -# = render 'ads/leaderboard'
10
13
  -# .descr= @tag.descr # I don't wanna show this every time to everyone, they know what they are here for.
11
- = render 'features/list', :features => @tag.features[0, Tag.n_features]
14
+ = render 'ish_manager/features/index', :features => @tag.features[0, Tag.n_features]
12
15
 
13
16
  .row
14
17
  .large-6.columns
15
18
  %h4 Reports
16
- = render 'reports/list', :reports => @reports, :n_ads => 0
19
+ = render 'ish_manager/reports/index', :reports => @tag.reports, :n_ads => 0
17
20
  %hr
18
21
 
19
22
  .large-6.columns
20
23
  %h4 Galleries
21
- = render 'galleries/list', :galleries => @galleries, :n_thumbs => 4
24
+ = render 'ish_manager/galleries/index', :galleries => @tag.galleries, :n_thumbs => 4
22
25
  %hr
23
26
 
24
27
  .row
@@ -26,5 +29,5 @@
26
29
  %h4
27
30
  = t('videos.list')
28
31
  = link_to '[+]', new_video_path( :tag_id => @tag.id )
29
- = render 'videos/list', :videos => @videos
32
+ = render 'ish_manager/videos/index', :videos => @tag.videos
30
33
 
@@ -1,9 +1,11 @@
1
1
 
2
+ - videos ||= @videos
2
3
  - videos = videos.page params[:videos_page]
4
+
3
5
  .row
4
6
  .col-sm-12
5
7
  %h2
6
- Videos (#{@videos.count})
8
+ Videos (#{videos.count})
7
9
  = link_to '[+]', new_video_path
8
10
 
9
11
  = paginate videos, :param_name => :videos_page
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.46
4
+ version: 0.1.8.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-05 00:00:00.000000000 Z
11
+ date: 2017-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -259,6 +259,8 @@ files:
259
259
  - app/views/ish_manager/tags/_item.haml
260
260
  - app/views/ish_manager/tags/_list.haml
261
261
  - app/views/ish_manager/tags/_list_simple.haml
262
+ - app/views/ish_manager/tags/edit.haml
263
+ - app/views/ish_manager/tags/edit.haml~
262
264
  - app/views/ish_manager/tags/index.haml
263
265
  - app/views/ish_manager/tags/new.haml
264
266
  - app/views/ish_manager/tags/show.haml