From efae4adfae2a8a34253f1458c1f4d384bcfd843a Mon Sep 17 00:00:00 2001 From: Justin Wagner Date: Wed, 10 Sep 2014 10:23:25 -0400 Subject: [PATCH 1/3] Change sizing for page icons on index page --- app/assets/stylesheets/horizontal.css | 3 ++- app/views/welcome/index.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/horizontal.css b/app/assets/stylesheets/horizontal.css index 83c1abc..fce7b0e 100644 --- a/app/assets/stylesheets/horizontal.css +++ b/app/assets/stylesheets/horizontal.css @@ -142,7 +142,8 @@ h1, h2, h3, h4, h5, h6, li, p { } .col-1 h3 { - margin: 20px 0; + font-size: 14px; + margin: 10px 0; } diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 0eec194..9142a15 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -21,7 +21,7 @@ <%= link_to story do %>
-

<%= story.name %>

+

<%= story.name %>

<% end %> From dc13301259336581699aef953aedfd0701cdc228 Mon Sep 17 00:00:00 2001 From: Justin Wagner Date: Wed, 10 Sep 2014 10:33:21 -0400 Subject: [PATCH 2/3] Added helper to shorten title names on index --- app/assets/stylesheets/horizontal.css | 1 + app/helpers/stories_helper.rb | 11 +++++++++++ app/views/welcome/index.html.erb | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/horizontal.css b/app/assets/stylesheets/horizontal.css index fce7b0e..5bd9eb9 100644 --- a/app/assets/stylesheets/horizontal.css +++ b/app/assets/stylesheets/horizontal.css @@ -144,6 +144,7 @@ h1, h2, h3, h4, h5, h6, li, p { .col-1 h3 { font-size: 14px; margin: 10px 0; + text-align: center; } diff --git a/app/helpers/stories_helper.rb b/app/helpers/stories_helper.rb index d18d8f1..e6c111d 100644 --- a/app/helpers/stories_helper.rb +++ b/app/helpers/stories_helper.rb @@ -6,4 +6,15 @@ def story_controls render :partial => 'stories/story_nav' end end + + def shorten_title(title) + if title.length > 10 + new_title = title[0..9] + new_title += "..." + return new_title + else + return title + end + end + end diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 9142a15..d2e39b8 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -21,7 +21,7 @@ <%= link_to story do %>
-

<%= story.name %>

+

<%= shorten_title(story.name) %>

<% end %> From a529b6b459fb5a7b5223b3f8cb9614fcfe66003d Mon Sep 17 00:00:00 2001 From: Joseph White Date: Wed, 10 Sep 2014 10:24:19 -0400 Subject: [PATCH 3/3] set up export module --- app/models/story.rb | 2 ++ lib/export.rb | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 lib/export.rb diff --git a/app/models/story.rb b/app/models/story.rb index 4ebef6b..3f9d847 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -1,4 +1,6 @@ class Story < ActiveRecord::Base + include Export + belongs_to :user has_many :sentences diff --git a/lib/export.rb b/lib/export.rb new file mode 100644 index 0000000..6ad0242 --- /dev/null +++ b/lib/export.rb @@ -0,0 +1,8 @@ +module Export + +def hi + puts "hi" +end + + +end