ish_manager 0.1.8.137 → 0.1.8.138

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da6e407376e4d302636f4980f3363401df2c4dd4
4
- data.tar.gz: d7b2a0820e5039cb5fbc12e1d32fd31339dce962
3
+ metadata.gz: 188ebae7d0e28154da38ff294602e8d2ee61a075
4
+ data.tar.gz: 1e08caf4790cdbfaad09eb6e572499146d914d4f
5
5
  SHA512:
6
- metadata.gz: bc6b59e9a3ea794dbaaca9bd8b5557334e091f07059b53e517fc9cf55364c1eefa5802f497e8d611ce2cb5c366e7ea2977a185bb0430ca96b455c5ea1daf4ae6
7
- data.tar.gz: 415c0098d9533583d5eab1ea8cd04c431151c62294204eb8424e501b42c721bf2f2d35e66a3790dbd4fca8ff823007f6aaa928149dc544dbb1234f03588d9b77
6
+ metadata.gz: 70b03ec661311d85f510503bef579f46ec38b2f8d6f9d7f602aa0f56da6bf037133a7bdfc02793c8ec274c4f4a96e952fa0f11fbf412b213de821390512f8fb0
7
+ data.tar.gz: b9389dc325ee5ffde16e6a1a9aa7ec0c3531dc0c246f94f63c0643d69cd885302220ac0c5d65af617a274dd3b98f9ddc941628a8245cd6d4ef6bd597f8677796
@@ -0,0 +1,52 @@
1
+
2
+ class IshManager::CampaignsController < IshManager::ApplicationController
3
+
4
+ def index
5
+ authorize! :index, Ish::Campaign
6
+ @campaigns = Ish::Campaign.where( :profile => current_user.profile, :is_trash => false )
7
+ if params[:is_done]
8
+ @campaigns = @campaigns.where( :is_done => true )
9
+ else
10
+ @campaigns = @campaigns.where( :is_done => false )
11
+ end
12
+ end
13
+
14
+ def new
15
+ @new_campaign = Ish::Campaign.new
16
+ authorize! :new, @new_campaign
17
+ end
18
+
19
+ def create
20
+ @campaign = Ish::Campaign.new params[:campaign].permit!
21
+ @campaign.profile = current_user.profile
22
+ authorize! :create, @campaign
23
+ if @campaign.save
24
+ flash[:notice] = "created campaign"
25
+ else
26
+ flash[:alert] = "Cannot create campaign: #{@campaign.errors.messages}"
27
+ end
28
+ redirect_to :action => 'index'
29
+ end
30
+
31
+ def show
32
+ authorize! :redirect, IshManager::Ability
33
+ redirect_to :action => :edit, :id => params[:id]
34
+ end
35
+
36
+ def edit
37
+ @campaign = Ish::Campaign.find params[:id]
38
+ authorize! :edit, @campaign
39
+ end
40
+
41
+ def update
42
+ @campaign = Ish::Campaign.find params[:id]
43
+ authorize! :update, @campaign
44
+ if @campaign.update_attributes params[:campaign].permit!
45
+ flash[:notice] = 'Successfully updated campaign.'
46
+ else
47
+ flash[:alert] = "Cannot update campaign: #{@campaign.errors.messages}"
48
+ end
49
+ redirect_to :action => 'index'
50
+ end
51
+
52
+ end
@@ -5,8 +5,9 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
5
5
 
6
6
  def new
7
7
  @newsitem = Newsitem.new
8
- @sites = Site.list
9
- @cities = City.list
8
+ @sites = Site.list
9
+ @cities = City.list
10
+ @tags = Tag.list
10
11
  if params[:city_id]
11
12
  @city = City.find params[:city_id]
12
13
  @newsitem.city = @city
@@ -15,15 +16,21 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
15
16
  @site = Site.find params[:site_id]
16
17
  @newsitem.site = @site
17
18
  end
19
+ if params[:tag_id]
20
+ @tag = Tag.unscoped.find params[:tag_id]
21
+ @newsitem.tag = @tag
22
+ end
18
23
  authorize! :new, @newsitem
19
24
  end
20
25
 
21
26
  def create
22
27
  @newsitem = Newsitem.new params[:newsitem].permit!
23
- @resource = City.find params[:city_id] if params[:city_id]
28
+ @resource = City.find params[:city_id] if params[:city_id]
24
29
  @resource = City.find params[:newsitem][:city_id] if !params[:newsitem][:city_id].blank?
