about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-01 16:58:13 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-01 16:58:13 +0100
commit57304ac375e905fb0efa1b98a6100828bdbef2e1 (patch)
tree820e85a777938b618cc18fe3d45c0fcc9aaf7179 /app
parentbab4904492dff61f20f44e6e0daf040173990214 (diff)
Catch 404 errors when downloading remote media, add screenshot to landing page
Diffstat (limited to 'app')
-rw-r--r--app/assets/images/screenshot.pngbin0 -> 354585 bytes
-rw-r--r--app/assets/stylesheets/about.scss29
-rw-r--r--app/models/account.rb2
-rw-r--r--app/models/media_attachment.rb2
-rw-r--r--app/views/about/index.html.haml5
5 files changed, 37 insertions, 1 deletions
diff --git a/app/assets/images/screenshot.png b/app/assets/images/screenshot.png
new file mode 100644
index 000000000..6404cc214
--- /dev/null
+++ b/app/assets/images/screenshot.png
Binary files differdiff --git a/app/assets/stylesheets/about.scss b/app/assets/stylesheets/about.scss
index 84627383a..5ebe2576f 100644
--- a/app/assets/stylesheets/about.scss
+++ b/app/assets/stylesheets/about.scss
@@ -6,7 +6,8 @@
     max-width: 600px;
     margin: 0 auto;
     color: #9baec8;
-    padding-top: 200px;
+    padding-top: 50px;
+    padding-bottom: 50px;
   }
 
   h1 {
@@ -39,6 +40,32 @@
     font-weight: 300;
   }
 
+  .screenshot {
+    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
+    margin-bottom: 26px;
+
+    img {
+      max-width: 100%;
+      height: auto;
+      display: block;
+    }
+  }
+
+  .actions {
+    overflow: hidden;
+
+    .info {
+      float: right;
+      text-align: right;
+      line-height: 36px;
+
+      a {
+        color: #9baec8;
+        text-decoration: underline;
+      }
+    }
+  }
+
   @media screen and (max-width: 360px) {
     .wrapper {
       padding: 20px;
diff --git a/app/models/account.rb b/app/models/account.rb
index 8542852bc..0a6ba182b 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -112,6 +112,8 @@ class Account < ApplicationRecord
   def avatar_remote_url=(url)
     self.avatar = URI.parse(url) unless self[:avatar_remote_url] == url
     self[:avatar_remote_url] = url
+  rescue OpenURI::HTTPError
+    #
   end
 
   def object_type
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb
index 55eabc226..a740792f2 100644
--- a/app/models/media_attachment.rb
+++ b/app/models/media_attachment.rb
@@ -20,6 +20,8 @@ class MediaAttachment < ApplicationRecord
 
   def file_remote_url=(url)
     self.file = URI.parse(url)
+  rescue OpenURI::HTTPError
+    #
   end
 
   def image?
diff --git a/app/views/about/index.html.haml b/app/views/about/index.html.haml
index 831e7f854..5fa6f58b3 100644
--- a/app/views/about/index.html.haml
+++ b/app/views/about/index.html.haml
@@ -18,6 +18,11 @@
     %em= Rails.configuration.x.local_domain
     is a Mastodon instance.
 
+  .screenshot= image_tag 'screenshot.png'
+
   .actions
+    .info
+      = link_to 'Source code', 'https://github.com/Gargron/mastodon'
+
     = link_to 'Get started', new_user_registration_path, class: 'button'
     = link_to 'Log in', new_user_session_path, class: 'button'