Skip to content

Commit

Permalink
Mini action menu as view
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagotalma committed Mar 27, 2016
1 parent 75d6d5b commit 7bc0c0f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
7 changes: 7 additions & 0 deletions app/views/agents/_mini_action_menu.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

<div class="btn-group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<%= render 'agents/action_menu', agent: agent, return_to: (defined?(return_to) && return_to) || request.path %>
</div>
6 changes: 5 additions & 1 deletion app/views/events/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<div class='col-md-12'>
<div class="page-header">
<h2>
Your Events <%= @agent && "from #{@agent.name}" %>
Your Events
<% if @agent %>
from <%= @agent.name %>
<%= render 'agents/mini_action_menu', agent: @agent, return_to: request.path %>
<% end %>
</h2>
</div>

Expand Down
7 changes: 1 addition & 6 deletions app/views/events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
<div class="page-header">
<h2>
Event from <%= @event.agent.name %>
<div class="btn-group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<%= render 'agents/action_menu', agent: @event.agent, return_to: (defined?(return_to) && return_to) || request.path %>
</div>
<%= render 'agents/mini_action_menu', agent: @event.agent, return_to: event_path(@event) %>
</h2>
</div>

Expand Down

0 comments on commit 7bc0c0f

Please sign in to comment.