app/views/caboose/invoices/admin_index.html.erb in caboose-cms-0.8.85 vs app/views/caboose/invoices/admin_index.html.erb in caboose-cms-0.8.87
- old
+ new
@@ -1,9 +1,13 @@
<% if @edituser %>
<%= render :partial => 'caboose/users/admin_header' %>
<% else %>
+ <div id='crumbtrail'>
+ <a href='/admin'>Admin</a> >
+ Invoices
+ </div>
<h1>Invoices</h1>
<% end %>
<style type='text/css'>
#search_form_wrapper { margin-bottom: 10px; position: absolute; top:0; right: 0; }
@@ -31,18 +35,41 @@
</optgroup>
</select></p>
<% end %>
<p><input type='text' name='total_gte' placeholder='Total Min' value="<%= @pager.params['total_gte'] %>" style='width: 100px;' /></p>
<p><input type='text' name='total_lte' placeholder='Total Max' value="<%= @pager.params['total_lte'] %>" style='width: 100px;' /></p>
- <p><select name='status'>
+ <p>
+ <!--
+ <select name='status'>
<optgroup label='Status'>
<option value=''>-- All statuses --</option>
<% statuses = ['cart','pending','canceled','ready to ship','shipped','paid'] %>
<% statuses.each do |status| %>
<option value='<%= status %>'<%= @pager.params['status'] == status ? " selected='true'" : '' %>><%= status.capitalize %></option>
<% end %>
</optgroup>
- </select></p>
+ </select>
+ -->
+ <%
+ statuses = [
+ Caboose::Invoice::STATUS_CART ,
+ Caboose::Invoice::STATUS_PENDING ,
+ Caboose::Invoice::STATUS_READY_TO_SHIP ,
+ Caboose::Invoice::STATUS_PROCESSED ,
+ Caboose::Invoice::STATUS_CANCELED
+ ]
+ all_checked = true
+ statuses.each do |status|
+ all_checked = false if !@pager.params['status'].include?(status)
+ end
+ Caboose.log(@pager.params['status'])
+ %>
+ Status:
+ <% statuses.each do |status| %>
+ <input type='checkbox' name='status[]' id='status_<%= status %>' value='<%= status %>' <% if @pager.params['status'].include?(status) %> checked='true'<% end %> />
+ <label for='status_<%= status %>'><%= status.capitalize %></label>
+ <% end %>
+ </p>
<p>
<input type='submit' value='Search' />
<input type='button' value='Clear' onclick="window.location='/admin<%= @edituser ? "/users/#{@edituser.id}" : '' %>/invoices';" />
</p>
</form>