Skip to content
Browse files

can see proposals

  • Loading branch information...
1 parent e7f7c73 commit a56a2b9c4cf9e0852f82e23c1441ba794f1d95f6 @paulanthonywilson paulanthonywilson committed
View
2 app/assets/stylesheets/application.css
@@ -193,7 +193,7 @@ th{padding: 0 0 5px 5px; background-color: #f6f6f6;}
}
#admin_proposals{
- ;
+
}
/* admin proposals*/
#admin_proposals .proposal{
View
3 app/controllers/admin/proposals_controller.rb
@@ -15,7 +15,7 @@ def condition
return "1=2" if states.blank?
"state in (#{states})"
end
- private
+ private
def initialize_from_args(args)
STATES.each do |state|
@@ -28,6 +28,7 @@ def initialize_from_args(args)
def index
@state_filter = StateFilter.new(params[:state_filter])
+ # raise @state_filter.condition.inspect
@proposals = Proposal.all(:include=>:presenter, :conditions=>@state_filter.condition).sort_by(&:average_score).reverse
end
View
8 app/views/admin/proposals/_proposal.html.erb
@@ -1,10 +1,10 @@
<div class='select'><%= check_box_tag 'selected_proposals[]', proposal.id, false, :class=>'select_proposal' %></div>
-<div class='title'><%= h proposal.title%></div>
+<div class='title'><%= proposal.title%></div>
<div class='presenters'><%= proposal.presenter.name %></div>
-<div class='state'><%= h proposal.state%></div>
+<div class='state'><%= proposal.state%></div>
<div class='events'>
- <% proposal.aasm_events_for_current_state.each do |event| %>
+ <% proposal.aasm_events_for_current_state.each do |event| %>
<%= button_to event, :update=>dom_id(proposal), :url=>update_state_admin_proposal_path(proposal), :remote=>true, :method=>:put, :with=>"'event=#{event}'"%>
- <% end%>
+ <% end%>
</div>
View
9 app/views/admin/proposals/index.html.erb
@@ -1,6 +1,6 @@
<div id="admin_proposals">
<div id="filter">
- <% form_tag admin_proposals_path, :method=>:get, :id=>:admin_proposals_form do %>
+ <%= form_tag admin_proposals_path, :method=>:get, :id=>:admin_proposals_form do %>
<% Proposal.aasm_states.each do |state|%>
<%= label :state_filter, state.name, "#{state.name}:" %>
<%= check_box :state_filter, state.name, {:class=>'state_checkbox'}, true, false%>
@@ -10,6 +10,13 @@
</div>
+<% @proposals.each_with_index do |proposal, i|%>
+ <%= div_for proposal do %>
+ <%= render :partial=>proposal%>
+ <% end %>
+<% end%>
+
+
<script>
$('.state_checkbox').change(function(){$('#admin_proposals_form').submit();});
$('#toggle_all_proposals').change(function(){

0 comments on commit a56a2b9

Please sign in to comment.
Something went wrong with that request. Please try again.