From 29db90c2c8a9a6a3087e77eae8615ddf0049087b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Feb 2013 14:40:38 +0100 Subject: Deleted PrivatePub stuff. --- app/controllers/system_messages_controller.rb | 30 ------------------------- app/helpers/system_messages_helper.rb | 2 -- app/models/ability.rb | 4 ---- app/views/system_messages/_form.html.haml | 7 ------ app/views/system_messages/_form_core.html.haml | 2 -- app/views/system_messages/_index_core.html.haml | 12 ---------- app/views/system_messages/index.html.haml | 3 --- app/views/system_messages/new.html.haml | 3 --- app/views/system_messages/show.html.haml | 8 ------- 9 files changed, 71 deletions(-) delete mode 100644 app/controllers/system_messages_controller.rb delete mode 100644 app/helpers/system_messages_helper.rb delete mode 100644 app/views/system_messages/_form.html.haml delete mode 100644 app/views/system_messages/_form_core.html.haml delete mode 100644 app/views/system_messages/_index_core.html.haml delete mode 100644 app/views/system_messages/index.html.haml delete mode 100644 app/views/system_messages/new.html.haml delete mode 100644 app/views/system_messages/show.html.haml (limited to 'app') diff --git a/app/controllers/system_messages_controller.rb b/app/controllers/system_messages_controller.rb deleted file mode 100644 index d7fe515..0000000 --- a/app/controllers/system_messages_controller.rb +++ /dev/null @@ -1,30 +0,0 @@ -class SystemMessagesController < ApplicationController - load_and_authorize_resource :user - load_and_authorize_resource :system_message, :through => [:user] - - def index - @system_messages = @system_messages.where(:created_at => Time.now - 6.hours .. Time.now) - end - - def show - end - - def new - @system_message = @user.system_messages.build - end - - def create - @system_message = @user.system_messages.build(params[:system_message]) - if @system_message.save - # Push the new message via AJAX to the browser. - # - # PrivatePub.publish_to("/users/#{@system_message.user.id}/system_messages", - # "$('#system_message').empty();$('#system_message').append('#{(I18n.l @system_message.created_at, :format => :short )} #{@system_message.content}');$('#system_message_display').fadeIn();" - # ) - - redirect_to user_system_message_path(@user, @system_message), :notice => t('system_messages.controller.successfuly_created') - else - render :new - end - end -end diff --git a/app/helpers/system_messages_helper.rb b/app/helpers/system_messages_helper.rb deleted file mode 100644 index fef2386..0000000 --- a/app/helpers/system_messages_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module SystemMessagesHelper -end diff --git a/app/models/ability.rb b/app/models/ability.rb index 01f26aa..4ec64b1 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -56,10 +56,6 @@ class Ability can :read, PhoneBookEntry, :phone_book => { :id => user_group.phone_book_ids } end - # SystemMessages - # - cannot [:destroy, :edit, :update], SystemMessage - # A FacDocument can't be changed # cannot [:edit, :update], FaxDocument diff --git a/app/views/system_messages/_form.html.haml b/app/views/system_messages/_form.html.haml deleted file mode 100644 index 036ee00..0000000 --- a/app/views/system_messages/_form.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -= simple_form_for([@user, @system_message]) do |f| - = f.error_notification - - = render "form_core", :f => f - - .actions - = f.button :submit, conditional_t('system_messages.form.submit') \ No newline at end of file diff --git a/app/views/system_messages/_form_core.html.haml b/app/views/system_messages/_form_core.html.haml deleted file mode 100644 index a85db28..0000000 --- a/app/views/system_messages/_form_core.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -.inputs - = f.input :content, :label => t('system_messages.form.content.label'), :hint => conditional_hint('system_messages.form.content.hint') diff --git a/app/views/system_messages/_index_core.html.haml b/app/views/system_messages/_index_core.html.haml deleted file mode 100644 index 7c9dab5..0000000 --- a/app/views/system_messages/_index_core.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%table.table.table-striped - %thead - %tr - %th= t('system_messages.index.created_at') - %th= t('system_messages.index.content') - - %tbody - - for system_message in system_messages - %tr - %td= system_message.created_at - %td= system_message.content - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => system_message} \ No newline at end of file diff --git a/app/views/system_messages/index.html.haml b/app/views/system_messages/index.html.haml deleted file mode 100644 index ffd3fc3..0000000 --- a/app/views/system_messages/index.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :title, t("system_messages.index.page_title") - -= render "index_core", :system_messages => @system_messages \ No newline at end of file diff --git a/app/views/system_messages/new.html.haml b/app/views/system_messages/new.html.haml deleted file mode 100644 index 565f5c5..0000000 --- a/app/views/system_messages/new.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :title, t("system_messages.new.page_title") - -= render "form" diff --git a/app/views/system_messages/show.html.haml b/app/views/system_messages/show.html.haml deleted file mode 100644 index 70be6f2..0000000 --- a/app/views/system_messages/show.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -- content_for :title, t("system_messages.show.page_title") - -%p - %strong= t('system_messages.show.created_at') + ":" - = @system_message.created_at -%p - %strong= t('system_messages.show.content') + ":" - = @system_message.content -- cgit v1.2.3 From ca8121930d7e75b9f6bac08591c6ffea3ca1fea1 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Feb 2013 14:42:22 +0100 Subject: Removed PrivatePub stuff. --- app/models/ability.rb | 4 ---- app/models/system_message.rb | 7 ------- 2 files changed, 11 deletions(-) delete mode 100644 app/models/system_message.rb (limited to 'app') diff --git a/app/models/ability.rb b/app/models/ability.rb index 4ec64b1..4c0844c 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -156,10 +156,6 @@ class Ability # can :manage, CallForward, :phone_number_id => user.phone_number_ids - # SystemMessages - # - can :read, SystemMessage, :user_id => user.id - # SoftkeyFunctions # can :read, SoftkeyFunction diff --git a/app/models/system_message.rb b/app/models/system_message.rb deleted file mode 100644 index 0d9e862..0000000 --- a/app/models/system_message.rb +++ /dev/null @@ -1,7 +0,0 @@ -class SystemMessage < ActiveRecord::Base - attr_accessible :content - - belongs_to :user - - validates_presence_of :content -end -- cgit v1.2.3