Top level actions #12

Merged
merged 7 commits into from Feb 25, 2014

Projects

None yet

2 participants

@elvanja

Changelog:

  • displaying errors -> error nicely
  • supporting groups for form inputs
elvanja added some commits Feb 22, 2014
@elvanja elvanja Top level actions:
* displaying errors -> error nicely
* supporting groups for form inputs
38c571d
@elvanja elvanja Top level actions:
* group values default to hash
* group parameters correctly propagated to form
* group rendering finished
93c2f9e
@elvanja elvanja Top level actions:
* added help for groups and multiples
* groups can now have nested multiples
b6b18a9
@levity levity commented on an outdated diff Feb 24, 2014
lib/deckhand/form.rb
block.call
+ @current_group_input[:inputs][name] = @current_multiple_input if @current_group_input
@levity
levity Feb 24, 2014

combine this with the unless block above (change it to an if-else)

@levity levity commented on an outdated diff Feb 24, 2014
...ews/deckhand/templates/modal_form/_multiple.html.haml
@@ -0,0 +1,10 @@
+%fieldset
+ %legend
+ = multiple[:label] || readable_method_name(name)
+ -unless multiple[:help].blank?
+ %span.btn.glyphicon.glyphicon-question-sign(tooltip="#{multiple[:help].html_safe}" tooltip-trigger="mouseenter")
@levity
levity Feb 24, 2014

align the baseline of this element with the baseline of the legend text

@levity levity commented on an outdated diff Feb 24, 2014
app/views/deckhand/templates/modal_form/_group.html.haml
@@ -0,0 +1,13 @@
+%fieldset(ng-init="isCollapsed_#{name} = true")
+ %legend(ng-click="isCollapsed_#{name} = !isCollapsed_#{name}")
+ = group[:label] || readable_method_name(name)
+ -unless group[:help].blank?
+ %span.btn.glyphicon.glyphicon-question-sign(tooltip="#{group[:help].html_safe}" tooltip-trigger="mouseenter")
+ %a.glyphicon.glyphicon-chevron-right(ng-show="isCollapsed_#{name}")
@levity
levity Feb 24, 2014

position these like we do for relation tables on cards

@levity levity commented on an outdated diff Feb 24, 2014
app/views/deckhand/templates/modal_form.html.haml
%span(ng-show="prompt") {{prompt}}
%form.form-horizontal
- @inputs.each do |name, options|
- = render 'deckhand/templates/modal_form/input', name: name, options: options, prefix: 'form'
-
- - (@input_groups || []).each do |group_name, group|
- %fieldset
- %legend
- = readable_method_name group_name
- %a.glyphicon.glyphicon-plus(ng-click="form.#{group_name}.push({})")
- .well(ng-repeat="nested_item in form.#{group_name}")
- %button.close(ng-click="form.#{group_name}.splice($index)") ×
- - group[:inputs].each do |name, options|
- = render 'deckhand/templates/modal_form/input', name: name, options: options, prefix: 'nested_item'
+ -if options[:multiple]
@levity
levity Feb 24, 2014

style note: spaces after dashes in HAML, please

elvanja added some commits Feb 24, 2014
@elvanja elvanja Top level actions:
* style fix, spaces after dashes
287cc81
@elvanja elvanja Top level actions:
* positioning group collapse, multiple add and help icons like on relation tables on cards
4236c4a
@elvanja elvanja Top level actions:
* form multiple refactoring
a8adeaf
@elvanja elvanja Top level actions:
* using RecursiveOpenStruct for parsed form values
* enables easier (non hash like) usage
d894104
@elvanja

Fixed all above issues.
Also, using RecursiveOpenStruct to be able to access form members in an easier way.

@elvanja

This is the only iffy place.
It works for new page action, but I am not sure whether it should resolve over group members?

Makes sense to me

@levity levity merged commit c18a22a into somawater:top_level_actions Feb 25, 2014
@elvanja elvanja deleted the elvanja:top_level_actions branch Feb 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment