caboose-rets 0.1.61 → 0.1.62

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: b00afb48aa156904bea1d687ada551acace81dc9
4
- data.tar.gz: 280ef99d015f0bc7e1f51dbc425135db3037371a
3
+ metadata.gz: 1bce9df7d067c2323400487592f9c04e4c6207d5
4
+ data.tar.gz: fa4ca53b793b11ee9a1f66742f3e4f0f1526a259
5
5
  SHA512:
6
- metadata.gz: a5e11d0165636a89d7e99e4bfca8f3f7b0762d6e2b427fd3fd6e807f589d738e25f28e9238360e70c00b38e36c87b3a3606b4eb51ff65fa976ceba995035b618
7
- data.tar.gz: 3665780f55209cbcee75965a51b01f835d92a6a11d234973aa897f0cfeee708e5f0f463e32f032986970a029d3f01c1e31de332cc8dc9a84e11aee7e00909115
6
+ metadata.gz: 4f87db61d715251650549a9f13ef0c280871e79fd4f675491a5fe29cf8e08e33afecb57a65da8d8baf56dbd2e190574dc2a788fad02aa8a8e811f2fabf0d9f10
7
+ data.tar.gz: baaaf36b7584999b37b155445b88c4fdd6d18ee0f335e94a0eecc687427114d40a7e3567a4515471b36b71708575a2aa8aa6e6fe65fe7da2fda5682198e06bbc
@@ -63,27 +63,21 @@ module CabooseRets
63
63
 
64
64
  # @route GET /admin/agents/edit-sort
65
65
  def admin_edit_sort
66
- if !user_is_allowed_to 'edit', 'rets_agents'
67
- Caboose.log("invalid permissions")
68
- else
69
- @agents = Agent.where(:office_mls_id => @site.rets_office_id).order(:sort_order).all
70
- render :layout => 'caboose/admin'
71
- end
66
+ return unless user_is_allowed_to 'edit', 'rets_agents'
67
+ @agents = Agent.where(:office_mls_id => @site.rets_office_id).order(:sort_order).all
68
+ render :layout => 'caboose/admin'
72
69
  end
73
70
 
74
71
  # @route PUT /admin/agents/update-sort
75
72
  def admin_update_sort
76
73
  resp = Caboose::StdClass.new
77
- if !user_is_allowed_to 'edit', 'rets_agents'
78
- Caboose.log("invalid permissions")
79
- else
80
- params[:agent].each_with_index do |ag, ind|
81
- agent = Agent.find(ag)
82
- agent.sort_order = ind
83
- agent.save
84
- end
85
- resp.success = true
74
+ return unless user_is_allowed_to 'edit', 'rets_agents'
75
+ params[:agent].each_with_index do |ag, ind|
76
+ agent = Agent.find(ag)
77
+ agent.sort_order = ind
78
+ agent.save
86
79
  end
80
+ resp.success = true
87
81
  render :json => resp
88
82
  end
89
83
 
@@ -115,7 +109,6 @@ module CabooseRets
115
109
  render :json => resp
116
110
  end
117
111
 
118
-
119
112
  # @route POST /admin/agents/:id/image
120
113
  def admin_update_image
121
114
  render :json => false and return unless user_is_allowed_to 'edit', 'rets_agents'
@@ -128,6 +121,5 @@ module CabooseRets
128
121
  render :text => resp.to_json
129
122
  end
130
123
 
131
-
132
124
  end
133
- end
125
+ end
@@ -96,7 +96,7 @@ module CabooseRets
96
96
  # @route GET /properties/:mls_number/details
97
97
  def details
98
98
  @property = Property.where(:mls_number => params[:mls_number]).first
99
- @agent = Agent.where(:matrix_unique_id => @property.list_agent_mui, :office_mls_id => @site.rets_office_id).first
99
+ @agent = Agent.where(:matrix_unique_id => @property.list_agent_mui, :office_mls_id => @site.rets_office_id).first if @property
100
100
  @saved = logged_in? && SavedProperty.where(:user_id => logged_in_user.id, :mls_number => params[:mls_number]).exists?
101
101
  if @property.nil?
102
102
  @mls_number = params[:mls_number]
@@ -5,7 +5,7 @@
5
5
 
6
6
  <h1>Agent</h1>
7
7
 
8
- <% if @logged_in_user && @logged_in_user.is_allowed('add', 'rets_agents') %>
8
+ <% if @logged_in_user && @logged_in_user.is_allowed('rets_agents', 'add') %>
9
9
  <a href="/admin/agents/edit-sort" class="caboose-btn">Edit Sort Order</a>
10
10
  <% end %>
11
11
 
@@ -1,3 +1,3 @@
1
1
  module CabooseRets
2
- VERSION = '0.1.61'
2
+ VERSION = '0.1.62'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-rets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.61
4
+ version: 0.1.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-08 00:00:00.000000000 Z
11
+ date: 2018-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caboose-cms