mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-02 02:40:58 +01:00
Phame - fix some issues with feed reported on github (290, 291)
Summary: we need a link with type=self to pass xml validation. Note we will always fail validation until we remove any sigil-related stuff from the resultant HTML since we just made that up for our purposes. Also serves up the feed link on the blog view controller, complete with tooltip about how the custom domain stuff isn't supported. Test Plan: viewed a blog page and liked the feed uri property. viewed a feed and verified the new link self stuff. post push I'll try the validator again. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, vrana Differential Revision: https://secure.phabricator.com/D5667
This commit is contained in:
parent
2b8adb3a83
commit
649f5cc178
2 changed files with 27 additions and 2 deletions
|
@ -33,10 +33,17 @@ final class PhameBlogFeedController extends PhameController {
|
|||
->withVisibility(PhamePost::VISIBILITY_PUBLISHED)
|
||||
->execute();
|
||||
|
||||
$blog_uri = PhabricatorEnv::getProductionURI(
|
||||
$this->getApplicationURI('blog/feed/'.$blog->getID().'/'));
|
||||
$content = array();
|
||||
$content[] = phutil_tag('title', array(), $blog->getName());
|
||||
$content[] = phutil_tag('id', array(), PhabricatorEnv::getProductionURI(
|
||||
'/phame/blog/view/'.$blog->getID().'/'));
|
||||
$content[] = phutil_tag('id', array(), $blog_uri);
|
||||
$content[] = phutil_tag('link',
|
||||
array(
|
||||
'rel' => 'self',
|
||||
'type' => 'application/atom+xml',
|
||||
'href' => $blog_uri
|
||||
));
|
||||
|
||||
$updated = $blog->getDateModified();
|
||||
if ($posts) {
|
||||
|
|
|
@ -65,6 +65,9 @@ final class PhameBlogViewController extends PhameController {
|
|||
}
|
||||
|
||||
private function renderProperties(PhameBlog $blog, PhabricatorUser $user) {
|
||||
require_celerity_resource('aphront-tooltip-css');
|
||||
Javelin::initBehavior('phabricator-tooltips');
|
||||
|
||||
$properties = new PhabricatorPropertyListView();
|
||||
|
||||
$properties->addProperty(
|
||||
|
@ -75,6 +78,21 @@ final class PhameBlogViewController extends PhameController {
|
|||
pht('Domain'),
|
||||
$blog->getDomain());
|
||||
|
||||
$feed_uri = PhabricatorEnv::getProductionURI(
|
||||
$this->getApplicationURI('blog/feed/'.$blog->getID().'/'));
|
||||
$properties->addProperty(
|
||||
pht('Atom URI'),
|
||||
javelin_tag('a',
|
||||
array(
|
||||
'href' => $feed_uri,
|
||||
'sigil' => 'has-tooltip',
|
||||
'meta' => array(
|
||||
'tip' => pht('Atom URI does not support custom domains.'),
|
||||
'size' => 320,
|
||||
)
|
||||
),
|
||||
$feed_uri));
|
||||
|
||||
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
||||
$user,
|
||||
$blog);
|
||||
|
|
Loading…
Reference in a new issue