diff options
-rw-r--r-- | assets/css/_room.less | 7 | ||||
-rw-r--r-- | model/Room.php | 13 | ||||
-rw-r--r-- | template/assemblies/chat.phtml | 6 |
3 files changed, 25 insertions, 1 deletions
diff --git a/assets/css/_room.less b/assets/css/_room.less index 3202a87..8a0e6a4 100644 --- a/assets/css/_room.less +++ b/assets/css/_room.less @@ -64,6 +64,13 @@ body.room { .button-variant(white; @twitter; darken(@twitter, 5%);); } } + + > iframe.webchatframe { + width: 100%; + min-height: 12em; + height: 30vh; + border: 1px solid #ddd; + } } } diff --git a/model/Room.php b/model/Room.php index e5163a5..1fdbf7b 100644 --- a/model/Room.php +++ b/model/Room.php @@ -154,9 +154,20 @@ class Room ); } + public function hasWebchat() { + return $this->getConference()->get('ROOMS.'.$this->getSlug().'.WEBCHAT') && $this->getConference()->has('WEBCHAT_URL'); + } + + public function getWebchatUrl() { + return sprintf( + $this->getConference()->get('ROOMS.'.$this->getSlug().'.WEBCHAT_URL', $this->getConference()->get('WEBCHAT_URL')), + rawurlencode($this->getSlug()) + ); + } + public function hasChat() { - return $this->hasTwitter() || $this->hasIrc(); + return $this->hasTwitter() || $this->hasIrc() || $this->hasWebchat(); } diff --git a/template/assemblies/chat.phtml b/template/assemblies/chat.phtml index 8498c45..238565c 100644 --- a/template/assemblies/chat.phtml +++ b/template/assemblies/chat.phtml @@ -1,3 +1,9 @@ +<? if($room->hasWebchat()): ?> + <div> + <iframe class="webchatframe" src="<?=h($room->getWebchatUrl())?>"></iframe> + </div> +<? endif ?> + <? if($room->hasIrc()): ?> <div> <a class="btn btn-primary irclink" href="<?=h($room->getIrcUrl())?>" target="_blank"> |