Commit 13a66040 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Ability to remvoe broadcast messages

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c5b66735
...@@ -21,3 +21,9 @@ ...@@ -21,3 +21,9 @@
.controls { margin-left: 130px; } .controls { margin-left: 130px; }
.form-actions { padding-left: 130px; background: #fff } .form-actions { padding-left: 130px; background: #fff }
} }
.broadcast-messages {
.message {
line-height: 2;
}
}
...@@ -15,6 +15,15 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController ...@@ -15,6 +15,15 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController
end end
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 protected
def broadcast_messages def broadcast_messages
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
= f.submit "Add broadcast message", class: "btn btn-create" = f.submit "Add broadcast message", class: "btn btn-create"
-if @broadcast_messages.any? -if @broadcast_messages.any?
%ul.bordered-list %ul.bordered-list.broadcast-messages
- @broadcast_messages.each do |broadcast_message| - @broadcast_messages.each do |broadcast_message|
%li %li
.pull-right .pull-right
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
- if broadcast_message.ends_at - if broadcast_message.ends_at
%strong %strong
#{broadcast_message.ends_at.to_s(:short)} #{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 .message= broadcast_message.message
= paginate @broadcast_messages = paginate @broadcast_messages
...@@ -86,7 +86,7 @@ Gitlab::Application.routes.draw do ...@@ -86,7 +86,7 @@ Gitlab::Application.routes.draw do
get :test get :test
end end
resources :broadcast_messages, only: [:index, :create] resources :broadcast_messages, only: [:index, :create, :destroy]
resource :logs, only: [:show] resource :logs, only: [:show]
resource :background_jobs, controller: 'background_jobs', only: [:show] resource :background_jobs, controller: 'background_jobs', only: [:show]
resources :projects, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ }, only: [:index, :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