.controls { margin-left: 130px; }
.form-actions { padding-left: 130px; background: #fff }
}
+
+.broadcast-messages {
+ .message {
+ line-height: 2;
+ }
+}
end
end
+ def destroy
+ BroadcastMessage.find(params[:id]).destroy
+
+ respond_to do |format|
+ format.html { redirect_to :back }
+ format.js { render nothing: true }
+ end
+ end
+
protected
def broadcast_messages
= f.submit "Add broadcast message", class: "btn btn-create"
-if @broadcast_messages.any?
- %ul.bordered-list
+ %ul.bordered-list.broadcast-messages
- @broadcast_messages.each do |broadcast_message|
%li
.pull-right
- if broadcast_message.ends_at
%strong
#{broadcast_message.ends_at.to_s(:short)}
+
+ = link_to [:admin, broadcast_message], method: :delete, remote: true, class: 'remove-row btn btn-tiny' do
+ %i.icon-remove.cred
+
.message= broadcast_message.message
+
= paginate @broadcast_messages
get :test
end
- resources :broadcast_messages, only: [:index, :create]
+ resources :broadcast_messages, only: [:index, :create, :destroy]
resource :logs, only: [:show]
resource :background_jobs, controller: 'background_jobs', only: [:show]
resources :projects, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ }, only: [:index, :show]