voluntary_classified_advertisement 0.3.0 → 0.3.1

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: aec7ac6a224d0308649e238c69b9e9fef327aa57
4
- data.tar.gz: 970a05e0b18a896868f1f0311458c6177f1975e4
3
+ metadata.gz: 65d3494a31fe98eea95f9a467be910816b1c87db
4
+ data.tar.gz: 98c0b50248cf9d37ccb482e73454d9af7afd1537
5
5
  SHA512:
6
- metadata.gz: da23cf8bd51cf0f6b648f5966f26582eeff549508a6467ec9ec75489b4bb8f1b8871775592bd1cee8a3f5c31cc2480195cb7c2a8cd5ffddf970936d8fdbbb7fd
7
- data.tar.gz: 730e52f3bcddc1977b305bd112d9a67312a590ed23eb6a400d421a101ce26561fd1c5e88f2d93203774656e132686bfddf753c0c0df5723df543df59930b157d
6
+ metadata.gz: 6ff5717c5f38947570afa223b05678c3adaada3f853a0a38b913ac08a8c911a73deed4efc1c6f008378c5115f268b3795abc58ceff6e8b888914c79144087270
7
+ data.tar.gz: 8beb7cd8fb136eb1238dcdc19fdb2e62fcd2b8f239db63a01f1bd8f3d85044aeea14c8b79350ffb760b39a3248c322a64c88c8d3b0454328625f50961c0e33ea
@@ -1,3 +1,10 @@
1
+ ## 0.3.1 (November 9, 2015) ##
2
+
3
+ * Take story location if task location not available.
4
+ * TRY to destroy vacancy after destroying task.
5
+ * Removes root from task events JSON.
6
+ * Init story location with current one.
7
+
1
8
  ## 0.3.0 (October 29, 2015) ##
2
9
 
