hobo_rapid 2.0.0.pre5 → 2.0.0.pre6

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -3,3 +3,5 @@ RAPID is the standard Hobo tag library.
3
3
  #### Note
4
4
 
5
5
  Many of the tags require a javascript plugin such as hobo_jquery to function.
6
+
7
+ The `<live-search>` tag requires an implementation of `<search-results-container>`. This can be provided by hobo-jquery-ui or hobo-bootstrap-ui.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.pre5
1
+ 2.0.0.pre6
@@ -10,8 +10,7 @@ module HoboRapidHelper
10
10
  AJAX_PUSHSTATE_ATTRS = [:push_state, :new_title]
11
11
 
12
12
  AJAX_ATTRS = AJAX_CALLBACKS + AJAX_UPDATE_ATTRS + AJAX_EFFECT_ATTRS + AJAX_SPINNER_ATTRS + AJAX_PUSHSTATE_ATTRS +
13
- [:params, :errors_ok,
14
- :reset_form, :refocus_form ]
13
+ [:errors_ok, :reset_form, :refocus_form ]
15
14
 
16
15
  def app_name(add_subsite=true)
17
16
  an = Rails.application.config.hobo.app_name
@@ -140,7 +139,7 @@ module HoboRapidHelper
140
139
  (attrs[:lifecycle].nil? && new_record && !this.creatable_by?(current_user)) ||
141
140
  (attrs[:lifecycle].nil? && !new_record && !can_edit?))
142
141
  Dryml.last_if = false
143
- logger.info("unable to render form")
142
+ logger.info("permission denied; unable to render form")
144
143
  return nil
145
144
  else
146
145
  if method == "put" || method == "delete"
