ish_manager 0.1.8.435 → 0.1.8.436

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
  SHA256:
3
- metadata.gz: 798a7cda60e62a3ea1e31400a3bb56015da14defa0acf666e7a6192cbd3411ec
4
- data.tar.gz: e389d43d156cb5380f3664731b4d89d0310fcf6d14850914c5f33d146d7f017e
3
+ metadata.gz: 8fe0af2fe32744d65c81b4c43ece7e78dc43ed9f489d06b50d997a0eeae87ab2
4
+ data.tar.gz: b4b65f1f3e5f3eee1165abfed84b578ea1b1a160afa1dab15e7c1b421ecae2b6
5
5
  SHA512:
6
- metadata.gz: f165e36c5134c6e5adfa4f5bc2182917460fdab427bca8b1d3bbe7644fcab8668fbf509443480364d3dd2f154af768484d6b3d21f441ca6edf98c80b95a97aff
7
- data.tar.gz: d6aaff02e5dedb85b0809aae6a83196adab81f3cba8ce69639f5a20aee5abd379d34d852f12f26324285928e8f1fd416daa6497c12e437418de92598e21dc0fb
6
+ metadata.gz: 7469ea57788dff6abfb772046dbd54c88cbddd7f8f57b77fb5d16c4848fb13e47fbf6ba5b2f0709f48bf2061e9800a581e24a41e61751e98a4d689787316a6fa
7
+ data.tar.gz: 39beb58297123e266f857c567e2103dcd75662b8c2ab4f58ad1521211a5bd88113ce2f0eca1d1e1be65833975d02e2488348dc53cfe3d4f755460aeb3ee805fe
@@ -56,15 +56,16 @@ class IshManager::ReportsController < IshManager::ApplicationController
56
56
  def index
57
57
  authorize! :index, Report
58
58
  @reports = Report.unscoped.order_by( :created_at => :desc
59
- ).where( :is_trash => false, :user_profile => @current_profile
60
- ).page( params[:reports_page] ).per( Report::PER_PAGE )
59
+ ).where( :is_trash => false, :user_profile => @current_profile )
61
60
  if params[:q]
