Module: InterimStreamHackinessHelper

Defined in:
app/helpers/interim_stream_hackiness_helper.rb

Instance Method Summary collapse

Instance Method Details

#commenting_disabled?(post) ⇒ Boolean

Returns:

  • (Boolean)

2
3
4
5
6
7
8
9
10
11
# File 'app/helpers/interim_stream_hackiness_helper.rb', line 2

def commenting_disabled?(post)
  return true unless user_signed_in?
  if defined?(@commenting_disabled)
    @commenting_disabled
  elsif defined?(@stream)
    !@stream.can_comment?(post)
  else
    false
  end
end

#from_group(post) ⇒ Object


34
35
36
37
38
39
40
# File 'app/helpers/interim_stream_hackiness_helper.rb', line 34

def from_group(post)
  if defined?(@stream) && params[:controller] == 'multis'
    @stream.post_from_group(post)
  else
   []
  end
end

#publisher_explainObject


58
59
60
61
62
63
64
# File 'app/helpers/interim_stream_hackiness_helper.rb', line 58

def publisher_explain
  if defined?(@stream)
    @stream.publisher.public?
  else
    false
  end
end

#publisher_formatted_textObject

These methods need to go away once we pass publisher object into the partial ######


14
15
16
17
18
19
20
21
22
# File 'app/helpers/interim_stream_hackiness_helper.rb', line 14

def publisher_formatted_text
  if params[:prefill].present?
    params[:prefill]
  elsif defined?(@stream)
    @stream.publisher.text
  else
    nil
  end
end

#publisher_hidden_textObject


24
25
26
27
28
29
30
31
32
# File 'app/helpers/interim_stream_hackiness_helper.rb', line 24

def publisher_hidden_text
  if params[:prefill].present?
    params[:prefill]
  elsif defined?(@stream)
    @stream.publisher.prefill 
  else
    nil
  end
end

#publisher_openObject


42
43
44
45
46
47
48
# File 'app/helpers/interim_stream_hackiness_helper.rb', line 42

def publisher_open
  if defined?(@stream)
    @stream.publisher.open?
  else
    false
  end
end

#publisher_publicObject


50
51
52
53
54
55
56
# File 'app/helpers/interim_stream_hackiness_helper.rb', line 50

def publisher_public
  if defined?(@stream)
    @stream.publisher.public?
  else
    false
  end
end