Sha256: 94df1fd34fb69ec54e1ae77c493ea333ef71372ace8f23b9b5b7a5a9fa981f69

Contents?: true

Size: 1.58 KB

Versions: 5

Compression:

Stored size: 1.58 KB

Contents

- entity = controller.entity
- if controller.actions.any?
  .action_controller
    %ul.controls

      %li.reload.ui.icon.button
        %a.reload_action(href="#" title="Refresh action")
          %i.general.fi-reload

      %li.description.ui.icon.button
        %a(href="#" title="View description")
          %i.general.fi-book

      %li.parameters.ui.icon.button
        %a(href="#" title="Configure parameters")
          %i.general.fi-widget

      %li.pin.ui.icon.button
        %a(href="#" title="Make this configuration default")
          %i.general.fi-paperclip

      %li.url.ui.icon.button
        %a(href="#" title="Bookmark action")
          %i.general.fi-bookmark


    %ul.actions
      - last_resource = nil
      - controller.actions.each do |action, text, resource, params|
        %li.ui.button(class="#{last_resource and last_resource != resource ? "new_resource" : ""}" attr-resource="#{resource}")
          - case
          - when AnnotatedArray === entity
            - id = params.delete :id if Hash === params
            - id = controller.id if id.nil?
            = entity.list_action_link action, text, id, params.merge(:reuse => true)
          - when TSV === entity
            - id = params.delete :id if Hash === params
            - id = controller.id if id.nil?
            - type = page_entity_type
            - column = page_entity_map_column
            %a.entity_map_action(href="#{Entity::REST.entity_map_action_url id, type, column, action}")= text 
          - else
            = entity.action_link action, text, params
        - last_resource = resource

  .action_loader

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rbbt-rest-1.6.2 share/views/entity_partials/action_controller.haml
rbbt-rest-1.6.1 share/views/entity_partials/action_controller.haml
rbbt-rest-1.6.0 share/views/entity_partials/action_controller.haml
rbbt-rest-1.5.0 share/views/entity_partials/action_controller.haml
rbbt-rest-1.4.13 share/views/entity_partials/action_controller.haml