app/views/segments/show.html.haml in artfully_ose-1.2.0 vs app/views/segments/show.html.haml in artfully_ose-1.3.0.pre1

- old
+ new

@@ -20,14 +20,19 @@ %li =link_to "Log action", "#bulk-action-modal", :id => 'bulk-action-link', 'data-toggle' => 'modal' %li = link_to "Delete this list segment", @segment, :method => :delete, :data => {:confirm => "Are you sure you want to delete #{@segment.name}?"} %li - = link_to 'Export all to CSV', segment_path(@segment, :format => :csv), :class => "artfully-tooltip", :rel => "tooltip", :data => {"original-title" => "To view all the data on patrons in this segment, including mailing address and phone numbers, export this segment to a CSV file.", :trigger => "hover", :placement => "right"} + = link_to 'Export all to CSV', segment_path(@segment, :format => :csv), :class => "remote-monitor", :rel => "tooltip" -with_kit(:membership) do %li =link_to "Comp Memberships", new_segment_membership_comp_path(@segment), :id => 'comp-memberships-link' + -with_kit(:mailchimp) do + %li + = link_to "Subscribe to MailChimp list", "#subscribe-modal", :data => { :toggle => "modal" } + %li + = link_to "Subscribe to MailChimp list group", "#subscribe-group-modal", :data => { :toggle => "modal" } .span8 %table.table.people-list %tbody - @people.each do |person| @@ -54,5 +59,35 @@ .modal-footer = submit_tag "Save", :class => "btn" #bulk-action-modal.action-form.modal = render :partial => 'actions/modal', :locals => {:action => Action.for_organization(current_user.current_organization), :target => @segment} + +- with_kit(:mailchimp) do + #subscribe-modal.modal + = form_tag subscribe_segment_path(@segment) do + .modal-header + .close{"data-dismiss" => "modal"} × + %h3 Susbcribe everyone in #{@segment.name} + .modal-body + %p + This will subscribe users that are not already subscribed to the list. They will receive a confirmation email and will only be subscribed if they accept the invitation. + + = label_tag "list_id", "List to subscribe users to" + = select_tag "list_id", options_for_select(mailchimp_lists_for_search(@segment)) + + .modal-footer + = submit_tag "Subscribe", :class => "btn" + #subscribe-group-modal.modal + = form_tag add_group_segment_path(@segment) do + .modal-header + .close{"data-dismiss" => "modal"} × + %h3 Susbcribe everyone in #{@segment.name} to a group + .modal-body + %p + This will only add users to a group if they are subscribed to the list already. + + = label_tag "grouping", "Group to add users to" + = select_tag "grouping", grouped_options_for_select(mailchimp_groups_for_search(@segment)) + + .modal-footer + = submit_tag "Subscribe", :class => "btn"