3
10
  * [#7](https://github.com/volontariat/voluntary_classified_advertisement/issues/7) Custom task page
@@ -6,13 +6,13 @@ module ClassifiedAdvertisement
6
6
 
7
7
  def events
8
8
  @story = Story.find params[:story_id]
9
- tasks = @story.tasks.where(:from.gte => params[:start], :to.lt => params[:end])
9
+ tasks = @story.tasks.where(:from.gte => params[:start])
10
10
 
11
11
  tasks = tasks.map do |task|
12
12
  { title: task.name, url: task_path(task), start: task.from.to_s, end: task.to.to_s }
13
13
  end
14
14
 
15
- render json: tasks
15
+ render json: tasks, root: false
16
16
  end
17
17
 
18
18
  def sign_up_form
@@ -26,7 +26,7 @@ class Product::ClassifiedAdvertisement::Task < ::Task
26
26
  end
27
27
 
28
28
  def vacancy
29
- @vacancy ||= new_record? ? vacancy_class.new(task: self) : vacancy_class.find(vacancy_id)
29
+ @vacancy ||= new_record? ? vacancy_class.new(task: self) : vacancy_class.where(id: vacancy_id).first
30
30
  end
31
31
 
32
32
  def vacancy_class
@@ -102,6 +102,6 @@ class Product::ClassifiedAdvertisement::Task < ::Task
102
102
  end
103
103
 
104
104
  def destroy_non_mongodb_records
105
- vacancy.destroy
105
+ vacancy.try(:destroy)
106
106
  end
107
107
  end
@@ -70,7 +70,7 @@
70
70
  <% end %>
71
71
 
72
72
  <p style="margin-top:15px;">
73
- <%= link_to new_story_task_path(@story), class: 'btn btn-default' do %>
73
+ <%= link_to new_story_task_path(@story), class: 'btn btn-default new_task_link' do %>
74
74
  <span class="glyphicon glyphicon-plus"></span> <%= t("tasks.new.title") %>
75
75
  <% end %>
76
76
  </p>
@@ -1,6 +1,6 @@
1
1
  <%= simple_form_for(@task, url: @task.new_record? ? tasks_path : task_path(@task), as: :task, html: {class: 'form-vertical', style: 'margin-bottom:15px;'}) do |f| %>
2
2
  <%= hidden_field_tag :story_id, @task.story_id %>
3
- <%= f.input :name %>
3
+ <%= f.input :name, required: true %>
4
4
  <%= f.input :text, as: :text %>
5
5
 
6
6
  <fieldset class="fieldset" style="border: 1px solid black; padding:15px; margin-top:15px;">
@@ -101,8 +101,13 @@
101
101
  <% end %>
102
102
 
103
103
  <% content_for :document_ready do %>
104
- var lat = "<%= @task.lat %>";
105
- var lon = "<%= @task.lon %>";
104
+ <% if @task.lat.present? %>
105
+ var lat = "<%= @task.lat %>";
106
+ var lon = "<%= @task.lon %>";
107
+ <% else %>
108
+ var lat = "<%= @story.lat %>";
109
+ var lon = "<%= @story.lon %>";
110
+ <% end %>
106
111
 
107
112
  function initLocationPicker(position) {
108
113
  options = {
@@ -3,11 +3,11 @@
3
3
  <%= link_to t('tasks.show.change_signing'), change_signing_task_path(task.id), class: 'btn btn-warning btn-xs remote_modal_link' %>
4
4
  <% end %>
5
5
 
6
- <%= link_to t('general.sign_out'), sign_out_task_path(task.id), method: :delete, remote: true, data: { confirm: t('general.questions.are_you_sure') }, class: 'btn btn-danger btn-xs' %>
6
+ <%= link_to t('general.sign_out'), sign_out_task_path(task.id), method: :delete, remote: true, data: { confirm: t('general.questions.are_you_sure') }, class: 'btn btn-danger btn-xs sign_out_task_link' %>
7
7
  <% else %>
8
8
  <% if (task.vacancy.limit.blank? || accepted_candidatures_amount < task.vacancy.limit) && !task.vacancy.ended? %>
9
9
  <% if task.vacancy.resource_type == 'User' %>
10
- <%= link_to t('general.sign_up'), sign_up_task_path(task.id), method: :put, remote: true, class: 'btn btn-success btn-xs' %>
10
+ <%= link_to t('general.sign_up'), sign_up_task_path(task.id), method: :put, remote: true, class: 'btn btn-success btn-xs sign_up_task_link' %>
11
11
  <% else %>
12
12
  <%= link_to t('general.sign_up'), sign_up_task_path(task.id), class: 'btn btn-success btn-xs remote_modal_link' %>
13
13
  <% end %>
@@ -32,14 +32,32 @@
32
32
  <% end %>
33
33
 
34
34
  <% content_for :document_ready do %>
35
- $('#story_map').locationpicker({
36
- location: {latitude: <%= @story.lat ? @story.lat : 'null' %>, longitude: <%= @story.lon ? @story.lon : 'null' %>},
37
- radius: 300,
38
- inputBinding: {
39
- latitudeInput: $('#story_lat'),
40
- longitudeInput: $('#story_lon'),
41
- locationNameInput: $('#story_address')
42
- },
43
- enableAutocomplete: true
44
- });
35
+ var lat = "<%= @story.lat %>";
36
+ var lon = "<%= @story.lon %>";
37
+
38
+ function initLocationPicker(position) {
39
+ options = {
40
+ radius: 300,
41
+ inputBinding: {
42
+ latitudeInput: $('#story_lat'),
43
+ longitudeInput: $('#story_lon'),
44
+ locationNameInput: $('#story_address')
45
+ },
46
+ enableAutocomplete: true
47
+ }
48
+
49
+ if(position) {
50
+ options['location'] = { latitude: position.coords.latitude, longitude: position.coords.longitude }
51
+ } else if (lat != "") {
52
+ options['location'] = { latitude: lat, longitude: lon }
53
+ }
54
+
55
+ $('#story_map').locationpicker(options);
56
+ }
57
+
58
+ if(lat == "" && navigator.geolocation) {
59
+ navigator.geolocation.getCurrentPosition(initLocationPicker);
60
+ } else {
61
+ initLocationPicker(null);
62
+ }
45
63
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module VoluntaryClassifiedAdvertisement
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voluntary_classified_advertisement
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Gawlista
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-29 00:00:00.000000000 Z
11
+ date: 2015-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: voluntary
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.7.1
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.7'
22
+ version: '1.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.7.1
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.7'
32
+ version: '1.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: voluntary_recruiting
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -276,7 +282,7 @@ dependencies:
276
282
  - - "~>"
277
283
  - !ruby/object:Gem::Version
278
284
  version: 0.7.1
279
- description: "#Crowdsourcing plugin: http://bit.ly/vca-0-3-0"
285
+ description: 'Plugin for #Crowdsourcing system Voluntary.Software: http://bit.ly/vca-0-3-1'
280
286
  email:
281
287
  - gawlista@gmail.com
282
288
  executables: []