Sha256: f59afa71d52e75baf5acc381ac0ef55b84925a27e92e756d2e4f142a457f27f6

Contents?: true

Size: 1.51 KB

Versions: 4

Compression:

Stored size: 1.51 KB

Contents

# Ddr::Alerts

Alerts for the Duke Digital Repository

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'ddr-alerts'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install ddr-alerts

## Usage

#### Migrations

Install the ddr-alerts migrations:

    rake ddr_alerts:install:migrations

then

    rake db:migrate

    rake db:test:prepare

#### View Partial

Ddr::Alerts contains a view partial (ddr/alerts/message/_alert_message.html.erb) that displays the alert messages.  This partial depends on
the local 'alert_messages' to contain an array of Ddr::Alert::Message which are to be displayed.  Render this partial in the desired
view / layout of your application, passing in the appropriate value for the 'alert_messages' local.  For example, override Blacklight's
shared/_flash_messages.html.erb as shown below to include all active alert messages in the 'repository' context above the application's
flash messages on each page:

```
<div class="row">
  <div class="col-md-12">
    <div id="main-flashes">
	  <%= render partial: '/ddr/alerts/message/alert_message', locals: { alert_messages: Ddr::Alerts::Message.active.repository } %>
      <%= yield %>
    </div>
  </div>
</div>
```

## Contributing

1. Fork it ( https://github.com/[my-github-username]/ddr-alerts/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ddr-alerts-0.3.0 README.md
ddr-alerts-0.2.0 README.md
ddr-alerts-0.1.1 README.md
ddr-alerts-0.1.0 README.md