This commit is contained in:
r888888888
2013-11-20 16:56:59 -08:00
parent ae141228a1
commit 016fccbf0a
4 changed files with 131 additions and 8 deletions

View File

@@ -20,11 +20,7 @@ class PostPresenter < Presenter
else
tag_param = nil
end
if options[:mobile]
html << %{<a href="/m#{path}/#{post.id}#{tag_param}">}
else
html << %{<a href="#{path}/#{post.id}#{tag_param}">}
end
html << %{<a href="#{path}/#{post.id}#{tag_param}">}
html << %{<img src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
html << %{</a>}
html << %{</article>}

View File

@@ -12,7 +12,7 @@ module PostSetPresenters
end
posts.each do |post|
html << PostPresenter.preview(post, :tags => @post_set.tag_string, :raw => @post_set.raw, :mobile => options[:mobile])
html << PostPresenter.preview(post, options.merge(:tags => @post_set.tag_string, :raw => @post_set.raw))
html << "\n"
end

View File

@@ -3,7 +3,7 @@
<%= submit_tag "Go", :name => nil %>
<% end %>
<%= @post_set.presenter.post_previews_html(self, :mobile => true) %>
<%= @post_set.presenter.post_previews_html(self, :path_prefix => "/m/posts") %>
<%= numbered_paginator(@post_set.posts) %>

View File

@@ -508,6 +508,78 @@ CREATE SEQUENCE amazon_backups_id_seq
ALTER SEQUENCE amazon_backups_id_seq OWNED BY amazon_backups.id;
--
-- Name: artist_commentaries; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE artist_commentaries (
id integer NOT NULL,
post_id integer NOT NULL,
original_title text,
original_description text,
translated_title text,
translated_description text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: artist_commentaries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE artist_commentaries_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
--
-- Name: artist_commentaries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE artist_commentaries_id_seq OWNED BY artist_commentaries.id;
--
-- Name: artist_commentary_versions; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE artist_commentary_versions (
id integer NOT NULL,
post_id integer NOT NULL,
updater_id integer NOT NULL,
updater_ip_addr inet NOT NULL,
original_title text,
original_description text,
translated_title text,
translated_description text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: artist_commentary_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE artist_commentary_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
--
-- Name: artist_commentary_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE artist_commentary_versions_id_seq OWNED BY artist_commentary_versions.id;
--
-- Name: artist_urls; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
@@ -2814,6 +2886,20 @@ ALTER TABLE ONLY advertisements ALTER COLUMN id SET DEFAULT nextval('advertiseme
ALTER TABLE ONLY amazon_backups ALTER COLUMN id SET DEFAULT nextval('amazon_backups_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY artist_commentaries ALTER COLUMN id SET DEFAULT nextval('artist_commentaries_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY artist_commentary_versions ALTER COLUMN id SET DEFAULT nextval('artist_commentary_versions_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -3797,6 +3883,22 @@ ALTER TABLE ONLY amazon_backups
ADD CONSTRAINT amazon_backups_pkey PRIMARY KEY (id);
--
-- Name: artist_commentaries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY artist_commentaries
ADD CONSTRAINT artist_commentaries_pkey PRIMARY KEY (id);
--
-- Name: artist_commentary_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY artist_commentary_versions
ADD CONSTRAINT artist_commentary_versions_pkey PRIMARY KEY (id);
--
-- Name: artist_urls_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
@@ -4114,6 +4216,27 @@ CREATE INDEX index_advertisement_hits_on_created_at ON advertisement_hits USING
CREATE INDEX index_advertisements_on_ad_type ON advertisements USING btree (ad_type);
--
-- Name: index_artist_commentaries_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE UNIQUE INDEX index_artist_commentaries_on_post_id ON artist_commentaries USING btree (post_id);
--
-- Name: index_artist_commentary_versions_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX index_artist_commentary_versions_on_post_id ON artist_commentary_versions USING btree (post_id);
--
-- Name: index_artist_commentary_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX index_artist_commentary_versions_on_updater_id ON artist_commentary_versions USING btree (updater_id);
--
-- Name: index_artist_urls_on_artist_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
@@ -6431,4 +6554,8 @@ INSERT INTO schema_migrations (version) VALUES ('20130712162600');
INSERT INTO schema_migrations (version) VALUES ('20130914175431');
INSERT INTO schema_migrations (version) VALUES ('20131006193238');
INSERT INTO schema_migrations (version) VALUES ('20131006193238');
INSERT INTO schema_migrations (version) VALUES ('20131117150705');
INSERT INTO schema_migrations (version) VALUES ('20131118153503');