summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluca-marie <ml.kochsiek@fu-berlin.de>2016-08-29 17:39:46 +0200
committerthea <ta.kupler@gmail.com>2016-09-01 12:09:37 +0200
commitea3fc6ffbb8f90aff28ce56fe4432a8d3ff18caa (patch)
tree0cd03af6e30206c272c9fe2b8cd78fdc51c17b24
parente3af6664f997d4dff227fdcd0246eff516520e96 (diff)
Changes mainly on CSS 'fine tuning' and shortening the Twitter API credentials,
- only bearer token is needed to access Twitter API
-rw-r--r--app/assets/stylesheets/twitter.scss55
-rw-r--r--app/helpers/twitter_helper.rb2
-rw-r--r--app/views/twitter/_index.html.erb22
-rw-r--r--config/config.yml167
-rw-r--r--config/defaults.yml5
5 files changed, 42 insertions, 209 deletions
diff --git a/app/assets/stylesheets/twitter.scss b/app/assets/stylesheets/twitter.scss
index 6b74cf7..b0ce982 100644
--- a/app/assets/stylesheets/twitter.scss
+++ b/app/assets/stylesheets/twitter.scss
@@ -1,21 +1,15 @@
.twitter {
position: relative;
- // top: 0;
- // right: 10px;
- // bottom: 0;
- // overflow: auto;
- // width: 250px;
}
+
.twitter_header {
- padding-top: 8px;
- height: 30px;
- font-size: 20px ;
- text-align: center;
- margin-bottom: 20px;
+ font-size: 20px;
+ text-align: left;
+ margin-bottom: 30px;
}
.twitter_list {
- position: relative;
+ box-sizing: border-box;
}
.tweet:hover {
@@ -25,33 +19,35 @@
.tweet {
border-bottom-style: solid;
border-color: #bfbfbf;
- // display: inline;
- // height: 32px;
- // width: 100%;
- // position: absolute;
- // text-align: center;
+ padding: 10px 8px;
+}
+
+.tweet_title {
+ position: relative;
+ height: 40px;
+ margin-bottom: 10px;
}
.tweet_pic {
display: block;
- float: left;
- width: 28px;
- height: 33px;
- padding-left: 8px;
- padding-top: 8px;
- // background: hsl(0, 0%, 30%);
-}
+ width: 40px;
+ height: 40px;
+ overflow: hidden;
+ position: absolute;
+ left: 0;
+ top: 0;
+ }
.tweet_name {
- padding-left: 45px;
- padding-top: 16px;
- // border-bottom-style: solid;
- // border-color: #00bfff;
+ padding-left: 50px;
+ line-height: 40px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
.tweet_text {
- padding-left: 8px;
- padding-top: 15px;
+box-sizing: border-box;
}
.tweet_text_date {
@@ -67,7 +63,6 @@
width: 40px;
height: 40px;
overflow: hidden;
- position: relative;
}
.twitter_image_frame > img {
diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb
index b01293f..d20b7da 100644
--- a/app/helpers/twitter_helper.rb
+++ b/app/helpers/twitter_helper.rb
@@ -5,8 +5,6 @@ module TwitterHelper
def twitter_client
Twitter::REST::Client.new do |config|
- config.consumer_key = Rails.application.secrets.twitter['consumer_key']
- config.consumer_secret = Rails.application.secrets.twitter['consumer_secret']
config.bearer_token = Rails.application.secrets.twitter['bearer_token']
end
end
diff --git a/app/views/twitter/_index.html.erb b/app/views/twitter/_index.html.erb
index 8ac65be..eba9675 100644
--- a/app/views/twitter/_index.html.erb
+++ b/app/views/twitter/_index.html.erb
@@ -1,26 +1,34 @@
<% if twitter_enabled == true %>
<div class="twitter">
+
<div class="twitter_header">
- Tweets by <%= twitter_name %></p>
+ Tweets by </br><%= twitter_name %></p>
</div>
+
<div class="twitter_list">
<% tweets.each do |e| %>
<div class="tweet">
+
+ <div class="tweet_title">
<div class="tweet_pic twitter_image_frame"><%= image_tag("team-loadtocode-Loading_icon.gif") %></div>
- <div class="tweet_name">
- @<%= twitter_handle %>
+ <div class="tweet_name">
+ @<%= twitter_handle %>
+ </div>
</div>
- <div class="tweet_text">
- <%= " #{e.text}" %>
+
+ <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 class="tweet_text_date">tweeted on <% t = e.created_at%> <%= t.strftime("%m/%d/%y").to_s %>
</div>
+
</div>
<% end %>
</div>
+
<div class="twitter_footer">
To prevent leakage no links are displayed. For more information visit @<%= twitter_name %> on twitter.com.</p>
</div>
+
</div>
<% end %>
diff --git a/config/config.yml b/config/config.yml
deleted file mode 100644
index ff3d936..0000000
--- a/config/config.yml
+++ /dev/null
@@ -1,167 +0,0 @@
-dev_ca: &dev_ca
- client_ca_key: "./test/files/ca.key"
- client_ca_cert: "./test/files/ca.crt"
- ca_key_password: nil
-
-cert_options: &cert_options
- client_cert_lifespan: "2 months"
- client_cert_bit_size: 2024
- client_cert_hash: "SHA256"
- allow_limited_certs: false
- allow_unlimited_certs: true
- allow_anonymous_certs: false
- limited_cert_prefix: "LIMITED"
- unlimited_cert_prefix: "UNLIMITED"
-
-downloads: &downloads
- client_download_domain: https://dl.bitmask.net
- available_clients:
- - linux
- - osx
- - windows
- - android
- download_paths:
- android: /android/
- linux: /linux/
- osx: /mac/
- windows: /windows/
- other: /
-
-common: &common
- force_ssl: false
- pagination_size: 30
- auth:
- token_expires_after: 60
-
- # handles that will be blocked from being used as logins or email aliases
- # in addition to the ones in /etc/passwd and http://tools.ietf.org/html/rfc2142
- handle_blacklist:
- - certmaster
- - ssladmin
- - arin-admin
- - administrator
- - www-data
- - maildrop
- - postmaster
- - admin
- - contact
- - info
- - noreply
- - robot
- - helpdesk
- - help
- - tickets
- - owner
- # handles that will be allowed despite being in /etc/passwd or rfc2142
- handle_whitelist: []
- # actions enabled in the account settings
- # see /users/app/views/users/_edit.html.haml for a list.
- user_actions: ['contact_email', 'destroy_account']
- admin_actions: ['contact_email', 'change_pgp_key', 'change_service_level', 'destroy_account']
- billing: ~
- default_locale: :en
- available_locales:
- - :cs
- - :de
- - :el
- - :en
- - :es
- - :fi
- - :fr
- - :hu
- - :it
- - :lt
- - :nb
- - :nl
- - :pl
- - :pt
- - :ru
- - :tr
- - :zh
- minimum_client_version: "0.5"
- engines:
- - support
- - billing
- allow_registration: true
- invite_required: false
- config_file_paths:
- soledad-service: 'public/1/config/soledad-service.json'
- eip-service: 'public/1/config/eip-service.json'
- smtp-service: 'public/1/config/smtp-service.json'
- provider: 'config/provider/provider.json'
- mailer:
- from_address: 'noreply'
-
-service_levels: &service_levels
- service_levels:
- 1:
- name: free
- description: "free account, with rate limited VPN"
- eip_rate_limit: true
- storage: 100
- services:
- - eip
- 2:
- name: premium
- description: "premium account, with unlimited vpn"
- rate:
- USD: 10
- EUR: 10
- services:
- - eip
- - email
- default_service_level: 1
-
-development:
- <<: *downloads
- <<: *dev_ca
- <<: *cert_options
- <<: *common
- <<: *service_levels
- admins: [blue, red, staff, ava]
- api_tokens:
- monitor: nil
- admin: nil
- domain: example.org
- secret_token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
- reraise_errors: true
-
- twitter:
- twitter_handle : 'xxxxxxxxxxxxxxxxx'
- consumer_key : 'xxxxxxxxxxxxxxxxx'
- consumer_secret : 'xxxxxxxxxxxxxxxxx'
- bearer_token : 'xxxxxxxxxxxxxxxxx'
-
-test:
- <<: *downloads
- <<: *dev_ca
- <<: *cert_options
- <<: *common
- <<: *service_levels
- admins: [admin, admin2]
- api_tokens:
- monitor: "212da28a59dcaca487365309dc93aa09"
- admin: nil
- allowed_ips:
- - 0.0.0.0
- domain: test.me
- secret_token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
- reraise_errors: true
- billing: {}
- default_locale: :en
- available_locales:
- - :en
- - :de
-
-production:
- <<: *downloads
- <<: *cert_options
- <<: *common
- admins: []
- api_tokens:
- monitor: nil
- admin: nil
- domain: example.net
- engines:
- - support
- # logfile: /path/to/your/logs
diff --git a/config/defaults.yml b/config/defaults.yml
index 1c9195f..c06ea7c 100644
--- a/config/defaults.yml
+++ b/config/defaults.yml
@@ -127,9 +127,8 @@ development:
reraise_errors: true
twitter:
- consumer_key : Change_to_your_consumer_key
- consumer_secret : Change_to_your_consumer_secret
- bearer_token : Change_to_your_bearer_token
+ twitter_handle : Change_to_your_Twitter_handle
+ bearer_token : Change_to_your_Bearer_token
test:
<<: *downloads