app/views/memberships/index.html.haml in artfully_ose-1.2.0.pre.4 vs app/views/memberships/index.html.haml in artfully_ose-1.2.0.pre.5
- old
+ new
@@ -17,11 +17,13 @@
%li
= link_to "Partial Refund", "#partial-refund", 'data-toggle' => 'modal'
%li
= link_to "Change Expiration", "#extend", 'data-toggle' => 'modal'
%li
- = link_to "Cancel", "#cancel", 'data-toggle' => 'modal'
+ = link_to "Change Membership", "#change", 'data-toggle' => 'modal'
+ %li
+ = link_to "Cancel Membership", "#cancel", 'data-toggle' => 'modal'
.span6.right
= icon_link_to("View Record", person_path(@person), 'icon-share-alt', 'btn', '')
= link_to "Log In", "#", 'data-toggle' => 'modal', :class => 'btn'
= link_to "Reset Password", "#", 'data-toggle' => 'modal', :class => 'btn btn-danger'
@@ -44,51 +46,109 @@
%td=l membership.starts_at, :format => :slashed_date
%td=l membership.ends_at, :format => :slashed_date
%td.price.right=number_as_cents membership.sold_price
%td.fee.right TODO
- #full-refund.modal
- .modal-header
- .close{'data-dismiss'=>'modal'} x
- %h3 Refund Membership
- .modal-body
- %p="#{@person} will receive a full refund for these memberships"
- .modal-footer
- =link_to "Process Refund", "#", :class => "btn btn-success", 'data-dismiss'=>'modal'
- =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
+ #full-refund.modal
+ .modal-header
+ .close{'data-dismiss'=>'modal'} x
+ %h3 Refund Membership
+ .modal-body
+ %p="#{@person} will receive a full refund for these memberships"
+ .modal-footer
+ =link_to "Process Refund", "#", :class => "btn btn-success", 'data-dismiss'=>'modal'
+ =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
- #partial-refund.modal
+ #change.modal
+ =form_tag "#", :class => "form-horizontal", :method => :post do
.modal-header
.close{'data-dismiss'=>'modal'} x
- %h3 Refund Membership
+ %h3 Change Membership
.modal-body
.control-group
- %label Enter refund amount:
+ %label.control-label="Membership Type"
.controls
- =text_field_tag "whatever", "", :class => "currency"
- %p="#{@person} will receive a partial refund for the above amount and these memberships will be cancelled."
- .modal-footer
- =link_to "Process Refund", "#", :class => "btn btn-success", 'data-dismiss'=>'modal'
- =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
+ = select_tag :membership_type, options_from_collection_for_select(@membership_types, 'id', 'name')
- #cancel.modal
- .modal-header
- .close{'data-dismiss'=>'modal'} x
- %h3 Cancel Membership
- .modal-body
- %p="These memberships will be cancelled."
- .modal-footer
- =link_to "Cancel Memberhships", "#", :class => "btn btn-success", 'data-dismiss'=>'modal'
- =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
-
- #extend.modal
- .modal-header
- .close{'data-dismiss'=>'modal'} x
- %h3 Change Expiration
- .modal-body
.control-group
- %label Change the expiration of these memberships to:
+ %label.control-label Price per membership
.controls
- =text_field_tag "ends_at", "", :class => "datepicker"
- .modal-footer
- =submit_tag "Change Expiration", :class => "btn btn-success"
- =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
+ .input-prepend
+ %span.add-on $
+ = text_field_tag :sold_price, "", :class => 'span1'
+
+ #payment-controls.controls
+ %label.radio
+ = radio_button_tag(:payment_method, :cash, true, :class => 'payment-method', :humanized_value => 'Cash')
+ Cash
+ %label.radio
+ = radio_button_tag(:payment_method, :comp, false, :class => 'payment-method', :humanized_value => 'Comp')
+ Comp
+ %label.radio
+ = radio_button_tag(:payment_method, :credit_card_manual, false, :class => 'payment-method', :humanized_value => 'Credit card')
+ Credit
+
+ #payment-info.hidden.well
+ .control-group
+ %label.control-label="Name on Card"
+ .controls= text_field_tag("credit_card[name]", params[:cardholder_name])
+ .control-group
+ %label.control-label="Card Number"
+ .controls= text_field_tag("credit_card[number]", params[:card_number])
+ .control-group
+ %label.control-label="Expiration Date"
+ .date_field.controls
+ = select_tag("credit_card[month]", options_for_select(1..12, params["month"]), :class => 'input-small inline')
+ = select_tag("credit_card[year]", options_for_select(Time.now.year..Time.now.year + 10, params["year"]), :class => 'input-small inline')
+
+ .modal-footer
+ =link_to "Process Membership Change", "#", :class => "btn btn-success", 'data-dismiss'=>'modal'
+ =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
+
+ #partial-refund.modal
+ .modal-header
+ .close{'data-dismiss'=>'modal'} x
+ %h3 Refund Membership
+ .modal-body
+ .control-group
+ %label Enter refund amount:
+ .controls
+ =text_field_tag "whatever", "", :class => "currency"
+ %p="#{@person} will receive a partial refund for the above amount and these memberships will be cancelled."
+ .modal-footer
+ =link_to "Process Refund", "#", :class => "btn btn-success", 'data-dismiss'=>'modal'
+ =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
+
+ #cancel.modal
+ .modal-header
+ .close{'data-dismiss'=>'modal'} x
+ %h3 Cancel Membership
+ .modal-body
+ %p="These memberships will be cancelled."
+ .modal-footer
+ =link_to "Cancel Memberhships", "#", :class => "btn btn-success", 'data-dismiss'=>'modal'
+ =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
+
+ #extend.modal
+ .modal-header
+ .close{'data-dismiss'=>'modal'} x
+ %h3 Change Expiration
+ .modal-body
+ .control-group
+ %label Change the expiration of these memberships to:
+ .controls
+ =text_field_tag "ends_at", "", :class => "datepicker"
+ .modal-footer
+ =submit_tag "Change Expiration", :class => "btn btn-success"
+ =link_to "Cancel", "#", :class => "btn btn-danger", 'data-dismiss'=>'modal'
+
+-content_for :custom_js do
+ :javascript
+ $(".payment-method").change(function(){
+ if($(this).attr('value') != 'credit_card_manual'){
+ $("#payment-info").addClass("hidden");
+ $("#credit_card_number").val("")
+ $("#credit_card_name").val("")
+ } else {
+ $("#payment-info").removeClass("hidden");
+ }
+ });
\ No newline at end of file