62
- @reports = @reports.or({ slug: /#{params[:q]}/i }, { name: /#{params[:q]}}/i }) # @TODO: why can't I have space in search term?
61
+ # @reports = @reports.or({ slug: /#{params[:q]}/i }, { name: /#{params[:q]}}/i }) # @TODO: why can't I have space in search term?
62
+ @reports = @reports.where({ :name => /#{params[:q]}/i })
63
63
  if @reports.length == 1
64
64
  redirect_to report_path(@reports[0])
65
65
  return
66
66
  end
67
67
  end
68
+ @reports = @reports.page( params[:reports_page] ).per( Report::PER_PAGE )
68
69
  end
69
70
 
70
71
  def new
@@ -94,6 +95,14 @@ class IshManager::ReportsController < IshManager::ApplicationController
94
95
  @report.update_attributes( :photo => photo, :updated_at => Time.now )
95
96
  end
96
97
 
98
+ old_shared_profile_ids = @report.shared_profiles.map(&:id)
99
+ if params[:report][:shared_profiles].present?
100
+ params[:report][:shared_profiles].delete('')
101
+ end
102
+ params[:report][:shared_profile_ids] = params[:report][:shared_profiles]
103
+ params[:report].delete :shared_profiles
104
+
105
+
97
106
  respond_to do |format|
98
107
  if @report.update_attributes(params[:report].permit!)
99
108
  format.html do
@@ -4,120 +4,114 @@
4
4
 
5
5
  - url ||= reports_path
6
6
  = form_for report, :url => url, :html => { :multipart => true } do |f|
7
- - if report.errors.any?
8
- #error_explanation
9
- %h3= t('e.there_are_errors')
10
- %ul
11
- - report.errors.full_messages.each do |msg|
12
- %li= msg
7
+
8
+ -# - if report.errors.any?
9
+ -# #error_explanation
10
+ -# %h3= t('e.there_are_errors')
11
+ -# %ul
12
+ -# - report.errors.full_messages.each do |msg|
13
+ -# %li= msg
13
14
 
14
15
  .row
15
- .col.s4
16
+ .col-md-6
16
17
  .field
17
18
  = f.label :"Name"
18
19
  = f.text_field :name, :class=> 'form-control', :placeholder => "name of report", :type => "text"
20
+ .field
19
21
  = f.label "Slug"
20
22
  = f.text_field :slug, :class=> 'form-control', :placeholder => "name seo", :type => "text"
21
-
22
- .col.s4
23
23
  .field
24
- = f.label :subhead
25
- = f.text_area :subhead, :class => 'form-control', :rows => "5", :style=> "resize: vertical;"
24
+ = f.label :created_at
25
+ = f.text_field :created_at
26
26
  .field
27
27
  = f.label "Item Type: default, longscroll"
28
28
  = f.text_field :item_type
29
29
 
30
- .col.s4
31
- .field
32
- = f.label :created_at
33
- = f.text_field :created_at
34
-
35
- .field
36
- = f.label :Description
37
- = f.text_area :descr, :class => 'tinymce'
38
- .field
39
- = f.label :raw_json
40
- = f.text_area :raw_json
41
-
42
- %br
30
+ .col-md-6
31
+ = render 'ish_manager/application/form_nonpublic', f: f, model: report
43
32
 
44
33
  .row
45
- .col.s4
34
+ .col-md-4
46
35
  .field
36
+ = f.label :Description
37
+ = f.text_area :descr
38
+ .col-md-4
39
+ .field
40
+ = f.label :raw_json
41
+ = f.text_area :raw_json
42
+ .col-md-4
43
+ .field
44
+ = f.label :subhead
45
+ = f.text_area :subhead, :class => 'form-control', :rows => "5", :style=> "resize: vertical;"
46
+
47
+ .row
48
+ .col-md-4
49
+ .field.my-row
47
50
  = f.label :Coordinates
48
- .panel.panel-default
49
- .panel-body
50
- .col.s6
51
- .form-group
52
- %label{} X-coordinate
53
- = f.text_field :x, :placeholder => "x", :type => "text", :class=>"form-control"
54
-
55
- .col.s6
56
- .form-group
57
- %label{} Y-coordinate
58
- = f.text_field :y, :placeholder => "y", :type => "text", :class=>"form-control"
59
- .col.s4
51
+ = f.text_field :x, :placeholder => "x", :type => "text", :class=>"form-control"
52
+ = f.text_field :y, :placeholder => "y", :type => "text", :class=>"form-control"
53
+ = f.text_field :z, :placeholder => "z", :type => "text", :class=>"form-control"
54
+
55
+
56
+ .col-md-4
60
57
  .field
61
58
  = f.label :premium_tier
62
59
  = f.number_field :premium_tier
63
60
  .field
64
61
  = f.label :user_profile
65
62
  = select :report, :user_profile_id, @user_profiles_list
66
- .col.s4
67
- unused
68
63
 
69
- .row
70
- .panel.panel-default
71
- .panel-heading
72
- %h3.panel-title Upload File
73
- .panel-body
74
- .row
75
- .col.s6.col.soffset-3
76
- %button.btn.btn-primary.btn-lg.btn-block{:type => "button", :onClick => "upload()"} Upload File
77
- = file_field_tag :photo, :style => "display:none", :id=>"photo"
78
- .div.center
79
- -# @TODO: wtf?
80
- %img#thumbnail_image_boy.img-thumbnail{:alt => "uploaded image", :width=>"200px"}
81
-
82
-
83
- :javascript
84
-
85
- $( document ).ready(function() {
86
- $(".caret").html("");
87
- });
88
-
89
- function upload(){
90
- document.getElementById("photo").click();
91
- }
64
+ .col-md-4
65
+ .panel.panel-default
66
+ .panel-heading
67
+ %h3.panel-title Upload File
68
+ .panel-body
69
+ .row
70
+ .col.s6.col.soffset-3
71
+ %button.btn.btn-primary.btn-lg.btn-block{:type => "button", :onClick => "upload()"} Upload File
72
+ = file_field_tag :photo, :style => "display:none", :id=>"photo"
73
+ .div.center
74
+ -# @TODO: wtf?
75
+ %img#thumbnail_image_boy.img-thumbnail{:alt => "uploaded image", :width=>"200px"}
76
+
77
+
78
+
92
79
 
93
- function handleFileSelect(evt) {
94
- var files = evt.target.files;
95
-
96
- // Loop through the FileList and render image files as thumbnails.
97
- for (var i = 0, f; f = files[i]; i++) {
98
- // Only process image files.
99
- if (f.type.match('image.*')) {
100
- var reader = new FileReader();
101
-
102
- reader.onload = function (e) {
103
- // get loaded data and render thumbnail.
104
- document.getElementById("thumbnail_image_boy").src = e.target.result;
105
- };
106
-
107
- // read the image file as a data URL.
108
- reader.readAsDataURL(f);
109
- }else{
110
- $("#photo").val("");
111
- alert("Only images accepted.");
112
- }
113
- }
114
- }
115
- document.getElementById('photo').addEventListener('change', handleFileSelect, false);
116
80
 
117
- .input
118
- = f.check_box :is_public
119
- = f.label :is_public
120
81
  .input
121
82
  = f.check_box :is_trash
122
83
  = f.label :is_trash
123
84
  %button.btn.btn-success{:type => "submit"} submit
85
+
86
+ :javascript
87
+ $( document ).ready(function() {
88
+ $(".caret").html("");
89
+ });
90
+
91
+ function upload(){
92
+ document.getElementById("photo").click();
93
+ }
94
+
95
+ function handleFileSelect(evt) {
96
+ var files = evt.target.files;
97
+
98
+ // Loop through the FileList and render image files as thumbnails.
99
+ for (var i = 0, f; f = files[i]; i++) {
100
+ // Only process image files.
101
+ if (f.type.match('image.*')) {
102
+ var reader = new FileReader();
103
+
104
+ reader.onload = function (e) {
105
+ // get loaded data and render thumbnail.
106
+ document.getElementById("thumbnail_image_boy").src = e.target.result;
107
+ };
108
+
109
+ // read the image file as a data URL.
110
+ reader.readAsDataURL(f);
111
+ }else{
112
+ $("#photo").val("");
113
+ alert("Only images accepted.");
114
+ }
115
+ }
116
+ }
117
+ document.getElementById('photo').addEventListener('change', handleFileSelect, false);
@@ -1,6 +1,5 @@
1
1
 
2
- .row
3
- .large-12.columns
2
+ .reports-edit.max-width
4
3
  %h1 Edit Report #{@report.name}
5
4
 
6
5
  = render 'form', :url => report_path(@report.id), :report => @report
@@ -1,29 +1,29 @@
1
1
 
2
2
  -# ish_manager / reports / index
3
3
 
4
- .row
5
- .large-12.columns
6
- %h3
7
- Reports (#{@reports.length})
8
- = link_to image_new, new_report_path
4
+ .reports-index.max-width
5
+ %h3
6
+ Reports (#{@reports.length})
7
+ = link_to image_new, new_report_path
9
8
 
10
- = paginate @reports, :param_name => :reports_page, :views_prefix => 'ish_manager'
9
+ = paginate @reports, :param_name => :reports_page, :views_prefix => 'ish_manager'
11
10
 
12
- - @reports.each do |report|
13
- .card
14
- .card-content
15
- = link_to '[~]', edit_report_path( report )
16
- .float-left= button_to '[x]', report_path( report ), :method => :delete, :data => { :confirm => 'Are you sure?' }
17
- - if report.is_public
18
- %i.material-icons visibility
19
- - else
20
- %i.material-icons visibility_off
21
- = link_to report.name, report_path( report )
22
- %br
23
- .gray
24
- = pp_date report.created_at
25
- - if report.photo
26
- = image_tag report.photo.photo.url :thumb
11
+ - @reports.each do |report|
12
+ .card
13
+ .card-content
14
+ = link_to '[~]', edit_report_path( report )
15
+ .float-left= button_to '[x]', report_path( report ), :method => :delete, :data => { :confirm => 'Are you sure?' }
16
+ - if report.is_public
17
+ %i.material-icons visibility
18
+ - else
19
+ %i.material-icons visibility_off
20
+ = link_to report.name, report_path( report )
21
+ %br
22
+ .gray
23
+ = pp_date report.created_at
24
+ slug: #{report.slug}
25
+ - if report.photo
26
+ = image_tag report.photo.photo.url :thumb
27
27
 
28
- = paginate @reports, :param_name => :reports_page, :views_prefix => 'ish_manager'
28
+ = paginate @reports, :param_name => :reports_page, :views_prefix => 'ish_manager'
29
29
 
@@ -1,20 +1,20 @@
1
1
 
2
- .manager-reports-show
3
- .row
4
- .large-12.columns
5
- %h1.flex-row
6
- = @report.name
7
- = link_to '[~]', edit_report_path( @report )
8
- = button_to '[x]', report_path( @report ), :method => :delete, :data => { :confirm => 'Are you sure?' }
2
+ .reports-show.max-width
9
3
 
10
- = render 'meta', item: @report
4
+ %h1.flex-row
5
+ = @report.name
6
+ = link_to '[~]', edit_report_path( @report )
7
+ = button_to '[x]', report_path( @report ), :method => :delete, :data => { :confirm => 'Are you sure?' }
11
8
 
12
- - if @report.subhead.length > 3
13
- .subhead= @report.subhead
9
+ = render 'meta', item: @report
10
+
11
+ - if @report.subhead.length > 3
12
+ .subhead= @report.subhead
13
+
14
+ .descr
15
+ - if @report.photo
16
+ .float-left= image_tag @report.photo.photo.url( :small )
17
+ = raw @report.descr
14
18
 
15
- .descr
16
- - if @report.photo
17
- .float-left= image_tag @report.photo.photo.url( :small )
18
- = raw @report.descr
19
19
  %hr
20
20
  = render 'form', :url => report_path(@report.id), :report => @report
@@ -1,7 +1,5 @@
1
1
 
2
2
  = form_for video do |f|
3
- -# = render 'form_errors', :item => @video
4
-
5
3
  .row
6
4
  .col.m6
7
5
  .field
@@ -29,8 +27,6 @@
29
27
  = f.select :user_profile_id, @user_profiles_list
30
28
  .row
31
29
  .col-md-6
32
- -# = f.check_box :is_public
33
- -# = f.label :is_public
34
30
  = render 'ish_manager/application/form_nonpublic', f: f, model: video
35
31
  .col-md-6
36
32
  = f.check_box :is_trash
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.435
4
+ version: 0.1.8.436
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox