ish_manager 0.1.1 → 0.1.2
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 +4 -4
- data/app/assets/javascripts/ish_manager/application.js +0 -1
- data/app/assets/stylesheets/ish_manager/application.css +4 -0
- data/app/controllers/ish_manager/application_controller.rb +1 -1
- data/app/controllers/ish_manager/features_controller.rb +125 -0
- data/app/controllers/ish_manager/galleries_controller.rb +86 -0
- data/app/controllers/ish_manager/newsitems_controller.rb +113 -0
- data/app/controllers/ish_manager/photos_controller.rb +55 -0
- data/app/controllers/ish_manager/reports_controller.rb +64 -0
- data/app/controllers/ish_manager/sites_controller.rb +2 -0
- data/app/controllers/ish_manager/tags_controller.rb +54 -0
- data/app/controllers/ish_manager/users_controller.rb +13 -0
- data/app/helpers/ish_manager/images_helper.rb +2 -1
- data/app/views/ish_manager/application/_main_footer.haml +6 -2
- data/app/views/ish_manager/cities/edit.haml +3 -3
- data/app/views/ish_manager/features/_form.haml +61 -0
- data/app/views/ish_manager/features/_index.haml +23 -0
- data/app/views/ish_manager/features/_item.haml +14 -0
- data/app/views/ish_manager/features/edit.haml +16 -0
- data/app/views/ish_manager/features/index.haml +25 -0
- data/app/views/ish_manager/features/new.haml +11 -0
- data/app/views/ish_manager/features/show.haml +0 -0
- data/app/views/ish_manager/galleries/#_thumbs.haml# +5 -0
- data/app/views/ish_manager/galleries/_form.haml +46 -0
- data/app/views/ish_manager/galleries/_index.haml +14 -0
- data/app/views/ish_manager/galleries/_list.haml +23 -0
- data/app/views/ish_manager/galleries/_list_short.haml +9 -0
- data/app/views/ish_manager/galleries/_menu_secondary.haml +13 -0
- data/app/views/ish_manager/galleries/_meta.haml +16 -0
- data/app/views/ish_manager/galleries/_search.haml +7 -0
- data/app/views/ish_manager/galleries/_thumbs.haml +12 -0
- data/app/views/ish_manager/galleries/_title.haml +17 -0
- data/app/views/ish_manager/galleries/all_photos.haml +4 -0
- data/app/views/ish_manager/galleries/edit.haml +11 -0
- data/app/views/ish_manager/galleries/index.haml +18 -0
- data/app/views/ish_manager/galleries/index_ajax.haml +9 -0
- data/app/views/ish_manager/galleries/index_mini.haml +0 -0
- data/app/views/ish_manager/galleries/index_short.haml +19 -0
- data/app/views/ish_manager/galleries/index_thumb.haml +16 -0
- data/app/views/ish_manager/galleries/index_title.haml +15 -0
- data/app/views/ish_manager/galleries/index_trash.haml +20 -0
- data/app/views/ish_manager/galleries/new.haml +7 -0
- data/app/views/ish_manager/galleries/show.haml +34 -0
- data/app/views/ish_manager/newsitems/_form.haml +10 -0
- data/app/views/ish_manager/newsitems/_index.haml +17 -0
- data/app/views/ish_manager/newsitems/_item.haml +53 -0
- data/app/views/ish_manager/newsitems/edit.haml +14 -0
- data/app/views/ish_manager/newsitems/new.haml +16 -0
- data/app/views/ish_manager/photos/_meta.haml +9 -0
- data/app/views/ish_manager/photos/_multinew.haml +23 -0
- data/app/views/ish_manager/photos/show.haml +2 -0
- data/app/views/ish_manager/photos/without_gallery.haml +11 -0
- data/app/views/ish_manager/reports/_form.haml +42 -0
- data/app/views/ish_manager/reports/_index.haml +16 -0
- data/app/views/ish_manager/reports/edit.haml +6 -0
- data/app/views/ish_manager/reports/index.haml +26 -0
- data/app/views/ish_manager/reports/new.haml +5 -0
- data/app/views/ish_manager/reports/show.haml +18 -0
- data/app/views/ish_manager/sites/_form.haml +1 -1
- data/app/views/ish_manager/sites/edit.haml +2 -2
- data/app/views/ish_manager/sites/index.haml +7 -7
- data/app/views/ish_manager/videos/_index.haml +12 -0
- data/app/views/layouts/ish_manager/application.haml +2 -1
- data/config/routes.rb +4 -1
- data/lib/ish_manager.rb +2 -0
- data/lib/ish_manager/version.rb +1 -1
- metadata +80 -1
@@ -1,6 +1,7 @@
|
|
1
1
|
class IshManager::SitesController < IshManager::ApplicationController
|
2
2
|
|
3
3
|
def index
|
4
|
+
authorize! :index, @site
|
4
5
|
@sites = Site.all.order_by( :domainname => :desc, :lang => :desc )
|
5
6
|
end
|
6
7
|
|
@@ -12,6 +13,7 @@ class IshManager::SitesController < IshManager::ApplicationController
|
|
12
13
|
|
13
14
|
def show
|
14
15
|
@site = Site.find params[:id]
|
16
|
+
authorize! :show, @site
|
15
17
|
@galleries = @site.galleries.unscoped.where({ :is_trash => false }).page( params[:galleries_page] ).per( 10 )
|
16
18
|
@reports = @site.reports.unscoped.where({ :is_trash => false }).page( params[:reports_page] ).per( 10 )
|
17
19
|
@videos = @site.videos.page( params[:videos_page] ).per( 5 )
|
@@ -0,0 +1,54 @@
|
|
1
|
+
|
2
|
+
class Manager::TagsController < Manager::ManagerController
|
3
|
+
|
4
|
+
before_filter :set_lists
|
5
|
+
|
6
|
+
def index
|
7
|
+
@tags = Tag.unscoped
|
8
|
+
authorize! :index, Tag.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def show
|
12
|
+
@tag = Tag.unscoped.find params[:id]
|
13
|
+
authorize! :show, @tag
|
14
|
+
end
|
15
|
+
|
16
|
+
def new
|
17
|
+
@tag = Tag.new
|
18
|
+
authorize! :new, @tag
|
19
|
+
end
|
20
|
+
|
21
|
+
def create
|
22
|
+
@tag = Tag.create params[:tag].permit( :name, :name_seo, :descr, :is_public, :is_feature, :is_trash,
|
23
|
+
:weight, :parent_tag_id, :site_id )
|
24
|
+
authorize! :create, @tag
|
25
|
+
if @tag.save
|
26
|
+
flash[:notice] = 'Success.'
|
27
|
+
redirect_to manager_tags_path
|
28
|
+
else
|
29
|
+
puts! @tag.errors, "error creating tag."
|
30
|
+
flash[:error] = "No luck. #{@tag.errors.messages}"
|
31
|
+
render :action => :new
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def edit
|
36
|
+
@tag = Tag.unscoped.find params[:id]
|
37
|
+
authorize! :edit, @tag
|
38
|
+
end
|
39
|
+
|
40
|
+
def update
|
41
|
+
@tag = Tag.unscoped.find params[:id]
|
42
|
+
authorize! :update, @tag
|
43
|
+
if @tag.update_attributes params[:tag].permit( :name, :name_seo, :descr,
|
44
|
+
:is_public, :is_trash, :is_feature, :weight,
|
45
|
+
:site_id, :parent_tag_id )
|
46
|
+
flash[:notice] = 'Success.'
|
47
|
+
redirect_to manager_tags_path
|
48
|
+
else
|
49
|
+
flash[:error] = 'No luck.'
|
50
|
+
render :action => :new
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -3,8 +3,12 @@
|
|
3
3
|
%ul
|
4
4
|
%li ^__^
|
5
5
|
- if current_user
|
6
|
-
%li
|
6
|
+
%li
|
7
|
+
>[ #{current_user.email} ]<
|
8
|
+
%div{ :style => 'float: left' }= button_to '[x]', main_app.destroy_user_session_path, :method => :delete
|
7
9
|
- else
|
8
|
-
%li
|
10
|
+
%li
|
11
|
+
Please log in
|
12
|
+
= link_to '[+]', main_app.new_user_session_path
|
9
13
|
|
10
14
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
2
|
%h1.center= @city.name
|
3
|
-
= render 'form', :url =>
|
3
|
+
= render 'form', :url => city_path
|
4
4
|
%hr
|
5
5
|
|
6
6
|
.row
|
7
7
|
.small-12.columns
|
8
|
-
= render '
|
8
|
+
= render 'ish_manager/features/index', :features => @city.features, :city => @city
|
9
9
|
%hr
|
10
|
-
= render '
|
10
|
+
= render 'ish_manager/newsitems/index', :newsitems => @city.newsitems, :city => @city
|
11
11
|
|
@@ -0,0 +1,61 @@
|
|
1
|
+
|
2
|
+
-# manager/features/_form
|
3
|
+
|
4
|
+
- if @site
|
5
|
+
- if 'new' == params[:action]
|
6
|
+
- url = manager_site_features_path site.id
|
7
|
+
- if 'edit' == params[:action]
|
8
|
+
- url = manager_site_feature_path site.id, feature.id
|
9
|
+
- elsif @city
|
10
|
+
- if 'new' == params[:action]
|
11
|
+
- url = manager_city_features_path city.id
|
12
|
+
- if 'edit' == params[:action]
|
13
|
+
- url = manager_city_feature_path city.id, feature.id
|
14
|
+
- elsif @tag
|
15
|
+
- if 'new' == params[:action]
|
16
|
+
- url = manager_tag_features_path tag.id
|
17
|
+
- if 'edit' == params[:action]
|
18
|
+
- url = manager_tag_feature_path tag.id, feature.id
|
19
|
+
|
20
|
+
= form_for feature, :url => url do |f|
|
21
|
+
.row
|
22
|
+
.large-6.columns
|
23
|
+
= f.label :name
|
24
|
+
= f.text_field :name
|
25
|
+
%br
|
26
|
+
= f.label :subhead
|
27
|
+
= f.text_field :subhead
|
28
|
+
%br
|
29
|
+
= f.label :image_path
|
30
|
+
= f.text_field :image_path
|
31
|
+
%br
|
32
|
+
= f.label :link_path
|
33
|
+
= f.text_field :link_path
|
34
|
+
%br
|
35
|
+
= f.label :photo
|
36
|
+
= f.file_field :photo
|
37
|
+
.large-6.columns
|
38
|
+
= f.label :report
|
39
|
+
= select :feature, :report_id, @reports_list
|
40
|
+
%br
|
41
|
+
= f.label :gallery
|
42
|
+
= select :feature, :gallery_id, @galleries_list
|
43
|
+
%br
|
44
|
+
= f.label :video
|
45
|
+
= select :feature, :video_id, @videos_list
|
46
|
+
|
47
|
+
.row
|
48
|
+
%hr
|
49
|
+
.large-6.columns
|
50
|
+
%br
|
51
|
+
= f.label :weight
|
52
|
+
= f.text_field :weight
|
53
|
+
%br
|
54
|
+
= f.label :partial_name
|
55
|
+
= f.text_field :partial_name
|
56
|
+
.large-6.columns
|
57
|
+
.field
|
58
|
+
= f.label :inner_html
|
59
|
+
= f.text_area :inner_html
|
60
|
+
.actions
|
61
|
+
= f.submit
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
- if defined? city
|
3
|
+
- edit_url = -> (feature ) { edit_city_feature_path( city.id, feature.id ) }
|
4
|
+
- delete_url = -> (feature ) { city_feature_path( city.id, feature.id ) }
|
5
|
+
- new_path = new_city_feature_path( city.id )
|
6
|
+
- if defined? site
|
7
|
+
- edit_url = -> (feature) { edit_manager_site_feature_path( site.id, feature.id ) }
|
8
|
+
- delete_url = -> (feature) { manager_site_feature_path( site.id, feature.id ) }
|
9
|
+
- new_path = new_manager_site_feature_path( site.id )
|
10
|
+
|
11
|
+
.manager-features--index
|
12
|
+
%h2
|
13
|
+
Features (#{features.length})
|
14
|
+
= link_to '[+]', new_path
|
15
|
+
|
16
|
+
-# = paginate features, :param_name => 'features_page'
|
17
|
+
%ul.large-block-grid-4
|
18
|
+
- features.each_with_index do |feature, idx|
|
19
|
+
%li
|
20
|
+
= link_to '[~]', edit_url.call( feature )
|
21
|
+
= link_to '[x]', delete_url.call( feature ), :method => :delete, :data => { :confirm => 'Are you sure?' }
|
22
|
+
.item= render 'manager/features/item', :feature => feature
|
23
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
.panel
|
3
|
+
- if !feature.partial_name.blank?
|
4
|
+
= render feature.partial_name
|
5
|
+
- else
|
6
|
+
- unless feature[:name].blank?
|
7
|
+
%h3= link_to feature[:name].titleize, feature[:link_path]
|
8
|
+
- unless feature[:image_path].blank?
|
9
|
+
= link_to image_tag( feature[:image_path] ), feature[:link_path]
|
10
|
+
- unless feature[:subhead].blank?
|
11
|
+
.descr= raw feature[:subhead]
|
12
|
+
- unless feature.report.blank?
|
13
|
+
%h3= link_to feature.report.name, report_path(feature.report.name_seo)
|
14
|
+
.descr= raw feature.report.subhead
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
.row
|
3
|
+
.large-12.columns
|
4
|
+
%h1
|
5
|
+
Edit Feature
|
6
|
+
.meta
|
7
|
+
= "in city #{@feature.city.name}" unless @feature.city.blank?
|
8
|
+
= "in site http://#{@feature.site.domain}/#{@feature.site.lang}" unless @feature.site.blank?
|
9
|
+
= "in tag #{@feature.tag.name}" unless @feature.tag.blank?
|
10
|
+
|
11
|
+
- if @site
|
12
|
+
= render 'manager/features/form', :feature => @feature, :site => @site
|
13
|
+
- elsif @city
|
14
|
+
= render 'manager/features/form', :feature => @feature, :city => @city
|
15
|
+
- elsif @tag
|
16
|
+
= render 'manager/features/form', :feature => @feature, :tag => @tag
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
.row
|
3
|
+
.large-12.columns
|
4
|
+
%h5 Features in <b>#{@resource.class.name}</b> #{@resource.name}/
|
5
|
+
|
6
|
+
%ul
|
7
|
+
- @resource.features.each do |feature|
|
8
|
+
%li
|
9
|
+
.gray= feature.id
|
10
|
+
|
11
|
+
= link_to '[~]', edit_manager_city_feature_path( @resource, feature ) if 'City' == @resource.class.name
|
12
|
+
= link_to '[~]', edit_manager_tag_feature_path( @resource, feature ) if 'Tag' == @resource.class.name
|
13
|
+
= link_to '[~]', edit_manager_site_feature_path( @resource, feature ) if 'Site' == @resource.class.name
|
14
|
+
= link_to '[~]', edit_manager_venue_feature_path( @resource, feature ) if 'Venue' == @resource.class.name
|
15
|
+
|
16
|
+
= link_to( '[x]', manager_city_feature_path( @resource, feature ), :method => :delete, :data => { :confirm => :'Are you sure?' } ) if 'City' == @resource.class.name
|
17
|
+
= link_to( '[x]', manager_tag_feature_path( @resource, feature ), :method => :delete, :data => { :confirm => :'Are you sure?' } ) if 'Tag' == @resource.class.name
|
18
|
+
= link_to( '[x]', manager_site_feature_path( @resource, feature ), :method => :delete, :data => { :confirm => :'Are you sure?' } ) if 'Site' == @resource.class.name
|
19
|
+
= link_to( '[x]', manager_venue_feature_path( @resource, feature ), :method => :delete, :data => { :confirm => :'Are you sure?' } ) if 'Venue' == @resource.class.name
|
20
|
+
|
21
|
+
%ul
|
22
|
+
%li Name #{feature.name}
|
23
|
+
%li Subhead: #{feature.subhead}
|
24
|
+
%li Report: #{feature.report}
|
25
|
+
%li Gallery: #{feature.gallery}
|
File without changes
|
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
- url ||= manager_galleries_path
|
3
|
+
|
4
|
+
= form_for gallery, :url => url do |f|
|
5
|
+
.row
|
6
|
+
.large-12.columns
|
7
|
+
= f.label :name
|
8
|
+
= f.text_field :name
|
9
|
+
= gallery.galleryname
|
10
|
+
%br
|
11
|
+
%br
|
12
|
+
|
13
|
+
.row
|
14
|
+
.large-4.columns
|
15
|
+
= f.label :site
|
16
|
+
= select :gallery, :site_id, @sites_list
|
17
|
+
.large-4.columns
|
18
|
+
= f.label :city
|
19
|
+
= select :gallery, :city_id, @cities_list
|
20
|
+
.large-4.columns
|
21
|
+
= f.label :tag
|
22
|
+
= select :gallery, :tag_id, @tags_list
|
23
|
+
.large-4.columns
|
24
|
+
= f.label :user
|
25
|
+
= select :gallery, :user_id, @users_list
|
26
|
+
.large-4.columns.end
|
27
|
+
= f.label :venue
|
28
|
+
= select :gallery, :venue_id, @venues_list
|
29
|
+
|
30
|
+
.row
|
31
|
+
.large-3.columns
|
32
|
+
= f.label :is_public
|
33
|
+
= f.check_box :is_public
|
34
|
+
.large-3.columns
|
35
|
+
= f.label :is_done
|
36
|
+
= f.check_box :is_done
|
37
|
+
.large-3.columns
|
38
|
+
= f.label :is_trash
|
39
|
+
= f.check_box :is_trash
|
40
|
+
.large-3.columns
|
41
|
+
= f.label :is_feature
|
42
|
+
= f.check_box :is_feature
|
43
|
+
|
44
|
+
.row
|
45
|
+
.large-3.columns.end
|
46
|
+
= f.submit
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
.manager-galleries--index
|
3
|
+
.row
|
4
|
+
.large-12.columns
|
5
|
+
%h2 Galleries (#{galleries.length})
|
6
|
+
|
7
|
+
= paginate galleries, :param_name => :galleries_page
|
8
|
+
%ol
|
9
|
+
- galleries.each do |gallery|
|
10
|
+
%li
|
11
|
+
- gallery.photos.unscoped.where({ :is_trash => false })[0..4].each do |photo|
|
12
|
+
.mini= image_tag photo.photo.url( :mini ), :alt => ''
|
13
|
+
#{link_to gallery.name, manager_gallery_path( gallery )} (#{gallery.photos.unscoped.where({ :is_trash => false }).length})
|
14
|
+
= paginate galleries, :param_name => :galleries_page
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
- n_thumbs ||= 8
|
3
|
+
|
4
|
+
- if galleries.length > 0
|
5
|
+
.galleries--list
|
6
|
+
- galleries.each do |g|
|
7
|
+
.item
|
8
|
+
%h3
|
9
|
+
= link_to '[~]', edit_gallery_path( g.galleryname )
|
10
|
+
= link_to g.name, gallery_path(g.galleryname)
|
11
|
+
-# = render 'meta', :item => g
|
12
|
+
- if g.photos.length == 0
|
13
|
+
= image_missing
|
14
|
+
- else
|
15
|
+
- g.photos.each_with_index do |photo, idx|
|
16
|
+
- break if n_thumbs == idx + 1
|
17
|
+
= link_to image_tag(photo.photo.url(:thumb), :alt => g.name, :class => :thumb ), gallery_path(g.galleryname)
|
18
|
+
.c
|
19
|
+
|
20
|
+
= paginate galleries, :param_name => :galleries_page
|
21
|
+
|
22
|
+
- else
|
23
|
+
%h5 No Galleries
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
.galleries--meta
|
3
|
+
.row
|
4
|
+
.large-12.columns
|
5
|
+
- if gallery.site
|
6
|
+
Site #{link_to "http://#{gallery.site.domain}/#{gallery.site.lang}", site_path(gallery.site)}
|
7
|
+
- if gallery.user
|
8
|
+
User #{link_to gallery.user.username, user_path(gallery.user)}
|
9
|
+
- if gallery.tag
|
10
|
+
Tag #{link_to gallery.tag.name, tag_path(gallery.tag)}
|
11
|
+
- if gallery.city
|
12
|
+
City #{link_to gallery.city.name, city_path(gallery.city)}
|
13
|
+
- if gallery.venue
|
14
|
+
Venue #{link_to gallery.venue.name, venue_path(gallery.venue)}
|
15
|
+
- if gallery.is_trash
|
16
|
+
= trash_image_tag
|