25
- @resource = Site.find params[:site_id] if params[:site_id]
30
+ @resource = Site.find params[:site_id] if params[:site_id]
26
31
  @resource = Site.find params[:newsitem][:site_id] if !params[:newsitem][:site_id].blank?
32
+ @resource = Tag.find params[:tag_id] if params[:tag_id]
33
+ @resource = Tag.find params[:newsitem][:tag_id] if !params[:newsitem][:tag_id].blank?
27
34
  @resource.newsitems << @newsitem
28
35
 
29
36
  authorize! :create_newsitem, @resource
@@ -33,22 +40,26 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
33
40
  @newsitem.photo = photo
34
41
  end
35
42
 
36
- flag = @newsitem.save && @resource.save
37
- if flag
38
- @resource.touch
39
- else
40
- error = 'No Luck. ' + @newsitem.errors.messages.to_s + " :: " + photo.errors.messages.to_s
43
+ case @resource.class.name
44
+ when "City"
45
+ url = edit_city_path( @resouce.id )
46
+ when "Tag"
47
+ url = tag_path( @resource.id )
48
+ @resource.site.touch
49
+ when "Site"
50
+ url = edit_site_path( @resource.id )
41
51
  end
42
- url = params[:city_id] ? edit_city_path( @resource.id ) : edit_site_path( @resource.id )
43
52
 
53
+ flag = @newsitem.save && @resource.save
44
54
  if flag
55
+ @resource.touch
45
56
  flash[:notice] = 'Success'
46
57
  redirect_to url
47
58
  else
59
+ error = 'No Luck. ' + @newsitem.errors.messages.to_s + " :: " + photo.errors.messages.to_s
48
60
  flash[:alert] = error
49
61
  @sites = Site.list
50
62
  @cities = City.list
51
-
52
63
  render :action => :new
53
64
  end
54
65
  end
@@ -64,6 +75,11 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
64
75
  flag = site.newsitems.find( params[:id] ).destroy
65
76
  url = edit_site_path( params[:site_id] )
66
77
  end
78
+ if params[:tag_id]
79
+ tag = Tag.find( params[:tag_id] )
80
+ flag = tag.newsitems.find( params[:id] ).destroy
81
+ url = tag_path( params[:tag_id] )
82
+ end
67
83
 
68
84
  flash[:notice] = "Success? #{flag}"
69
85
  redirect_to url
@@ -23,7 +23,7 @@ class IshManager::SitesController < IshManager::ApplicationController
23
23
  end
24
24
 
25
25
  def edit
26
- @site = Site.find params[:id]
26
+ @site = Site.unscoped.find params[:id]
27
27
  authorize! :update, @site
28
28
  end
29
29
 
@@ -45,10 +45,10 @@ class IshManager::TagsController < IshManager::ApplicationController
45
45
  def update
46
46
  @tag = Tag.unscoped.find params[:id]
47
47
  authorize! :update, @tag
48
-
49
- # byebug
50
48
 
51
49
  if @tag.update_attributes params[:tag].permit!
50
+ @tag.site.touch if @tag.site
51
+
52
52
  flash[:notice] = 'Success.'
53
53
  redirect_to tags_path
54
54
  else
@@ -27,6 +27,7 @@
27
27
  %li{ :class => params[:controller] == 'ish_manager/payments' ? 'active' : '' }= link_to 'Payments', payments_path
28
28
  %ul.nav.nav-pills
29
29
  %li{ :class => params[:controller] == 'ish_manager/leads' ? 'active' : '' }= link_to 'Leads', leads_path
30
+ %li{ :class => params[:controller] == 'ish_manager/campaigns' ? 'active' : '' }= link_to 'Campaigns', campaigns_path
30
31
  %ul.nav.nav-pills
31
32
  %li{ :class => params[:controller] == 'ish_manager/orders' ? 'active' : '' }= link_to 'Orders', orders_path
32
33
  %hr
