From bb22e23dfb923fd543973a73f161e6e295eaa465 Mon Sep 17 00:00:00 2001 From: Mikel Maron Date: Thu, 6 Oct 2016 21:47:29 -0400 Subject: [PATCH] css in right place; fix structure.sql --- app/assets/stylesheets/common.scss | 7 +++++++ app/views/diary_entry/view.html.erb | 4 ++-- db/structure.sql | 22 +++++++++++++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index e8c480f56..7e7940d35 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1679,6 +1679,13 @@ tr.turn:hover { float: left; } + +.diary-subscribe-buttons { + position:relative; + top: -30px; + left: 130px; +} + /* Rules for the log in page */ #login_auth_buttons { diff --git a/app/views/diary_entry/view.html.erb b/app/views/diary_entry/view.html.erb index 3e9686922..b1159195d 100644 --- a/app/views/diary_entry/view.html.erb +++ b/app/views/diary_entry/view.html.erb @@ -22,9 +22,9 @@ <%= submit_tag t('diary_entry.view.save_button') %> <% end %> <% if @user and @entry.subscribers and @entry.subscribers.exists?(@user.id) %> -
<%= link_to t('javascripts.changesets.show.unsubscribe'), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %>
+
<%= link_to t('javascripts.changesets.show.unsubscribe'), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %>
<% elsif @user %> -
<%= link_to t('javascripts.changesets.show.subscribe'), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %>
+
<%= link_to t('javascripts.changesets.show.subscribe'), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %>
<% end %> <% end %> diff --git a/db/structure.sql b/db/structure.sql index cbed6c8ce..a3e80ba45 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -549,6 +549,14 @@ CREATE SEQUENCE diary_entries_id_seq ALTER SEQUENCE diary_entries_id_seq OWNED BY diary_entries.id; +-- Name: diary_entry_subscriptions; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE diary_entry_subscriptions ( + user_id bigint NOT NULL, + diary_entry_id bigint NOT NULL +); + -- -- Name: friends; Type: TABLE; Schema: public; Owner: - @@ -1828,6 +1836,19 @@ CREATE UNIQUE INDEX index_changesets_subscribers_on_subscriber_id_and_changeset_ CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key); +-- Name: index_diary_entry_subscriptions_on_diary_entry_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_diary_entry_subscriptions_on_diary_entry_id ON diary_entry_subscriptions USING btree (diary_entry_id); + + +-- +-- Name: index_diary_subscriptions_on_user_id_and_diary_entry_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX index_diary_subscriptions_on_user_id_and_diary_entry_id ON diary_entry_subscriptions USING btree (user_id, diary_entry_id); + + -- -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: - -- @@ -2643,4 +2664,3 @@ INSERT INTO schema_migrations (version) VALUES ('7'); INSERT INTO schema_migrations (version) VALUES ('8'); INSERT INTO schema_migrations (version) VALUES ('9'); - -- 2.43.2