BigW Consortium Gitlab

Ability to remvoe broadcast messages

parent c5b66735
......@@ -21,3 +21,9 @@
.controls { margin-left: 130px; }
.form-actions { padding-left: 130px; background: #fff }
}
.broadcast-messages {
.message {
line-height: 2;
}
}
......@@ -15,6 +15,15 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController
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
......
......@@ -25,7 +25,7 @@
= 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
......@@ -36,6 +36,11 @@
- if broadcast_message.ends_at
%strong
#{broadcast_message.ends_at.to_s(:short)}
&nbsp;
= 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
......@@ -86,7 +86,7 @@ Gitlab::Application.routes.draw do
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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment