From 6a8afd2f69a13f62841a3fe909beaad96928fadb Mon Sep 17 00:00:00 2001
From: thea <ta.kupler@gmail.com>
Date: Thu, 15 Sep 2016 12:23:14 +0200
Subject: twitter readme now contains github markup to show secrets-file
 content

---
 doc/TWITTER_FEED.md | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/doc/TWITTER_FEED.md b/doc/TWITTER_FEED.md
index dd3954c..221c334 100644
--- a/doc/TWITTER_FEED.md
+++ b/doc/TWITTER_FEED.md
@@ -19,6 +19,18 @@ LEAP web app (as part of the main view).
 * Activate the feature within your local LEAP Web Application
   * If not already existing create a secrets-file in /config with the name secrets.yml (`/config/secrets.yml`)
   * Secrets-file should contain the following, make sure its in YAML: {"development"=> {"twitter"=>{"enabled"=>false, "twitter_handle"=>"", "bearer_token"=>"", "twitter_picture"=>nil}}, "test"=>{"twitter"=>{"enabled"=>false, "twitter_handle"=>"", "bearer_token"=>"", "twitter_picture"=>nil}}}
+```
+development:
+  twitter:
+    enabled: false # set to true for usage
+    twitter_handle: XXXXX #put your twitter handle here
+    bearer_token: XXXXX #put your bearer token here
+test:
+  twitter:
+    enabled: false # set to true for usage
+    twitter_handle: XXXXX #put your twitter handle here
+    bearer_token: XXXXX #put your bearer token here
+```
   * To have your bearer token created, run script in terminal being in the file of leap_web: `script/generate_bearer_token`
   * To have the script run properly you have to add before running: `--key your_consumerkey --secret your_consumersecret`
   * Add also `--projectroot your_projectroot --twitterhandle your_twitterhandle` as well to not have manually put the data in your secrets-file
-- 
cgit v1.2.3


From 94a5b32a58f5f4fb63eaf677a91af63e1fe3e325 Mon Sep 17 00:00:00 2001
From: thea <ta.kupler@gmail.com>
Date: Thu, 15 Sep 2016 15:29:10 +0200
Subject: included production for readme & secrets

---
 doc/TWITTER_FEED.md          | 5 +++++
 script/generate_bearer_token | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/doc/TWITTER_FEED.md b/doc/TWITTER_FEED.md
index 221c334..592cd38 100644
--- a/doc/TWITTER_FEED.md
+++ b/doc/TWITTER_FEED.md
@@ -30,6 +30,11 @@ test:
     enabled: false # set to true for usage
     twitter_handle: XXXXX #put your twitter handle here
     bearer_token: XXXXX #put your bearer token here
+production:
+  twitter:
+    enabled: false # set to true for usage
+    twitter_handle: XXXXX #put your twitter handle here
+    bearer_token: XXXXX #put your bearer token here
 ```
   * To have your bearer token created, run script in terminal being in the file of leap_web: `script/generate_bearer_token`
   * To have the script run properly you have to add before running: `--key your_consumerkey --secret your_consumersecret`
diff --git a/script/generate_bearer_token b/script/generate_bearer_token
index 7091a8d..60e4600 100755
--- a/script/generate_bearer_token
+++ b/script/generate_bearer_token
@@ -73,10 +73,12 @@ else
   else
     secrets["development"]["twitter"]["twitter_handle"] = options[:twitterhandle]
     secrets["test"]["twitter"]["twitter_handle"] = options[:twitterhandle]
+    secrets["production"]["twitter"]["twitter_handle"] = options[:twitterhandle]
   end
 
   secrets["development"]["twitter"]["bearer_token"] = $bearer_token
   secrets["test"]["twitter"]["bearer_token"] = $bearer_token
+  secrets["production"]["twitter"]["twitter_handle"] = $bearer_token
 
   File.open("#{options[:projectroot]}/leap_web/config/secrets.yml", "r+") do |file|
     file.write(secrets.to_yaml)
-- 
cgit v1.2.3


From a95c0dfe3f70671ee354648fc4b25a79d5b57824 Mon Sep 17 00:00:00 2001
From: thea <ta.kupler@gmail.com>
Date: Tue, 20 Sep 2016 12:13:30 +0200
Subject: deleted leap_web from projectroot

---
 script/generate_bearer_token | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/script/generate_bearer_token b/script/generate_bearer_token
index 60e4600..3a09382 100755
--- a/script/generate_bearer_token
+++ b/script/generate_bearer_token
@@ -55,8 +55,8 @@ if options[:projectroot].nil? then
   puts "You didn't tell us the directory to have your secrets-file created or being filled. Feel free to copy/paste your bearer_token:"
   puts $bearer_token
 else
-  if File.exist?("#{options[:projectroot]}/leap_web/config/secrets.yml")
-    secrets = YAML.load_file("#{options[:projectroot]}/leap_web/config/secrets.yml")
+  if File.exist?("#{options[:projectroot]}/config/secrets.yml")
+    secrets = YAML.load_file("#{options[:projectroot]}/config/secrets.yml")
   else
     puts "Please make sure that you created a secrets-file as described in the documentation or have given the correct directory. No secrets-file could be found."
     exit
-- 
cgit v1.2.3


From 460129e5965751127bb6cb363a661afb7c7d5ab4 Mon Sep 17 00:00:00 2001
From: thea <ta.kupler@gmail.com>
Date: Wed, 21 Sep 2016 14:08:38 +0200
Subject: included error-handling: twitter-helper includes rescue and error
 message for fourth value in array. there will always be an empty array that
 view (text and each - method) does not break. if empty array in view the
 error-message is shown. (its WIP)

---
 app/helpers/twitter_helper.rb     | 24 ++++++++++++++++++++++++
 app/views/twitter/_index.html.erb | 15 ++++++++-------
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index f824a03..8503f24 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -23,6 +23,26 @@ module TwitterHelper
     twitter_user_info[0] = Time.now
     twitter_user_info[1] = twitter_client.user(twitter_handle).name
     twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(3)
+    if twitter_user_info[2] == nil
+      error_handling
+      twitter_user_info[3] = "The twitter-handle does not exist or the account is private. Please change it or contact your provider-admin."
+    end
+  rescue Twitter::Error::BadRequest
+    error_handling
+  rescue Twitter::Error::Unauthorized
+    error_handling
+  rescue Twitter::Error::Forbidden
+    error_handling
+  rescue Twitter::Error::NotAcceptable
+    error_handling
+  rescue Twitter::Error::TooManyRequests
+    error_handling
+  end
+
+  def error_handling
+    twitter_user_info[2] = []
+    twitter_user_info[3] = "The twitter-handle does not exist or the account is private. Please change it or contact your provider-admin."
+    return twitter_user_info
   end
 
   def cached_info
@@ -43,4 +63,8 @@ module TwitterHelper
   def tweets
     cached_info[2]
   end
+
+  def error_message
+    cached_info[3]
+  end
 end
diff --git a/app/views/twitter/_index.html.erb b/app/views/twitter/_index.html.erb
index a7ebd1b..8529b83 100644
--- a/app/views/twitter/_index.html.erb
+++ b/app/views/twitter/_index.html.erb
@@ -9,14 +9,15 @@
       </div>
 
       <div class="twitter_list">
-        <% tweets.each do |e| %>
-          <div class="tweet">
-            <div class="tweet_text"><%= " #{e.text}" %>
+        <%if tweets == [] then%><%= error_message %><% end %>
+          <% tweets.each do |e| %>
+            <div class="tweet">
+              <div class="tweet_text"><%= " #{e.text}" %>
+              </div>
+              <div class="tweet_text_date">tweeted on <% t = e.created_at%> <%= t.strftime("%m/%d/%y").to_s %>
+              </div>
             </div>
-            <div class="tweet_text_date">tweeted on <% t = e.created_at%> <%= t.strftime("%m/%d/%y").to_s %>
-            </div>
-          </div>
-        <% end %>
+          <% end %>
     </div>
 
     <div class="twitter_footer">
-- 
cgit v1.2.3


From d44fc9292637ed6d1a4a7e04883e8b3b88dc3c15 Mon Sep 17 00:00:00 2001
From: theaamanda <ta.kupler@posteo.de>
Date: Wed, 21 Sep 2016 23:34:53 +0200
Subject: finished error-handling with different error-messages for different
 errors. added info that the account has to be public in Twitter-Doc

---
 app/helpers/twitter_helper.rb | 6 +++++-
 doc/TWITTER_FEED.md           | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index 8503f24..719f95e 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -29,19 +29,23 @@ module TwitterHelper
     end
   rescue Twitter::Error::BadRequest
     error_handling
+    twitter_user_info[3] = "The request to have the tweets shown was invalid or cannot be otherwise served."
   rescue Twitter::Error::Unauthorized
     error_handling
+    twitter_user_info[3] = "Please change your twitter-credentials, make sure that the twitter-account you access is public or contact your provider-admin to have the tweets shown."
   rescue Twitter::Error::Forbidden
     error_handling
+    twitter_user_info[3] = "The request to have the tweets shown is understood, but it has been refused or access is not allowed."
   rescue Twitter::Error::NotAcceptable
     error_handling
+    twitter_user_info[3] = "An invalid format is specified in the request to have the tweets shown."
   rescue Twitter::Error::TooManyRequests
     error_handling
+    twitter_user_info[3] = "The rate-limit for accessing the tweets is reached. You should be able to see the tweets in a couple of minutes."
   end
 
   def error_handling
     twitter_user_info[2] = []
-    twitter_user_info[3] = "The twitter-handle does not exist or the account is private. Please change it or contact your provider-admin."
     return twitter_user_info
   end
 
diff --git a/doc/TWITTER_FEED.md b/doc/TWITTER_FEED.md
index 592cd38..94de8c1 100644
--- a/doc/TWITTER_FEED.md
+++ b/doc/TWITTER_FEED.md
@@ -41,7 +41,7 @@ production:
   * Add also `--projectroot your_projectroot --twitterhandle your_twitterhandle` as well to not have manually put the data in your secrets-file
   * The full command looks like this: `script/generate_bearer_token --key your_consumerkey --secret your_consumersecret --projectroot your_projectroot --twitterhandle your_twitterhandle`
   * If you didn't give all your information to the script, had a typo or want to change anything else, please do so by finding the secrets-file at `/config/secrets.yml`
-  * Make sure that the correct twitterhandle and bearer-token is included
+  * Make sure that the correct twitterhandle and bearer-token is included. The twitter-account you want to have shown (the twitterhandle) is a public account!
 
 * Deactivate your bearer token
   * To deactivate your generated bearer token you can run script/invalidate_bearer_token
-- 
cgit v1.2.3


From 306b36c045cd62638db179115ed002c6ab7c5cd8 Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Thu, 22 Sep 2016 14:36:10 +0200
Subject: included Theas work on error-handling \o/; changed link to
 twitter-account in header; fixed erb escaping characters problem without
 letting evil code pass; setting customized image file 'Avatar_Pic.png' in
 config/custo../assets to get loaded instead of default twitter-logo

---
 app/assets/images/Avatar_Pic.png        | Bin 0 -> 4298 bytes
 app/assets/images/Twitter_Logo_Blue.png | Bin 4298 -> 0 bytes
 app/assets/stylesheets/twitter.scss     |   1 +
 app/helpers/twitter_helper.rb           |  28 ++++++++++++++++++++++++
 app/views/twitter/_index.html.erb       |  19 ++++++++--------
 config/initializers/assets.rb           |   1 +
 config/initializers/customization.rb    |   3 ++-
 config/initializers/twitter.rb          |  37 ++++++++++++++++++++++++++++++++
 8 files changed, 79 insertions(+), 10 deletions(-)
 create mode 100644 app/assets/images/Avatar_Pic.png
 delete mode 100644 app/assets/images/Twitter_Logo_Blue.png
 create mode 100644 config/initializers/assets.rb
 create mode 100644 config/initializers/twitter.rb

diff --git a/app/assets/images/Avatar_Pic.png b/app/assets/images/Avatar_Pic.png
new file mode 100644
index 0000000..b5eebc8
Binary files /dev/null and b/app/assets/images/Avatar_Pic.png differ
diff --git a/app/assets/images/Twitter_Logo_Blue.png b/app/assets/images/Twitter_Logo_Blue.png
deleted file mode 100644
index b5eebc8..0000000
Binary files a/app/assets/images/Twitter_Logo_Blue.png and /dev/null differ
diff --git a/app/assets/stylesheets/twitter.scss b/app/assets/stylesheets/twitter.scss
index b2233d0..a67c044 100644
--- a/app/assets/stylesheets/twitter.scss
+++ b/app/assets/stylesheets/twitter.scss
@@ -21,6 +21,7 @@
   position: absolute;
   left: 0;
   top: 0;
+  // background-image: url(/Avatar_Pic.png);
   }
 
 .twitter_image_frame > img {
diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index f824a03..719f95e 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -23,6 +23,30 @@ module TwitterHelper
     twitter_user_info[0] = Time.now
     twitter_user_info[1] = twitter_client.user(twitter_handle).name
     twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(3)
+    if twitter_user_info[2] == nil
+      error_handling
+      twitter_user_info[3] = "The twitter-handle does not exist or the account is private. Please change it or contact your provider-admin."
+    end
+  rescue Twitter::Error::BadRequest
+    error_handling
+    twitter_user_info[3] = "The request to have the tweets shown was invalid or cannot be otherwise served."
+  rescue Twitter::Error::Unauthorized
+    error_handling
+    twitter_user_info[3] = "Please change your twitter-credentials, make sure that the twitter-account you access is public or contact your provider-admin to have the tweets shown."
+  rescue Twitter::Error::Forbidden
+    error_handling
+    twitter_user_info[3] = "The request to have the tweets shown is understood, but it has been refused or access is not allowed."
+  rescue Twitter::Error::NotAcceptable
+    error_handling
+    twitter_user_info[3] = "An invalid format is specified in the request to have the tweets shown."
+  rescue Twitter::Error::TooManyRequests
+    error_handling
+    twitter_user_info[3] = "The rate-limit for accessing the tweets is reached. You should be able to see the tweets in a couple of minutes."
+  end
+
+  def error_handling
+    twitter_user_info[2] = []
+    return twitter_user_info
   end
 
   def cached_info
@@ -43,4 +67,8 @@ module TwitterHelper
   def tweets
     cached_info[2]
   end
+
+  def error_message
+    cached_info[3]
+  end
 end
diff --git a/app/views/twitter/_index.html.erb b/app/views/twitter/_index.html.erb
index a7ebd1b..cdfff4b 100644
--- a/app/views/twitter/_index.html.erb
+++ b/app/views/twitter/_index.html.erb
@@ -3,20 +3,21 @@
 
       <div class="twitter_header">
         <div class="twitter_id">
-          <div class="twitter_image_frame"><%= image_tag("Twitter_Logo_Blue.png") %></div>
-          <div class="twitter_name"><%= twitter_name%><br><a href="https://twitter.com/loadtocode">@<%= twitter_handle %></a></div>
+          <div class="twitter_image_frame"><%= image_tag("Avatar_Pic.png") %></div>
+          <div class="twitter_name"><%= twitter_name%><br><a href="https://twitter.com/<%= twitter_handle %>">@<%= twitter_handle %></a></div>
         </div>
       </div>
 
       <div class="twitter_list">
-        <% tweets.each do |e| %>
-          <div class="tweet">
-            <div class="tweet_text"><%= " #{e.text}" %>
+        <%if tweets == [] then%><%= error_message %><% end %>
+          <% tweets.each do |e| %>
+            <div class="tweet">
+              <div class="tweet_text"><%= sanitize(e.text) %>
+              </div>
+              <div class="tweet_text_date">tweeted on <% t = e.created_at%> <%= t.strftime("%m/%d/%y").to_s %>
+              </div>
             </div>
-            <div class="tweet_text_date">tweeted on <% t = e.created_at%> <%= t.strftime("%m/%d/%y").to_s %>
-            </div>
-          </div>
-        <% end %>
+          <% end %>
     </div>
 
     <div class="twitter_footer">
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
new file mode 100644
index 0000000..ccb32b6
--- /dev/null
+++ b/config/initializers/assets.rb
@@ -0,0 +1 @@
+Rails.application.config.assets.precompile += %w( Avatar_Pic.png )
diff --git a/config/initializers/customization.rb b/config/initializers/customization.rb
index 9f537e9..9b3a2b9 100644
--- a/config/initializers/customization.rb
+++ b/config/initializers/customization.rb
@@ -21,7 +21,8 @@ customization_directory = APP_CONFIG["customization_directory"]
 # * For this to work, config.assets.initialize_on_precompile MUST be set to true, otherwise
 #   this initializer will never get called in production mode when the assets are precompiled.
 #
-Rails.application.config.assets.paths.unshift "#{customization_directory}/stylesheets"
+# Rails.application.config.assets.paths.unshift "#{customization_directory}/stylesheets"
+Rails.application.config.assets.paths.unshift "#{customization_directory}/assets"
 
 #
 # Copy files to public
diff --git a/config/initializers/twitter.rb b/config/initializers/twitter.rb
new file mode 100644
index 0000000..9f537e9
--- /dev/null
+++ b/config/initializers/twitter.rb
@@ -0,0 +1,37 @@
+#
+# When deploying, common customizations can be dropped in config/customizations. This initializer makes this work.
+#
+APP_CONFIG["customization_directory"] ||= "#{Rails.root}/config/customization"
+customization_directory = APP_CONFIG["customization_directory"]
+
+#
+# Set customization views as the first view path
+#
+# Rails.application.config.paths['app/views'].unshift "config/customization/views"
+# (For some reason, this does not work here. See application.rb for where this is actually called.)
+
+#
+# Set customization stylesheets as the first asset path
+#
+# Some notes:
+#
+# * This cannot go in application.rb, as far as I can tell. In application.rb, the default paths
+#   haven't been loaded yet, so the path we add will always end up at the end unless we add it here.
+#
+# * For this to work, config.assets.initialize_on_precompile MUST be set to true, otherwise
+#   this initializer will never get called in production mode when the assets are precompiled.
+#
+Rails.application.config.assets.paths.unshift "#{customization_directory}/stylesheets"
+
+#
+# Copy files to public
+#
+if !defined?(RAKE) && Dir.exist?("#{customization_directory}/public")
+  require 'fileutils'
+  FileUtils.cp_r("#{customization_directory}/public/.", "#{Rails.root}/public", :preserve => true)
+end
+
+#
+# Add I18n path
+#
+Rails.application.config.i18n.load_path += Dir["#{customization_directory}/locales/*.{rb,yml,yaml}"]
-- 
cgit v1.2.3


From 6f9c4fdab2caef90e49ca965617e767b50bcbbb2 Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Thu, 22 Sep 2016 15:31:52 +0200
Subject: initializer/twitter.rb file unnecessary; added change in main view
 only if twitter feature is set enabled == true

---
 app/views/home/_content.html.haml | 22 +++++++++++++++-------
 config/initializers/twitter.rb    | 37 -------------------------------------
 2 files changed, 15 insertions(+), 44 deletions(-)
 delete mode 100644 config/initializers/twitter.rb

diff --git a/app/views/home/_content.html.haml b/app/views/home/_content.html.haml
index 5341189..950f85e 100644
--- a/app/views/home/_content.html.haml
+++ b/app/views/home/_content.html.haml
@@ -1,4 +1,18 @@
-.col-md-8
+- if twitter_enabled == true
+  .col-md-8
+    .row
+      %h1= t(:welcome, :provider => APP_CONFIG[:domain])
+      .p=t(:welcome_message_html)
+
+    .row
+      = home_page_buttons
+
+  .col-md-1
+
+  .col-md-3
+    .row
+      = render 'twitter/index'
+- else
   .row
     %h1= t(:welcome, :provider => APP_CONFIG[:domain])
     .p=t(:welcome_message_html)
@@ -6,12 +20,6 @@
   .row
     = home_page_buttons
 
-.col-md-1
-
-.col-md-3
-  .row
-    = render 'twitter/index'
-
     - if Rails.env == 'development'
       .row
         %hr
diff --git a/config/initializers/twitter.rb b/config/initializers/twitter.rb
deleted file mode 100644
index 9f537e9..0000000
--- a/config/initializers/twitter.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# When deploying, common customizations can be dropped in config/customizations. This initializer makes this work.
-#
-APP_CONFIG["customization_directory"] ||= "#{Rails.root}/config/customization"
-customization_directory = APP_CONFIG["customization_directory"]
-
-#
-# Set customization views as the first view path
-#
-# Rails.application.config.paths['app/views'].unshift "config/customization/views"
-# (For some reason, this does not work here. See application.rb for where this is actually called.)
-
-#
-# Set customization stylesheets as the first asset path
-#
-# Some notes:
-#
-# * This cannot go in application.rb, as far as I can tell. In application.rb, the default paths
-#   haven't been loaded yet, so the path we add will always end up at the end unless we add it here.
-#
-# * For this to work, config.assets.initialize_on_precompile MUST be set to true, otherwise
-#   this initializer will never get called in production mode when the assets are precompiled.
-#
-Rails.application.config.assets.paths.unshift "#{customization_directory}/stylesheets"
-
-#
-# Copy files to public
-#
-if !defined?(RAKE) && Dir.exist?("#{customization_directory}/public")
-  require 'fileutils'
-  FileUtils.cp_r("#{customization_directory}/public/.", "#{Rails.root}/public", :preserve => true)
-end
-
-#
-# Add I18n path
-#
-Rails.application.config.i18n.load_path += Dir["#{customization_directory}/locales/*.{rb,yml,yaml}"]
-- 
cgit v1.2.3


From cd07bbe8d0390a8622bcde257efcb3e11038de63 Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Thu, 22 Sep 2016 16:05:02 +0200
Subject: Modified error messages

---
 app/helpers/twitter_helper.rb | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index 719f95e..e3b468a 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -22,26 +22,26 @@ module TwitterHelper
   def update_twitter_info
     twitter_user_info[0] = Time.now
     twitter_user_info[1] = twitter_client.user(twitter_handle).name
-    twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(3)
+    twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(7)
     if twitter_user_info[2] == nil
       error_handling
-      twitter_user_info[3] = "The twitter-handle does not exist or the account is private. Please change it or contact your provider-admin."
+      twitter_user_info[3] = "The twitter handle does not exist or the account's tweets are protected. Please change the privacy settings accordingly."
     end
   rescue Twitter::Error::BadRequest
     error_handling
-    twitter_user_info[3] = "The request to have the tweets shown was invalid or cannot be otherwise served."
+    twitter_user_info[3] = "The request to display tweets is invalid or cannot be otherwise served."
   rescue Twitter::Error::Unauthorized
     error_handling
-    twitter_user_info[3] = "Please change your twitter-credentials, make sure that the twitter-account you access is public or contact your provider-admin to have the tweets shown."
+    twitter_user_info[3] = "The account's tweets are protected and cannot be displayed. Please change the privacy settings of the corresponding account."
   rescue Twitter::Error::Forbidden
     error_handling
-    twitter_user_info[3] = "The request to have the tweets shown is understood, but it has been refused or access is not allowed."
+    twitter_user_info[3] = "The request to display tweets is understood, but it has been refused or access is not allowed."
   rescue Twitter::Error::NotAcceptable
     error_handling
-    twitter_user_info[3] = "An invalid format is specified in the request to have the tweets shown."
+    twitter_user_info[3] = "An invalid format is specified in the request to display tweets."
   rescue Twitter::Error::TooManyRequests
     error_handling
-    twitter_user_info[3] = "The rate-limit for accessing the tweets is reached. You should be able to see the tweets in a couple of minutes."
+    twitter_user_info[3] = "The rate-limit for accessing the tweets is reached. You should be able to display tweets in a couple of minutes."
   end
 
   def error_handling
-- 
cgit v1.2.3


From a771c63ff6a04f2f80b94c35538dd62ad1b0c310 Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Thu, 22 Sep 2016 16:11:12 +0200
Subject: same same but slightly different

---
 app/helpers/twitter_helper.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index e3b468a..cf75a73 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -22,7 +22,7 @@ module TwitterHelper
   def update_twitter_info
     twitter_user_info[0] = Time.now
     twitter_user_info[1] = twitter_client.user(twitter_handle).name
-    twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(7)
+    twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(3)
     if twitter_user_info[2] == nil
       error_handling
       twitter_user_info[3] = "The twitter handle does not exist or the account's tweets are protected. Please change the privacy settings accordingly."
-- 
cgit v1.2.3


From 7c9aba4a6192617cd29765450711a65affccecef Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Thu, 22 Sep 2016 16:13:42 +0200
Subject: clean up

---
 config/initializers/customization.rb | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/config/initializers/customization.rb b/config/initializers/customization.rb
index 9b3a2b9..a96564c 100644
--- a/config/initializers/customization.rb
+++ b/config/initializers/customization.rb
@@ -1,10 +1,8 @@
-#
 # When deploying, common customizations can be dropped in config/customizations. This initializer makes this work.
 #
 APP_CONFIG["customization_directory"] ||= "#{Rails.root}/config/customization"
 customization_directory = APP_CONFIG["customization_directory"]
 
-#
 # Set customization views as the first view path
 #
 # Rails.application.config.paths['app/views'].unshift "config/customization/views"
@@ -21,7 +19,6 @@ customization_directory = APP_CONFIG["customization_directory"]
 # * For this to work, config.assets.initialize_on_precompile MUST be set to true, otherwise
 #   this initializer will never get called in production mode when the assets are precompiled.
 #
-# Rails.application.config.assets.paths.unshift "#{customization_directory}/stylesheets"
 Rails.application.config.assets.paths.unshift "#{customization_directory}/assets"
 
 #
-- 
cgit v1.2.3


From 4ffa776d2c760618b17bd76a9a023f7fe762babd Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Fri, 23 Sep 2016 11:52:46 +0200
Subject: Doc updated on how to customize avatar picture in twitter feature;
 update error response messages; added 'config/customization/images' + link in
 'config/initializer/customization.rb'

---
 app/helpers/twitter_helper.rb        | 14 ++++++++++----
 config/initializers/customization.rb |  4 ++--
 doc/TWITTER_FEED.md                  |  5 +++--
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index cf75a73..5a9d28c 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -22,26 +22,32 @@ module TwitterHelper
   def update_twitter_info
     twitter_user_info[0] = Time.now
     twitter_user_info[1] = twitter_client.user(twitter_handle).name
-    twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(3)
+    twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(10)
     if twitter_user_info[2] == nil
       error_handling
       twitter_user_info[3] = "The twitter handle does not exist or the account's tweets are protected. Please change the privacy settings accordingly."
     end
   rescue Twitter::Error::BadRequest
     error_handling
-    twitter_user_info[3] = "The request to display tweets is invalid or cannot be otherwise served."
+    twitter_user_info[3] = "The request for displaying tweets is invalid or cannot be otherwise served."
   rescue Twitter::Error::Unauthorized
     error_handling
     twitter_user_info[3] = "The account's tweets are protected and cannot be displayed. Please change the privacy settings of the corresponding account."
   rescue Twitter::Error::Forbidden
     error_handling
-    twitter_user_info[3] = "The request to display tweets is understood, but it has been refused or access is not allowed."
+    twitter_user_info[3] = "The request for displaying tweets is understood, but it has been refused or access is not allowed."
   rescue Twitter::Error::NotAcceptable
     error_handling
-    twitter_user_info[3] = "An invalid format is specified in the request to display tweets."
+    twitter_user_info[3] = "An invalid format is specified in the request for displaying tweets."
   rescue Twitter::Error::TooManyRequests
     error_handling
     twitter_user_info[3] = "The rate-limit for accessing the tweets is reached. You should be able to display tweets in a couple of minutes."
+  rescue Twitter::Error::NotFound
+    error_handling
+    twitter_user_info[3] = "The twitter hanlde does not exist."
+  rescue Twitter::Error
+    error_handling
+    twitter_user_info[3] = "An error occured while fetching the tweets."
   end
 
   def error_handling
diff --git a/config/initializers/customization.rb b/config/initializers/customization.rb
index a96564c..6d9c741 100644
--- a/config/initializers/customization.rb
+++ b/config/initializers/customization.rb
@@ -19,8 +19,8 @@ customization_directory = APP_CONFIG["customization_directory"]
 # * For this to work, config.assets.initialize_on_precompile MUST be set to true, otherwise
 #   this initializer will never get called in production mode when the assets are precompiled.
 #
-Rails.application.config.assets.paths.unshift "#{customization_directory}/assets"
-
+Rails.application.config.assets.paths.unshift "#{customization_directory}/images"
+Rails.application.config.assets.paths.unshift "#{customization_directory}/stylesheets"
 #
 # Copy files to public
 #
diff --git a/doc/TWITTER_FEED.md b/doc/TWITTER_FEED.md
index dd3954c..3e54a4d 100644
--- a/doc/TWITTER_FEED.md
+++ b/doc/TWITTER_FEED.md
@@ -24,7 +24,7 @@ LEAP web app (as part of the main view).
   * Add also `--projectroot your_projectroot --twitterhandle your_twitterhandle` as well to not have manually put the data in your secrets-file
   * The full command looks like this: `script/generate_bearer_token --key your_consumerkey --secret your_consumersecret --projectroot your_projectroot --twitterhandle your_twitterhandle`
   * If you didn't give all your information to the script, had a typo or want to change anything else, please do so by finding the secrets-file at `/config/secrets.yml`
-  * Make sure that the correct twitterhandle and bearer-token is included
+  * Make sure that the correct twitter handle and bearer token is included
 
 * Deactivate your bearer token
   * To deactivate your generated bearer token you can run script/invalidate_bearer_token
@@ -32,4 +32,5 @@ LEAP web app (as part of the main view).
 
 ### Default avatar image ###
 
-This feature uses by default the twitter bird as avatar picture (Twitter_Logo_Blue.png). By using the Twitter trademarks, you agree to follow the Twitter Trademark Guidelines as well as Twitter's Terms of Service and all other Twitter rules and policies. Please find more details here: https://brand.twitter.com/.
+This feature uses by default the twitter bird as avatar picture, you can find here (app/assets/images/Avatar_Pic.png). For customization you can upload your own avatar picture to 'config/customization/images' naming the image file 'Avatar_Pic.png'. This will replace the default image file.
+By using the Twitter trademarks, you agree to follow the Twitter Trademark Guidelines as well as Twitter's Terms of Service and all other Twitter rules and policies. Please find more details here: https://brand.twitter.com/.
-- 
cgit v1.2.3


From a7ab66b0478c1845ed0fdbff7dd3c83ea804826c Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Fri, 23 Sep 2016 15:46:25 +0200
Subject: increase number of fetched tweets to make sure 3 most recent tweets
 without RTs and @ are displayed

---
 app/helpers/twitter_helper.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index 5a9d28c..2312ed9 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -22,7 +22,7 @@ module TwitterHelper
   def update_twitter_info
     twitter_user_info[0] = Time.now
     twitter_user_info[1] = twitter_client.user(twitter_handle).name
-    twitter_user_info[2] = twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(10)
+    twitter_user_info[2] = twitter_client.user_timeline(twitter_handle, {:count => 200}).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(3)
     if twitter_user_info[2] == nil
       error_handling
       twitter_user_info[3] = "The twitter handle does not exist or the account's tweets are protected. Please change the privacy settings accordingly."
-- 
cgit v1.2.3


From af32db82732060fe5a309977afdb648aa9a62212 Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Fri, 23 Sep 2016 16:47:01 +0200
Subject: Fixed typo in helper

---
 app/helpers/twitter_helper.rb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index 9b1d78d..f520286 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -22,7 +22,6 @@ module TwitterHelper
   def update_twitter_info
     twitter_user_info[0] = Time.now
     twitter_user_info[1] = twitter_client.user(twitter_handle).name
-<<<<<<< HEAD
     twitter_user_info[2] = twitter_client.user_timeline(twitter_handle, {:count => 200}).select{ |tweet| tweet.text.start_with?('RT','@')==false}.take(3)
     if twitter_user_info[2] == nil
       error_handling
-- 
cgit v1.2.3


From 69b182b1bf811e1d09c734debf0f71f8412dd6b7 Mon Sep 17 00:00:00 2001
From: luca-marie <ml.kochsiek@fu-berlin.de>
Date: Fri, 23 Sep 2016 16:56:58 +0200
Subject: Adapted description to use case 'tweets are protected'

---
 doc/TWITTER_FEED.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/TWITTER_FEED.md b/doc/TWITTER_FEED.md
index 552dc54..6deb432 100644
--- a/doc/TWITTER_FEED.md
+++ b/doc/TWITTER_FEED.md
@@ -41,7 +41,7 @@ production:
   * Add also `--projectroot your_projectroot --twitterhandle your_twitterhandle` as well to not have manually put the data in your secrets-file
   * The full command looks like this: `script/generate_bearer_token --key your_consumerkey --secret your_consumersecret --projectroot your_projectroot --twitterhandle your_twitterhandle`
   * If you didn't give all your information to the script, had a typo or want to change anything else, please do so by finding the secrets-file at `/config/secrets.yml`
-  * Make sure that the correct twitter-handle and bearer-token is included. The tweets of the twitter-account you want to have shown have to be public!
+  * Make sure that the correct twitter-handle and bearer-token is included. The account's tweets must not be protected, otherwise they cannot be displayed.
 
 * Deactivate your bearer token
   * To deactivate your generated bearer token you can run script/invalidate_bearer_token
-- 
cgit v1.2.3