@@ -44,7 +44,7 @@ If the context is a `has_many :through` association, the polymorphic `<collectio
44
44
  no_edit = no_edit.to_sym
45
45
  no_edit_permission = !can_edit? unless no_edit == :ignore
46
46
  if no_edit_permission && no_edit == :view
47
- view
47
+ view(attributes)
48
48
  elsif no_edit_permission && no_edit == :skip
49
49
  ""
50
50
  else
@@ -24,26 +24,23 @@ Examples:
24
24
  </def>
25
25
 
26
26
  -->
27
- <def tag="select-date" attrs="use-month-numbers, use-short-month, add-month-numbers, use-month-names, date-separator, start-year, end-year, discard-day, discard-month, discard-year, order, include-blank, default, disabled, prompt, prefix">
27
+ <def tag="date-select" attrs="use-month-numbers, use-short-month, add-month-numbers, use-month-names, date-separator, start-year, end-year, discard-day, discard-month, discard-year, order, include-blank, default, disabled, prompt, prefix">
28
28
  <% order = order.nil? ? [:year, :month, :day] : comma_split(order).*.to_sym -%>
29
+ <% debugger %>
29
30
  <%= select_date(this || current_time,
30
31
  (all_attributes - attributes.keys).reverse_merge(:prefix => param_name_for_this).merge(:order => order),
31
32
  attributes - [:name]) %>
32
33
  </def>
33
34
 
34
35
 
35
- <%# Selects the `<datepicker>` as the default input for date. To
36
- choose the older `<select-date>` input, add this to your
37
- application.dryml:
38
-
39
- <def tag='input' for='date'>
40
- <select-date merge/>
41
- </def>
36
+ <%# Selects the `<select-date>` as the default input for date. select-date is pretty old-school; hobo_jquery_ui provides a much more pleasant datepicker.
42
37
  %>
43
38
  <def tag="input" for="Date">
44
- <datepicker merge/>
39
+ <date-select merge/>
45
40
  </def>
46
41
 
42
+
43
+
47
44
  <!-- A date/time picker, using the `select_time` helper from Rails
48
45
 
49
46
  ### Attributes
@@ -80,7 +80,7 @@ end
80
80
  <% js_attrs[:prefix] = param_name_for_this %>
81
81
  <ul class="input-many #{this_field.dasherize}" data-rapid="#{data_rapid('input-many', js_attrs, attributes)}" merge-attrs>
82
82
  <fake-field-context fake-field="-1" context="&template">
83
- <li class="input-many-li input-many-template" id="#{underize param_name_for_this}">
83
+ <li class="input-many-li input-many-template" id="#{underize param_name_for_this}" param>
84
84
  <div class="input-many-item" param="default">
85
85
  <field-list param merge-attrs="fields" skip="&skip" />
86
86
  </div>
@@ -90,7 +90,7 @@ end
90
90
  </div>
91
91
  </li>
92
92
  </fake-field-context>
93
- <li class="input-many-li empty #{'hidden' unless this.empty? and minimum==0}" id="#{underize param_name_for_this}_-1_empty">
93
+ <li class="input-many-li empty #{'hidden' unless this.empty? and minimum==0}" id="#{underize param_name_for_this}_-1_empty" param>
94
94
  <!-- HACK way to signal an empty collection to the controller -->
95
95
  <input type="hidden" class="empty-input" id="#{underize param_name_for_this}" name="#{param_name_for_this}" value="" disabled="&(!this.empty? || minimum>0)" />
96
96
  <fake-field-context fake-field="-1" context="&template">
@@ -106,7 +106,7 @@ end
106
106
  </fake-field-context>
107
107
  </li>
108
108
  <fake-field-context fake-field="0" context="&template">
109
- <li class="input-many-li" if="&(this_parent.empty? && minimum>0)" id="#{underize param_name_for_this}">
109
+ <li class="input-many-li" if="&(this_parent.empty? && minimum>0)" id="#{underize param_name_for_this}" param>
110
110
  <div class="input-many-item" param="default">
111
111
  <field-list param merge-attrs="fields" skip="&skip" />
112
112
  </div>
@@ -116,7 +116,7 @@ end
116
116
  </div>
117
117
  </li>
118
118
  </fake-field-context>
119
- <li repeat class="input-many-li #{'record-with-errors' unless this.errors.empty?}" id="#{underize param_name_for_this}">
119
+ <li repeat class="input-many-li #{'record-with-errors' unless this.errors.empty?}" id="#{underize param_name_for_this}" param>
120
120
  <error-messages without-heading class="sub-record"/>
121
121
  <hidden-id-field/>
122
122
  <div class="input-many-item" param="default">
@@ -23,22 +23,22 @@ All other attributes are merged into the form, so standard form attributes are s
23
23
  <input type="hidden" value="2" name="search_version"/>
24
24
  <label for="&query_param" param><t key="hobo.live_search.label">Search</t></label><input type="search" name="&query_param" class="live-search" param/>
25
25
  </form>
26
- <% panel_tag ||= 'dialog-box' %>
27
- <% title = t("hobo.live_search.results_label", :default => "Search Results") %>
28
- <call-tag tag="&panel_tag" position="center" width="&600" height="&800" id="search-results-box" with="&nil" title="&title" param="box">
29
- <do part="search-results-part">
30
- <search-results/>
31
- </do>
32
- </call-tag>
26
+ <do part="search-results-part">
27
+ <if test="&defined?(@search_results)">
28
+ <search-results-container with="&@search_results || []" title="&t('hobo.live_search.results_label', :default => 'Search Results')"/>
29
+ </if>
30
+ </do>
33
31
  </div>
34
32
  </def>
35
33
 
36
34
  <!-- redefining or extending this tag will allow you to customize the display of search results -->
37
35
  <def tag="search-results">
38
- <section with="&@search_results || []" data-rapid='{"search-results": {}}'>
36
+ <section param>
39
37
  <collection param>
40
38
  <search-card/>
41
39
  </collection>
42
- <else><t key="hobo.live_search.no_results">Your search returned no matches.</t></else>
40
+ <else>
41
+ <t key="hobo.live_search.no_results">Your search returned no matches.</t>
42
+ </else>
43
43
  </section>
44
44
  </def>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo_rapid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre5
4
+ version: 2.0.0.pre6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-02 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hobo
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 2.0.0.pre5
21
+ version: 2.0.0.pre6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 2.0.0.pre5
29
+ version: 2.0.0.pre6
30
30
  description: The RAPID tag library for Hobo
31
31
  email: tom@tomlocke.com
32
32
  executables: []