aboutsummaryrefslogtreecommitdiff
blob: 0471eb4d368e45a79c9ccd28394e485babcd304e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<show-page>
  <append-collection-section: if="&this.current?">
    <h3 class="collection-heading">
      Suggested items:
    </h3>
    <with with="&AgendaItem.all(:conditions => { :agenda_id => nil, :rejected => false })">
      <collection unless="&this.nil?" />
    </with>
  </append-collection-section:>
  <append-content-body:>
    <div class="transition" if="&Agenda.transitions_available(current_user)">
      <collection:possible_transitions>
        <a href="&send(this.second)"><view:first/></a>
      </collection>
    </div>
    <if test="&current_user.council_member? and not this.summary.nil? and not this.summary.empty?">
      <form action="&create_approval_path" if="&Approval.user_is(current_user).agenda_is(this).count.zero?">
        <input type="hidden" name="approval[user_id]" value="&current_user.id"/>
        <input type="hidden" name="approval[agenda_id]" value="&this.id"/>
        <submit label="approve summary"/>
      </form>
      <else>
        <with with="&Approval.agenda_is(this).user_is(current_user).first">
          <delete-button label="remove your approval for this summary" />
        </with>
      </else>
    </if>
    <unless test="&this.approvals.count.zero?">
      Summary for this agenda was approved by <%= this.approvals.count %> council member(s):
      <%= this.approvals.*.user.*.name.join(", ") %>.
    </unless>
  </append-content-body:>
</show-page>