@@ -0,0 +1,24 @@
1
+
2
+ .manager--campaigns-index
3
+ %h5
4
+ = link_to 'Campaigns', campaigns_path
5
+ (#{@campaigns.count})
6
+ = link_to raw("<i class='fa fa-plus-square'></i>"), new_campaign_path
7
+ -# = link_to '(done)', done_campaigns_path
8
+
9
+ %table
10
+ %tr
11
+ %th &nbsp;
12
+ %th Created At
13
+ %th Company
14
+ %th Email
15
+ %th Job Url
16
+ %th Description
17
+ - @campaigns.each do |campaign|
18
+ %tr
19
+ %td= link_to raw('<i class="fa fa-play"></i>'), campaign_path( campaign )
20
+ %td= pretty_date campaign.created_at
21
+ %td= campaign.company
22
+ %td= link_to raw('<i class="fa fa-envelope"></i>'), "mailto:#{campaign.email}"
23
+ %td= link_to raw('<i class="fa fa-user-md"></i>'), campaign.job_url, :target => '_blank'
24
+ %td= campaign.description
@@ -7,6 +7,10 @@
7
7
  - edit_url = -> (feature) { edit_site_feature_path( site.id, feature.id ) }
8
8
  - delete_url = -> (feature) { site_feature_path( site.id, feature.id ) }
9
9
  - new_path = new_site_feature_path( site.id )
10
+ - if defined? tag
11
+ - edit_url = -> (feature) { edit_tag_feature_path( tag.id, feature.id ) }
12
+ - delete_url = -> (feature) { tag_feature_path( tag.id, feature.id ) }
13
+ - new_path = new_tag_feature_path( tag.id )
10
14
 
11
15
  .manager-features--index
12
16
  %h3
@@ -1,16 +1,15 @@
1
1
 
2
2
  = form_for newsitem, :html => { :multipart => true } do |f|
3
- - if @site
4
- = hidden_field_tag :site_id, @site.id
5
- - elsif @city
6
- = hidden_field_tag :city_id, @city.id
7
- - else
3
+ .a
8
4
  = f.label :site
9
- = f.select :site_id, options_for_select( @sites )
5
+ = f.select :site_id, options_for_select( @sites, :selected => ( @site ? @site.id : nil ) )
10
6
  %br
11
7
  = f.label :city
12
- = f.select :city_id, options_for_select( @cities )
13
-
8
+ = f.select :city_id, options_for_select( @cities, :selected => ( @city ? @city.id : nil ) )
9
+ %br
10
+ = f.label :tag
11
+ = f.select :tag_id, options_for_select( @tags, (@tag||Tag.new).id )
12
+
14
13
  .a
15
14
  = f.label :name
16
15
  = f.text_field :name
@@ -7,13 +7,17 @@
7
7
  - edit_url = ->(n) { edit_city_newsitem_path( city, n ) }
8
8
  - delete_url = ->(n) { city_newsitem_path( city, n ) }
9
9
  - new_newsitem = new_city_newsitem_path( city.id )
10
-
10
+ - if defined? tag
11
+ - edit_url = ->(n) { edit_tag_newsitem_path( tag, n ) }
12
+ - delete_url = ->(n) { tag_newsitem_path( tag, n ) }
13
+ - new_newsitem = new_tag_newsitem_path( tag.id )
14
+
11
15
  - newsitems = newsitems.page( params[:newsitems_page] ).per( 10 )
12
16
 
13
17
  .manager-newsitems--index
14
18
  .row
15
19
  .col-sm-12
16
- %h2 Newsitems (#{newsitems.count}) #{link_to '[+]', new_newsitem }
20
+ %h3 Newsitems (#{newsitems.count}) #{link_to image_new, new_newsitem }
17
21
  = paginate newsitems, :param_name => 'newsitems_page', :views_prefix => 'ish_manager'
18
22
  - newsitems.each do |n|
19
23
  .panel
@@ -3,8 +3,8 @@
3
3
  -# ish_manager / tags / _form
4
4
  -#
5
5
 
6
- .row
7
- = form_for @tag do |f|
6
+ = form_for @tag do |f|
7
+ .row
8
8
  .col-xs-12.col-md-6
9
9
  .input-field
10
10
  = f.label :name
@@ -13,21 +13,26 @@
13
13
  .input-field
14
14
  = f.label :name_seo
15
15
  = f.text_field :name_seo
16
+ .row
16
17
  .col-xs-12.col-md-6
17
18
  .input-field
18
- = f.label "parent tag"
19
19
  = f.select :parent_tag_id, options_for_select( @tags_list, :selected => ( params[:for_tag] || @tag.parent_tag_id ) )
20
+ = f.label "parent tag"
20
21
  .col-xs-12.col-md-6
21
22
  .input-field
22
- = f.label "site"
23
23
  = f.select :site, options_for_select( @sites_list, :selected => @tag.site_id )
24
- .col-xs-12.col-md-12
25
- .input
26
- = f.check_box :is_public
27
- = f.label :is_public
28
- .input
29
- = f.check_box :is_trash
30
- = f.label :is_trash
31
- .actions
32
- %br
33
- = f.submit
24
+ = f.label "site"
25
+ .row
26
+ .col-xs-12.col-md-3
27
+ = f.check_box :is_public
28
+ = f.label :is_public
29
+ .col-xs-12.col-md-3
30
+ = f.check_box :is_feature
31
+ = f.label :is_feature
32
+ .col-xs-12.col-md-3
33
+ = f.check_box :is_trash
34
+ = f.label :is_trash
35
+ .row
36
+ .actions
37
+ %br
38
+ = f.submit
@@ -1,6 +1,8 @@
1
1
 
2
2
  %li
3
3
  %div
4
+ - if tag.is_feature
5
+ %i.fa.fa-exclamation
4
6
  = link_to tag.name, tag_path(tag)
5
7
  = link_to '[+]', new_tag_path( :for_tag => tag.id )
6
8
  = link_to '[~]', edit_tag_path( tag )
@@ -1,4 +1,4 @@
1
1
 
2
2
  %h3
3
- Edit Tag #{@tag.name}
3
+ Edit Tag #{link_to @tag.name, tag_path(@tag)}
4
4
  = render 'form', :tag => @tag
@@ -5,7 +5,7 @@
5
5
  Topic #{@tag.name}
6
6
 
7
7
  .row
8
- .large-12.columns
8
+ .col-sm-12
9
9
  %h5.center
10
10
  Tag
11
11
  = @tag.name
@@ -15,7 +15,11 @@
15
15
  -# = render 'ads/leaderboard'
16
16
  -# .descr= @tag.descr # I don't wanna show this every time to everyone, they know what they are here for.
17
17
  = render 'ish_manager/features/index', :features => @tag.features[0, Tag.n_features]
18
-
18
+
19
+ .row
20
+ .col-sm-12
21
+ = render 'ish_manager/newsitems/index', :newsitems => @tag.newsitems, :resource => @tag, :tag => @tag
22
+
19
23
  .row
20
24
  .col-sm-6
21
25
  = render 'ish_manager/reports/index', :reports => @tag.reports, :n_ads => 0
data/config/routes.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  IshManager::Engine.routes.draw do
2
2
  root :to => 'application#home'
3
3
 
4
+ resources :campaigns
5
+
4
6
  resources :cities do
5
7
  resources :features
6
8
  resources :newsitems
@@ -57,7 +59,14 @@ IshManager::Engine.routes.draw do
57
59
  resources :stock_options
58
60
  resources :stock_watches
59
61
 
60
- resources :tags
62
+ resources :tags do
63
+ resources :features
64
+ resources :newsitems
65
+
66
+ resources :reports
67
+ resources :galleries
68
+ resources :videos
69
+ end
61
70
 
62
71
  resources :user_profiles
63
72
  # resources :user_profiles, :as => :ish_models_user_profiles
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.137
4
+ version: 0.1.8.138
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-23 00:00:00.000000000 Z
11
+ date: 2018-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -154,6 +154,7 @@ files:
154
154
  - app/assets/stylesheets/ish_manager/trash/bootstrap.min.css.map
155
155
  - app/controllers/ish_manager/ally_controller.rb
156
156
  - app/controllers/ish_manager/application_controller.rb
157
+ - app/controllers/ish_manager/campaigns_controller.rb
157
158
  - app/controllers/ish_manager/cities_controller.rb
158
159
  - app/controllers/ish_manager/events_controller.rb
159
160
  - app/controllers/ish_manager/features_controller.rb
@@ -200,6 +201,7 @@ files:
200
201
  - app/views/ish_manager/application_mailer/shared_galleries.html.erb
201
202
  - app/views/ish_manager/application_mailer/stock_alert.html.erb
202
203
  - app/views/ish_manager/application_mailer/welcome.html.erb
204
+ - app/views/ish_manager/campaigns/index.haml
203
205
  - app/views/ish_manager/cities/_form.haml
204
206
  - app/views/ish_manager/cities/_header.haml
205
207
  - app/views/ish_manager/cities/edit.haml