summaryrefslogtreecommitdiff
path: root/templates/crosspost.tpl
blob: 22c12854fd054af31e287e098e9967e276acf29b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{strip}
<div class="edit crosspost">
	<div class="header">
		<h2>{tr}Crosspost{/tr}</h2>
	</div>

	<div class="body">
		{form enctype="multipart/form-data" name="blogpost" id="editpageform"}
			<input type="hidden" name="post_id" value="{$post_id|escape}" />
			<input type="hidden" name="rows" value="{$rows}"/>
			<input type="hidden" name="cols" value="{$cols}"/>
					{legend legend="Crosspost"}
						{* we loop over this twice because we want two separate lists from the same hash *}
						{if $availableBlogs}
							<div class="form-group">
								{formlabel label="Blogs this Post is Already Crossposted To" for="blog_id"}
								{forminput}
										{foreach from=$availableBlogs key=blogContentId item=availBlogTitle}
											{if $gContent->mInfo.blogs.$blogContentId && ($blogContentId != $crosspost.blog_content_id) }
												{assign var="has_crosspost" value=true}
												{$availBlogTitle|escape}
												&nbsp;<a title="{tr}Edit{/tr}" href="{$smarty.const.BLOGS_PKG_URL}crosspost.php?blog_content_id={$blogContentId}&amp;post_id={$post_info.post_id}">{biticon ipackage="icons" iname="edit" iexplain="edit crosspost note"}</a>
												&nbsp;<a title="{tr}Remove{/tr}" href="{$smarty.const.BLOGS_PKG_URL}crosspost.php?action=remove&amp;post_id={$post_info.post_id}&amp;blog_content_id={$blogContentId}&amp;status_id=300">{biticon ipackage="icons" iname="user-trash" iexplain="delete this crossposting"}</a><br/>
											{/if}
										{/foreach}
										{if !$has_crosspost}
											{formhelp note="This blog post has not been crossposted to any blogs yet."}
										{else}
											{formhelp note=""}
										{/if}
								{/forminput}
							</div><br/>
						{/if}

						{if $availableBlogs}
							<div class="form-group">
								{formlabel label="Include in Blogs" for="blog_id"}
								{forminput}
										{foreach from=$availableBlogs key=blogContentId item=availBlogTitle}
											{if !$gContent->mInfo.blogs.$blogContentId || ($blogContentId == $crosspost.blog_content_id) }
												{assign var="has_crosspost_option" value=true}
												<input name="blog_content_id[]" type="checkbox" option value="{$blogContentId}" {if $blogContentId == $crosspost.blog_content_id}checked="checked"{/if}>{$availBlogTitle|escape}</option><br/>
											{/if}
										{/foreach}
										{if !$has_crosspost_option}
											{formhelp note="This blog post has been crossposted to all blogs you have permission to cross post to."}
										{else}
											{formhelp note="You can cross post to any and all of the blogs listed above.<br />Just check off the blogs you wish this post to also show up in."}
										{/if}
								{/forminput}
							</div>
						{/if}

						{* if $has_crosspost_option}
						{formlabel label="Crosspost Note Format"}
							{forminput}
								{foreach name=formatPlugins from=$gLibertySystem->mPlugins item=plugin key=guid}
									{if $plugin.edit_field|default:'' eq $post_info.format_guid}
										{$plugin.edit_label}
									{/if}
								{/foreach}
							{/forminput}
							{textarea id="crosspost_note" label="Crosspost Note (Optional)" name="crosspost_note" noformat="y" rows=6 help="Add a note you would like to appear above the post when viewed on the crossposted blog. This does not appear on the post page." edit=$crosspost.crosspost_note}

							<div class="form-group submit">
								<input type="submit" class="btn btn-default" name="preview" value="{tr}Preview{/tr}" />&nbsp;
								<input type="submit" class="btn btn-default" name="save_post_exit" value="{tr}Save{/tr}" />
							</div>
						{/if *}
					{/legend}
		{/form}



		{* ------this is the same as the guts of view_blog_post---- *}
		<div class="display blogs">
			<div class="header">

				{if !empty($post_info.blogtitle)}
					<h1>{$post_info.blogtitle|escape}</h1>
				{/if}

				<div class="navigation">
					{if $gContent_previous}
						<span class="left">
							Previous: <a href="{$gContent_previous->getDisplayUrl()}">{$gContent_previous->getTitle()|escape}</a>
						</span>
					{/if}

					{if $gContent_next}
						<span class="right">
							Next: <a href="{$gContent_next->getDisplayUrl()}">{$gContent_next->getTitle()|escape}</a>
						</span>
					{/if}
				</div>

				<h1>
					{if $post_info.use_title eq 'y'}
						{$post_info.title|escape}
					{else}
						{$post_info.publish_date|default:$post_info.created|bit_long_date}
					{/if}
				</h1>

				<div class="date">
					{tr}Posted by{/tr} {displayname hash=$post_info}<br />
					{tr}Posted on{/tr} {$post_info.publish_date|default:$post_info.created|bit_long_date}<br/>
					{if count($post_info.blogs) > 0}
						{tr}Posted to{/tr}
						{foreach from=$post_info.blogs item=memberBlog key=blogContentId name=memberBlogLoop}
							<a href="{$memberBlog.blog_url}">{$memberBlog.title}</a>{if $smarty.foreach.memberBlogLoop.total > 1 && !$smarty.foreach.memberBlogLoop.last }, {/if}
						{/foreach}
					<br />
					{/if}
				</div>
			</div>

			<div class="body">
				<div class="content">
					{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$post_info}

					{$parsed_data}
				</div> <!-- end .content -->
			</div> <!-- end .body -->

			<div class="footer">
				<a href="{$post_info.display_url}" rel="bookmark">{tr}Permalink{/tr}</a>
				{tr}referenced by{/tr} {$post_info.trackbacks_from_count} {tr}posts{/tr} | {tr}references{/tr} {$post_info.trackbacks_to_count} {tr}posts{/tr}
				{if $post_info.allow_comments eq 'y' && $gBitSystem->isFeatureActive( 'blog_posts_comments' )}
					| {$post_info.num_comments} {tr}comments{/tr}
				{/if}
			</div> {* end .footer *}

		</div> {* end .blog *}
	</div>
</div>
{/strip}