diff options
Diffstat (limited to 'view/tpl')
-rwxr-xr-x | view/tpl/conv_item.tpl | 14 | ||||
-rwxr-xr-x | view/tpl/cropcover.tpl | 2 | ||||
-rw-r--r-- | view/tpl/diaspora_vcard.tpl | 26 | ||||
-rwxr-xr-x | view/tpl/event_head.tpl | 7 | ||||
-rwxr-xr-x | view/tpl/jot-header.tpl | 83 | ||||
-rwxr-xr-x | view/tpl/jot.tpl | 29 | ||||
-rwxr-xr-x | view/tpl/nav.tpl | 2 | ||||
-rw-r--r-- | view/tpl/pdledit.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/profile_advanced.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/profile_vcard.tpl | 24 | ||||
-rw-r--r-- | view/tpl/wiki.tpl | 471 | ||||
-rw-r--r-- | view/tpl/wiki_page_history.tpl | 52 | ||||
-rw-r--r-- | view/tpl/wiki_page_list.tpl | 10 | ||||
-rw-r--r-- | view/tpl/wikilist.tpl | 20 | ||||
-rwxr-xr-x | view/tpl/xchan_vcard.tpl | 6 |
15 files changed, 713 insertions, 37 deletions
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 817a03028..903a23eed 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -4,7 +4,7 @@ </div> <div id="collapsed-comments-{{$item.id}}" class="collapsed-comments" style="display: none;"> {{/if}} - <div id="thread-wrapper-{{$item.id}}" class="thread-wrapper{{if $item.toplevel}} {{$item.toplevel}} generic-content-wrapper{{/if}}"> + <div id="thread-wrapper-{{$item.id}}" class="thread-wrapper{{if $item.toplevel}} {{$item.toplevel}} generic-content-wrapper h-entry {{else}} u-comment h-cite {{/if}}"> <a name="{{$item.id}}" ></a> <div class="wall-item-outside-wrapper {{$item.indent}}{{$item.previewing}}" id="wall-item-outside-wrapper-{{$item.id}}" > <div class="wall-item-content-wrapper {{$item.indent}}" id="wall-item-content-wrapper-{{$item.id}}" style="clear:both;"> @@ -20,8 +20,8 @@ {{/if}} <div class="wall-item-head"> <div class="wall-item-info" id="wall-item-info-{{$item.id}}" > - <div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}"> - <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}}" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a> + <div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}"> + <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link u-url" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a> </div> <div class="wall-item-photo-end" style="clear:both"></div> </div> @@ -39,14 +39,14 @@ <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}} {{$item.via}} <a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}} </div> <div class="wall-item-ago" id="wall-item-ago-{{$item.id}}"> - {{if $item.verified}}<i class="fa fa-check item-verified" title="{{$item.verified}}"></i> {{elseif $item.forged}}<i class="fa fa-exclamation item-forged" title="{{$item.forged}}"></i> {{/if}}{{if $item.location}}<span class="wall-item-location" id="wall-item-location-{{$item.id}}">{{$item.location}}, </span>{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}{{if $item.expiretime}} {{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}} <i class="fa fa-pencil"></i>{{/if}} {{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}} + {{if $item.verified}}<i class="fa fa-check item-verified" title="{{$item.verified}}"></i> {{elseif $item.forged}}<i class="fa fa-exclamation item-forged" title="{{$item.forged}}"></i> {{/if}}{{if $item.location}}<span class="wall-item-location p-location" id="wall-item-location-{{$item.id}}">{{$item.location}}, </span>{{/if}}<span class="autotime" title="{{$item.isotime}}"><time class="dt-published" datetime="{{$item.isotime}}">{{$item.localtime}}</time>{{if $item.editedtime}} {{$item.editedtime}}{{/if}}{{if $item.expiretime}} {{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}} <i class="fa fa-pencil"></i>{{/if}} {{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}} </div> <div class="clear"></div> </div> {{if $item.body}} <div class="wall-item-content" id="wall-item-content-{{$item.id}}"> - <div class="wall-item-body" id="wall-item-body-{{$item.id}}" > + <div class="wall-item-body e-content" id="wall-item-body-{{$item.id}}" > {{$item.body}} </div> <div class="clear"></div> @@ -66,7 +66,7 @@ {{/if}} {{if $item.categories}} <div class="body-tags" id="item-categories"> - <span class="tag">{{$item.categories}}</span> + <span class="tag p-category">{{$item.categories}}</span> </div> {{/if}} {{if $item.folders}} @@ -133,7 +133,7 @@ <li role="presentation"><a role="menuitem" href="#" onclick="jotShare({{$item.id}}); return false"><i class="fa fa-retweet" title="{{$item.share.0}}"></i> {{$item.share.0}}</a></li> {{/if}} {{if $item.plink}} - <li role="presentation"><a role="menuitem" href="{{$item.plink.href}}" title="{{$item.plink.title}}" ><i class="fa fa-external-link"></i> {{$item.plink.title}}</a></li> + <li role="presentation"><a role="menuitem" href="{{$item.plink.href}}" title="{{$item.plink.title}}" class="u-url"><i class="fa fa-external-link"></i> {{$item.plink.title}}</a></li> {{/if}} {{if $item.edpost}} <li role="presentation"><a role="menuitem" href="{{$item.edpost.0}}" title="{{$item.edpost.1}}"><i class="editpost fa fa-pencil"></i> {{$item.edpost.1}}</a></li> diff --git a/view/tpl/cropcover.tpl b/view/tpl/cropcover.tpl index 68c948889..04b96a603 100755 --- a/view/tpl/cropcover.tpl +++ b/view/tpl/cropcover.tpl @@ -28,7 +28,7 @@ minWidth: 240, minHeight: 87, maxWidth: 320, - maxHeight: 320, + maxHeight: 116, ratioDim: { x: 100, y:36 }, displayOnInit: true, onEndCrop: onEndCrop diff --git a/view/tpl/diaspora_vcard.tpl b/view/tpl/diaspora_vcard.tpl index f9dac9306..3812823da 100644 --- a/view/tpl/diaspora_vcard.tpl +++ b/view/tpl/diaspora_vcard.tpl @@ -1,51 +1,57 @@ <div style="display:none;"> + <dl class="entity_uid"> + <dt>Uid</dt> + <dd> + <span class="uid p-uid">{{$diaspora.guid}}</span> + </dd> + </dl> <dl class='entity_nickname'> <dt>Nickname</dt> <dd> - <a class="nickname url uid" href="{{$diaspora.podloc}}/" rel="me">{{$diaspora.fullname}}</a> + <a class="nickname p-nickname">{{$diaspora.nickname}}</a> </dd> </dl> - <dl class='entity_fn'> + <dl class='entity_full_name'> <dt>Full name</dt> <dd> - <span class='fn'>{{$diaspora.fullname}}</span> + <span class='fn p-name'>{{$diaspora.fullname}}</span> </dd> </dl> - <dl class='entity_given_name'> + <dl class='entity_first_name'> <dt>First name</dt> <dd> - <span class='given_name'>{{$diaspora.firstname}}</span> + <span class='given_name p-given-name'>{{$diaspora.firstname}}</span> </dd> </dl> <dl class='entity_family_name'> <dt>Family name</dt> <dd> - <span class='family_name'>{{$diaspora.lastname}}</span> + <span class='family_name p-family-name'>{{$diaspora.lastname}}</span> </dd> </dl> <dl class="entity_url"> <dt>URL</dt> <dd> - <a class="url" href="{{$diaspora.podloc}}/" id="pod_location" rel="me">{{$diaspora.podloc}}/</a> + <a href="{{$diaspora.podloc}}/" id="pod_location" >{{$diaspora.podloc}}/</a> </dd> </dl> <dl class="entity_photo"> <dt>Photo</dt> <dd> - <img class="photo avatar" height="300" width="300" src="{{$diaspora.photo300}}"> + <img class="photo u-photo avatar" height="300" width="300" src="{{$diaspora.photo300}}"> </dd> </dl> <dl class="entity_photo_medium"> <dt>Photo</dt> <dd> - <img class="photo avatar" height="100" width="100" src="{{$diaspora.photo100}}"> + <img class="photo u-photo avatar" height="100" width="100" src="{{$diaspora.photo100}}"> </dd> </dl> <dl class="entity_photo_small"> <dt>Photo</dt> <dd> - <img class="photo avatar" height="50" width="50" src="{{$diaspora.photo50}}"> + <img class="photo u-photo avatar" height="50" width="50" src="{{$diaspora.photo50}}"> </dd> </dl> <dl class="entity_searchable"> diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl index 5083c5835..762bdcbb8 100755 --- a/view/tpl/event_head.tpl +++ b/view/tpl/event_head.tpl @@ -30,6 +30,12 @@ function changeView(action, viewName) { $('#events-calendar').fullCalendar(action, viewName); var view = $('#events-calendar').fullCalendar('getView'); + if(view.type === 'agendaDay' || view.type === 'agendaWeek') { + $('#events-calendar').fullCalendar('option', 'height', 'auto'); + } + else { + $('#events-calendar').fullCalendar('option', 'height', ''); + } $('#title').text(view.title); } @@ -42,7 +48,6 @@ firstDay: {{$first_day}}, eventLimit: 3, - height: 'auto', monthNames: aStr['monthNames'], monthNamesShort: aStr['monthNamesShort'], diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 43df2e175..f3dd8cafe 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -364,6 +364,89 @@ function enableOnUser(){ {{$geotag}} + var initializeEmbedPhotoDialog = function () { + $('.embed-photo-selected-photo').each(function (index) { + $(this).removeClass('embed-photo-selected-photo'); + }); + getPhotoAlbumList(); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal(); + }; + + var choosePhotoFromAlbum = function (album) { + $.post("embedphotos/album", {name: album}, + function(data) { + if (data['status']) { + $('#embedPhotoModalLabel').html('{{$modalchooseimages}}'); + $('#embedPhotoModalBodyAlbumDialog').html('\ + <div><ul class="nav">\n\ + <li><a href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\ + <i class="fa fa-chevron-left"></i> \n\ + {{$modaldiffalbum}}\n\ + </a>\n\ + </li>\n\ + </ul><br></div>') + $('#embedPhotoModalBodyAlbumDialog').append(data['content']); + $('#embedPhotoModalBodyAlbumDialog').click(function (evt) { + evt.preventDefault(); + var image = document.getElementById(evt.target.id); + if (typeof($(image).parent()[0]) !== 'undefined') { + var imageparent = document.getElementById($(image).parent()[0].id); + $(imageparent).toggleClass('embed-photo-selected-photo'); + } + }); + $('#embedPhotoModalBodyAlbumListDialog').addClass('hide'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('hide'); + $('#embed-photo-OKButton').click(function () { + $('.embed-photo-selected-photo').each(function (index) { + var href = $(this).attr('href'); + $.post("embedphotos/photolink", {href: href}, + function(ddata) { + if (ddata['status']) { + addeditortext(ddata['photolink']); + } else { + window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']); + } + return false; + }, + 'json'); + }); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + }); + } else { + window.console.log('{{$modalerroralbum}} ' + JSON.stringify(album) + ':' + data['errormsg']); + } + return false; + }, + 'json'); + }; + + var getPhotoAlbumList = function () { + $.post("embedphotos/albumlist", {}, + function(data) { + if (data['status']) { + var albums = data['albumlist']; //JSON.parse(data['albumlist']); + $('#embedPhotoModalLabel').html('{{$modalchoosealbum}}'); + $('#embedPhotoModalBodyAlbumList').html('<ul class="nav"></ul>'); + for(var i=0; i<albums.length; i++) { + var albumName = albums[i].text; + var albumLink = '<li>'; + albumLink += '<a href="#" onclick="choosePhotoFromAlbum(\'' + albumName + '\');return false;">' + albumName + '</a>'; + albumLink += '</li>'; + $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink); + } + $('#embedPhotoModalBodyAlbumDialog').addClass('hide'); + $('#embedPhotoModalBodyAlbumListDialog').removeClass('hide'); + } else { + window.console.log('{{$modalerrorlist}}' + ':' + data['errormsg']); + } + return false; + }, + 'json'); + }; + </script> <script> diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 685706026..490349a04 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -79,6 +79,11 @@ <i id="profile-link" class="fa fa-link jot-icons"></i> </button> {{/if}} + {{if $embedPhotos}} + <button id="embed-photo-wrapper" class="btn btn-default btn-sm" title="{{$embedPhotos}}" onclick="initializeEmbedPhotoDialog();return false;"> + <i id="embed-photo" class="fa fa-file-image-o jot-icons"></i> + </button> + {{/if}} </div> <div class="btn-group hidden-xs hidden-sm"> {{if $setloc}} @@ -225,6 +230,30 @@ </div><!-- /.modal --> {{/if}} +{{if $embedPhotos}} +<div class="modal" id="embedPhotoModal" tabindex="-1" role="dialog" aria-labelledby="embedPhotoLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="embedPhotoModalLabel">{{$embedPhotosModalTitle}}</h4> + </div> + <div class="modal-body" id="embedPhotoModalBody" > + <div id="embedPhotoModalBodyAlbumListDialog" class="hide"> + <div id="embedPhotoModalBodyAlbumList"></div> + </div> + <div id="embedPhotoModalBodyAlbumDialog" class="hide"> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{$embedPhotosModalCancel}}</button> + <button id="embed-photo-OKButton" type="button" class="btn btn-primary">{{$embedPhotosModalOK}}</button> + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> +</div><!-- /.modal --> +{{/if}} + {{if $content || $attachment || $expanded}} <script>initEditor();</script> {{/if}} diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 5c8c097da..c0e17d6b5 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -17,7 +17,7 @@ </button> {{/if}} {{if $userinfo}} - <img class="dropdown-toggle fakelink" data-toggle="dropdown" id="avatar" src="{{$userinfo.icon}}" alt="{{$userinfo.name}}"><span class="caret" id="usermenu-caret"></span> + <img class="dropdown-toggle fakelink" data-toggle="dropdown" id="avatar" src="{{$userinfo.icon}}" alt="{{$userinfo.name}}"><span class="caret dropdown-toggle fakelink" data-toggle="dropdown" id="usermenu-caret"></span> {{if $localuser}} <ul class="dropdown-menu" role="menu" aria-labelledby="avatar"> {{foreach $nav.usermenu as $usermenu}} diff --git a/view/tpl/pdledit.tpl b/view/tpl/pdledit.tpl index 3e1f5a3fc..cef93d324 100644 --- a/view/tpl/pdledit.tpl +++ b/view/tpl/pdledit.tpl @@ -4,7 +4,7 @@ <h2>{{$mname}} {{$module}}</h2> <br /> -<a href="help/Comanche" target="hubzilla-help">{{$help}}</a> +<a href="help/comanche" target="hubzilla-help">{{$help}}</a> <br /> <br /> diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl index a4c98b1d0..d0c9621f9 100755 --- a/view/tpl/profile_advanced.tpl +++ b/view/tpl/profile_advanced.tpl @@ -282,7 +282,7 @@ <ul class="profile-thing-list"> {{foreach $items as $item}} <li>{{if $item.img}}<a href="{{$item.url}}" ><img src="{{$item.img}}" class="profile-thing-img" width="100" height="100" alt="{{$item.term}}" /></a>{{/if}} - <a href="{{$item.url}}" >{{$item.term}}</a> + <a href="{{$item.editurl}}" >{{$item.term}}</a> {{if $profile.canlike}}<br /> <button type="button" class="btn btn-default btn-sm" onclick="doprofilelike('thing/' + '{{$item.term_hash}}','like'); return false;" title="{{$likethis}}" > <i class="fa fa-thumbs-o-up" title="{{$likethis}}"></i> diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index 7d7d2019a..5e9d192a1 100755 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -1,6 +1,6 @@ -<div class="vcard"> +<div class="vcard h-card"> {{if ! $zcard}} - <div id="profile-photo-wrapper"><img class="photo" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.fullname}}"></div> + <div id="profile-photo-wrapper"><img class="photo u-photo" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.fullname}}"></div> {{/if}} {{if $connect}} <div class="connect-btn-wrapper"><a href="{{$connect_url}}" class="btn btn-block btn-success btn-sm"><i class="fa fa-plus"></i> {{$connect}}</a></div> @@ -25,29 +25,29 @@ {{/if}} {{if ! $zcard}} - <div class="fn">{{$profile.fullname}}{{if $profile.online}} <i class="fa fa-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div> - {{if $reddress}}<div class="reddress" oncopy="return false;">{{$profile.reddress}}</div>{{/if}} + <div class="fn p-name">{{$profile.fullname}}{{if $profile.online}} <i class="fa fa-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div> + {{if $reddress}}<div class="reddress">{{$profile.reddress}}</div>{{/if}} {{/if}} {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}} {{if $location}} <dl class="location"><dt class="location-label">{{$location}}</dt> - <dd class="adr"> - {{if $profile.address}}<div class="street-address">{{$profile.address}}</div>{{/if}} + <dd class="adr h-adr"> + {{if $profile.address}}<div class="street-address p-street-address">{{$profile.address}}</div>{{/if}} <span class="city-state-zip"> - <span class="locality">{{$profile.locality}}</span>{{if $profile.locality}}, {{/if}} - <span class="region">{{$profile.region}}</span> - <span class="postal-code">{{$profile.postal_code}}</span> + <span class="locality p-locality">{{$profile.locality}}</span>{{if $profile.locality}}, {{/if}} + <span class="region p-region">{{$profile.region}}</span> + <span class="postal-code p-postal-code">{{$profile.postal_code}}</span> </span> - {{if $profile.country_name}}<span class="country-name">{{$profile.country_name}}</span>{{/if}} + {{if $profile.country_name}}<span class="country-name p-country-name">{{$profile.country_name}}</span>{{/if}} </dd> </dl> {{/if}} - {{if $gender}}<dl class="mf"><dt class="gender-label">{{$gender}}</dt> <dd class="x-gender">{{$profile.gender}}</dd></dl>{{/if}} + {{if $gender}}<dl class="mf"><dt class="gender-label">{{$gender}}</dt> <dd class="p-gender">{{$profile.gender}}</dd></dl>{{/if}} {{if $marital}}<dl class="marital"><dt class="marital-label"><span class="heart"><i class="fa fa-heart"></i> </span>{{$marital}}</dt><dd class="marital-text">{{$profile.marital}}</dd></dl>{{/if}} - {{if $homepage}}<dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt><dd class="homepage-url">{{$profile.homepage}}</dd></dl>{{/if}} + {{if $homepage}}<dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt><dd class="homepage-url u-url">{{$profile.homepage}}</dd></dl>{{/if}} {{if $diaspora}} {{include file="diaspora_vcard.tpl"}} diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl new file mode 100644 index 000000000..1d8570828 --- /dev/null +++ b/view/tpl/wiki.tpl @@ -0,0 +1,471 @@ +<style type="text/css" media="screen"> + #ace-editor { + position: relative; + width: 100%; + height: 500px; + } + .fade.in { + -webkit-transition: opacity 0.5s 0.5s ease; + -moz-transition: opacity 0.5s 0.5s ease; + -o-transition: opacity 0.5s 0.5s ease; + transition: opacity 0.5s 0.5s ease; + } +</style> +<div class="generic-content-wrapper"> + <div class="section-title-wrapper"> + <div class="pull-right"> + {{if $showNewWikiButton}} + <button class="btn btn-primary btn-xs" onclick="$('#new-page-form-wrapper').hide(); openClose('new-wiki-form-wrapper');">New Wiki</button> + {{/if}} + {{if $showNewPageButton}} + <button class="btn btn-success btn-xs" onclick="$('#new-wiki-form-wrapper').hide(); openClose('new-page-form-wrapper');">New Page</button> + {{/if}} + <button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(); + adjustFullscreenTopBarHeight();"><i class="fa fa-expand"></i></button> + <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false); + adjustInlineTopBarHeight();"><i class="fa fa-compress"></i></button> + </div> + <h2><span id="wiki-header-name">{{$wikiheaderName}}</span>: <span id="wiki-header-page">{{$wikiheaderPage}}</span></h2> + <div class="clear"></div> + </div> + <div id="new-wiki-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> + <form id="new-wiki-form" action="wiki/{{$channel}}/create/wiki" method="post" > + <div class="clear"></div> + {{include file="field_input.tpl" field=$wikiName}} + + <div id="post-visible-container" class="form-group field checkbox"> + <span style="font-size:1.2em;" class="pull-left">Send notification post?</span> + <div style="margin-left:20px" class="pull-left"> + <input name="postVisible" id="postVisible" value="0" type="checkbox"> + <label class="switchlabel" for="postVisible"> + <span class="onoffswitch-inner" data-on="Post" data-off="None"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + + <div class="btn-group pull-right"> + <div id="profile-jot-submit-right" class="btn-group" style="margin-right: 20px;"> + <button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" title="Permission settings" onclick="return false;"> + <i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons">{{$bang}}</i> + </button> + </div> + <button id="new-wiki-submit" class="btn btn-primary" type="submit" name="submit" >Create Wiki</button> + </div> + <div>{{$acl}}</div> + </form> + <div class="clear"></div> + <hr> + </div> + + <div id="new-page-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> + <form id="new-page-form" action="wiki/create/page" method="post" > + <div class="clear"></div> + {{include file="field_input.tpl" field=$pageName}} + <div class="btn-group pull-right"> + <button id="new-page-submit" class="btn btn-success" type="submit" name="submit" >Create Page</button> + </div> + </form> <div class="clear"></div> + <hr> + </div> + + <div id="rename-page-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> + <form id="rename-page-form" action="wiki/rename/page" method="post" > + <div class="clear"></div> + {{include file="field_input.tpl" field=$pageRename}} + <div class="btn-group pull-right"> + <button id="rename-page-submit" class="btn btn-warning" type="submit" name="submit" >Rename Page</button> + </div> + </form> <div class="clear"></div> + <hr> + </div> + + <div id="wiki-content-container" class="section-content-wrapper" {{if $hideEditor}}style="display: none;"{{/if}}> + <ul class="nav nav-tabs" id="wiki-nav-tabs"> + <li><a data-toggle="tab" href="#edit-pane">Edit</a></li> + <li class="active"><a data-toggle="tab" href="#preview-pane" id="wiki-get-preview">Preview</a></li> + <li {{if $hidePageHistory}}style="display: none;"{{/if}}><a data-toggle="tab" href="#page-history-pane" id="wiki-get-history">History</a></li> + {{if $showPageControls}} + <li class="dropdown"> + <a data-toggle="dropdown" class="dropdown-toggle" href="#">Page <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a id="save-page" data-toggle="tab" href="#">Save</a></li> + <li><a id="rename-page" data-toggle="tab" href="#">Rename</a></li> + <li><a id="delete-page" data-toggle="tab" href="#">Delete</a></li> + <li class="divider"></li> + <li><a id="embed-image" data-toggle="tab" href="#">Embed image</a></li> + + </ul> + </li> + {{/if}} + </ul> + <div class="tab-content" id="wiki-page-tabs"> + + <div id="edit-pane" class="tab-pane fade"> + <div id="ace-editor"></div> + </div> + <div id="preview-pane" class="tab-pane fade in active"> + <div id="wiki-preview" class="section-content-wrapper"> + {{$renderedContent}} + </div> + </div> + <div id="page-history-pane" class="tab-pane fade" {{if $hidePageHistory}}style="display: none;"{{/if}}> + <div id="page-history-list" class="section-content-wrapper"> + </div> + </div> + + + </div> + </div> + {{if $showCommitMsg}} + <div class="section-content-wrapper"> + {{include file="field_input.tpl" field=$commitMsg}} + </div> + {{/if}} +</div> + +{{$wikiModal}} + + +<div class="modal" id="embedPhotoModal" tabindex="-1" role="dialog" aria-labelledby="embedPhotoLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="embedPhotoModalLabel">{{$embedPhotosModalTitle}}</h4> + </div> + <div class="modal-body" id="embedPhotoModalBody" > + <div id="embedPhotoModalBodyAlbumListDialog" class="hide"> + <div id="embedPhotoModalBodyAlbumList"></div> + </div> + <div id="embedPhotoModalBodyAlbumDialog" class="hide"> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{$embedPhotosModalCancel}}</button> + <button id="embed-photo-OKButton" type="button" class="btn btn-primary">{{$embedPhotosModalOK}}</button> + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> +</div><!-- /.modal --> + +<script> + window.wiki_resource_id = '{{$resource_id}}'; + window.wiki_page_name = '{{$page}}'; + window.wiki_page_content = {{$content}}; + window.wiki_page_commit = '{{$commit}}'; + + if (window.wiki_page_name === 'Home') { + $('#delete-page').hide(); + $('#rename-page').hide(); + } + + $("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary'); + $("#generic-modal-ok-{{$wikiModalID}}").addClass('btn-danger'); + + $('#rename-page').click(function (ev) { + $('#rename-page-form-wrapper').show(); + }); + + $( "#rename-page-form" ).submit(function( event ) { + $.post("wiki/{{$channel}}/rename/page", + { + oldName: window.wiki_page_name, + newName: $('#id_pageRename').val(), + resource_id: window.wiki_resource_id + }, + function (data) { + if (data.success) { + $('#rename-page-form-wrapper').hide(); + window.console.log('data: ' + JSON.stringify(data)); + window.wiki_page_name = data.name.urlName; + $('#wiki-header-page').html(data.name.htmlName); + wiki_refresh_page_list(); + } else { + window.console.log('Error renaming page.'); + } + }, 'json'); + event.preventDefault(); + }); + + $(document).ready(function () { + wiki_refresh_page_list(); + // Show Edit tab first. Otherwise the Ace editor does not load. + $("#wiki-nav-tabs li:eq(1) a").tab('show'); + }); + + var editor = ace.edit("ace-editor"); + editor.setTheme("ace/theme/github"); + editor.getSession().setMode("ace/mode/markdown"); + editor.getSession().setValue(window.wiki_page_content); + + $('#wiki-get-preview').click(function (ev) { + $.post("wiki/{{$channel}}/preview", {content: editor.getValue(), resource_id: window.wiki_resource_id}, function (data) { + if (data.success) { + $('#wiki-preview').html(data.html); + } else { + window.console.log('Error previewing page.'); + } + }, 'json'); + ev.preventDefault(); + }); + + $('#wiki-get-history').click(function (ev) { + $.post("wiki/{{$channel}}/history/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, function (data) { + if (data.success) { + $('#page-history-list').html(data.historyHTML); + } else { + window.console.log('Error getting page history.'); + } + }, 'json'); + ev.preventDefault(); + }); + +function wiki_delete_wiki(wikiHtmlName, resource_id) { + if(!confirm('Are you sure you want to delete the entire wiki: ' + JSON.stringify(wikiHtmlName))) { + return; + } + $.post("wiki/{{$channel}}/delete/wiki", {resource_id: resource_id}, function (data) { + if (data.success) { + window.console.log('Wiki deleted'); + // Refresh list and redirect page as necessary + window.location = 'wiki/{{$channel}}'; + } else { + alert('Error deleting wiki!'); + window.console.log('Error deleting wiki.'); + } + }, 'json'); +} + + + $('#new-page-submit').click(function (ev) { + if (window.wiki_resource_id === '') { + window.console.log('You must have a wiki open in order to create pages.'); + ev.preventDefault(); + return false; + } + $.post("wiki/{{$channel}}/create/page", {name: $('#id_pageName').val(), resource_id: window.wiki_resource_id}, + function (data) { + if (data.success) { + window.location = data.url; + } else { + window.console.log('Error creating page.'); + } + }, 'json'); + ev.preventDefault(); + }); + + function wiki_refresh_page_list() { + if (window.wiki_resource_id === '') { + return false; + } + $.post("wiki/{{$channel}}/get/page/list/", {resource_id: window.wiki_resource_id}, function (data) { + if (data.success) { + $('#wiki_page_list_container').html(data.pages); + $('#wiki_page_list_container').show(); + } else { + alert('Error fetching page list!'); + window.console.log('Error fetching page list!'); + } + }, 'json'); + return false; + } + + $('#save-page').click(function (ev) { + if (window.wiki_resource_id === '' || window.wiki_page_name === '') { + window.console.log('You must have a wiki page open in order to edit pages.'); + ev.preventDefault(); + return false; + } + var currentContent = editor.getValue(); + if (window.wiki_page_content === currentContent) { + window.console.log('No edits to save.'); + ev.preventDefault(); + return false; + } + $.post("wiki/{{$channel}}/save/page", + { content: currentContent, + commitMsg: $('#id_commitMsg').val(), + name: window.wiki_page_name, + resource_id: window.wiki_resource_id + }, + function (data) { + if (data.success) { + window.console.log('Page saved successfully.'); + window.wiki_page_content = currentContent; + $('#id_commitMsg').val(''); // Clear the commit message box + $('#wiki-get-history').click(); + } else { + alert('Error saving page.'); // TODO: Replace alerts with auto-timeout popups + window.console.log('Error saving page.'); + } + }, 'json'); + ev.preventDefault(); + }); + + $('#delete-page').click(function (ev) { + if (window.wiki_resource_id === '' || window.wiki_page_name === '' || window.wiki_page_name === 'Home') { + window.console.log('You must have a wiki page open in order to delete pages.'); + ev.preventDefault(); + return false; + } + $.post("wiki/{{$channel}}/delete/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, + function (data) { + if (data.success) { + window.console.log('Page deleted successfully.'); + var url = window.location.href; + if (url.substr(-1) == '/') url = url.substr(0, url.length - 2); + url = url.split('/'); + url.pop(); + window.location = url.join('/'); + } else { + alert('Error deleting page.'); // TODO: Replace alerts with auto-timeout popups + window.console.log('Error deleting page.'); + } + }, 'json'); + ev.preventDefault(); + }); + + function wiki_revert_page(commitHash) { + if (window.wiki_resource_id === '' || window.wiki_page_name === '') { + window.console.log('You must have a wiki page open in order to revert pages.'); + return false; + } + $.post("wiki/{{$channel}}/revert/page", {commitHash: commitHash, name: window.wiki_page_name, resource_id: window.wiki_resource_id}, + function (data) { + if (data.success) { + $('button[id^=revert-]').removeClass('btn-success'); + $('button[id^=revert-]').addClass('btn-danger'); + $('button[id^=revert-]').html('Revert'); + $('#revert-'+commitHash).removeClass('btn-danger'); + $('#revert-'+commitHash).addClass('btn-success'); + $('#revert-'+commitHash).html('Page reverted<br>but not saved'); + window.wiki_page_commit = commitHash; + // put contents in editor + editor.getSession().setValue(data.content); + } else { + window.console.log('Error reverting page.'); + } + }, 'json'); + } + + function wiki_compare_page(compareCommit) { + if (window.wiki_resource_id === '' || window.wiki_page_name === '' || window.wiki_page_commit === '') { + window.console.log('You must have a wiki page open in order to revert pages.'); + return false; + } + $.post("wiki/{{$channel}}/compare/page", + { + compareCommit: compareCommit, + currentCommit: window.wiki_page_commit, + name: window.wiki_page_name, + resource_id: window.wiki_resource_id + }, + function (data) { + if (data.success) { + var modalBody = $('#generic-modal-body-{{$wikiModalID}}'); + modalBody.html('<div class="descriptive-text">'+data.diff+'</div>'); + $('.modal-dialog').width('80%'); + $("#generic-modal-ok-{{$wikiModalID}}").off('click'); + $("#generic-modal-ok-{{$wikiModalID}}").click(function () { + wiki_revert_page(compareCommit); + $('#generic-modal-{{$wikiModalID}}').modal('hide'); + }); + $('#generic-modal-{{$wikiModalID}}').modal(); + } else { + window.console.log('Error comparing page.'); + } + }, 'json'); + } + + $('#embed-image').click(function (ev) { + initializeEmbedPhotoDialog(); + ev.preventDefault(); + }); + + + var initializeEmbedPhotoDialog = function () { + $('.embed-photo-selected-photo').each(function (index) { + $(this).removeClass('embed-photo-selected-photo'); + }); + getPhotoAlbumList(); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal(); + }; + + var choosePhotoFromAlbum = function (album) { + $.post("embedphotos/album", {name: album}, + function(data) { + if (data['status']) { + $('#embedPhotoModalLabel').html('{{$modalchooseimages}}'); + $('#embedPhotoModalBodyAlbumDialog').html('\ + <div><ul class="nav">\n\ + <li><a href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\ + <i class="fa fa-chevron-left"></i> \n\ + {{$modaldiffalbum}}\n\ + </a>\n\ + </li>\n\ + </ul><br></div>') + $('#embedPhotoModalBodyAlbumDialog').append(data['content']); + $('#embedPhotoModalBodyAlbumDialog').click(function (evt) { + evt.preventDefault(); + var image = document.getElementById(evt.target.id); + if (typeof($(image).parent()[0]) !== 'undefined') { + var imageparent = document.getElementById($(image).parent()[0].id); + $(imageparent).toggleClass('embed-photo-selected-photo'); + } + }); + $('#embedPhotoModalBodyAlbumListDialog').addClass('hide'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('hide'); + $('#embed-photo-OKButton').click(function () { + $('.embed-photo-selected-photo').each(function (index) { + var href = $(this).attr('href'); + $.post("embedphotos/photolink", {href: href}, + function(ddata) { + if (ddata['status']) { + var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '\n![image]($1)' ) + editor.getSession().insert(editor.getCursorPosition(), imgURL) + } else { + window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']); + } + return false; + }, + 'json'); + }); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + }); + } else { + window.console.log('{{$modalerroralbum}} ' + JSON.stringify(album) + ':' + data['errormsg']); + } + return false; + }, + 'json'); + }; + + var getPhotoAlbumList = function () { + $.post("embedphotos/albumlist", {}, + function(data) { + if (data['status']) { + var albums = data['albumlist']; //JSON.parse(data['albumlist']); + $('#embedPhotoModalLabel').html('{{$modalchoosealbum}}'); + $('#embedPhotoModalBodyAlbumList').html('<ul class="nav"></ul>'); + for(var i=0; i<albums.length; i++) { + var albumName = albums[i].text; + var albumLink = '<li>'; + albumLink += '<a href="#" onclick="choosePhotoFromAlbum(\'' + albumName + '\');return false;">' + albumName + '</a>'; + albumLink += '</li>'; + $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink); + } + $('#embedPhotoModalBodyAlbumDialog').addClass('hide'); + $('#embedPhotoModalBodyAlbumListDialog').removeClass('hide'); + } else { + window.console.log('{{$modalerrorlist}}' + ':' + data['errormsg']); + } + return false; + }, + 'json'); + }; + +</script> diff --git a/view/tpl/wiki_page_history.tpl b/view/tpl/wiki_page_history.tpl new file mode 100644 index 000000000..fef5d93a5 --- /dev/null +++ b/view/tpl/wiki_page_history.tpl @@ -0,0 +1,52 @@ +<style> + .diff td{ + padding:0 0.667em; + vertical-align:top; + white-space:pre; + white-space:pre-wrap; + font-family:Consolas,'Courier New',Courier,monospace; + font-size:1.0em; + line-height:1.333; + } + + .diff span{ + display:block; + min-height:1.333em; + margin-top:-1px; + padding:0 3px; + } + + * html .diff span{ + height:1.333em; + } + + .diff span:first-child{ + margin-top:0; + } + + .diffDeleted span{ + border:1px solid rgb(255,192,192); + background:rgb(255,224,224); + } + + .diffInserted span{ + border:1px solid rgb(192,255,192); + background:rgb(224,255,224); + } +</style> +<table class="table-striped table-responsive table-hover" style="width: 100%;"> + {{foreach $pageHistory as $commit}} + <tr><td> + <table id="rev-{{$commit.hash}}" onclick="$('#details-{{$commit.hash}}').show()" width="100%"> + <tr><td width="10%">Date</td><td width="70%">{{$commit.date}}</td> + <td rowspan="3" width="20%" align="right"> + <button id="revert-{{$commit.hash}}" class="btn btn-danger btn-xs" onclick="wiki_revert_page('{{$commit.hash}}')">Revert</button> + <br><br> + <button id="compare-{{$commit.hash}}" class="btn btn-warning btn-xs" onclick="wiki_compare_page('{{$commit.hash}}')">Compare</button> + </td></tr> + <tr><td>Name</td><td>{{$commit.name}} <{{$commit.email}}></td></tr> + <tr><td>Message</td><td>{{$commit.title}}</td></tr> + </table> + </td></tr> + {{/foreach}} +</table> diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl new file mode 100644 index 000000000..1c3254465 --- /dev/null +++ b/view/tpl/wiki_page_list.tpl @@ -0,0 +1,10 @@ +{{if $not_refresh}}<div id="wiki_page_list_container" {{if $hide}} style="display: none;" {{/if}}>{{/if}} +<div id="wiki_page_list" class="widget" > + <h3>{{$header}}</h3> + <ul class="nav nav-pills nav-stacked"> + {{foreach $pages as $page}} + <li><a href="/wiki/{{$channel}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a></li> + {{/foreach}} + </ul> +</div> +{{if $not_refresh}}</div>{{/if}} diff --git a/view/tpl/wikilist.tpl b/view/tpl/wikilist.tpl new file mode 100644 index 000000000..be353ca5e --- /dev/null +++ b/view/tpl/wikilist.tpl @@ -0,0 +1,20 @@ +<div id="wiki_list" class="widget"> + <h3>{{$header}}</h3> + <ul class="nav nav-pills nav-stacked"> + {{foreach $wikis as $wiki}} + <li class="dropdown" id="wiki-{{$wiki.resource_id}}"> + <a class="dropdown-toggle" data-toggle="dropdown" href="#"> + <b>{{$wiki.title}}</b><b class="fa fa-caret-down pull-right"></b> + </a> + <ul class="dropdown-menu pull-right"> + <li><a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="View {{$wiki.title}}">View</a></li> + {{if $showControls}} + <li class="divider"></li> + <li><a href="#" onclick="wiki_delete_wiki('{{$wiki.title}}','{{$wiki.resource_id}}'); return false;" title="Delete {{$wiki.title}}">Delete wiki</a></li> + {{/if}} + </ul> + </li> + {{/foreach}} + </ul> +</div> + diff --git a/view/tpl/xchan_vcard.tpl b/view/tpl/xchan_vcard.tpl index 9a1e23beb..ac796cd47 100755 --- a/view/tpl/xchan_vcard.tpl +++ b/view/tpl/xchan_vcard.tpl @@ -1,9 +1,9 @@ -<div id="vcard" class="vcard"> -<div id="profile-photo-wrapper"><a href="{{$link}}"><img class="vcard-photo photo" src="{{$photo}}" alt="{{$name}}" /></a></div> +<div id="vcard" class="vcard h-card"> +<div id="profile-photo-wrapper"><a href="{{$link}}"><img class="vcard-photo photo u-photo" src="{{$photo}}" alt="{{$name}}" /></a></div> {{if $connect}} <div class="connect-btn-wrapper"><a href="follow?f=&url={{$follow}}" class="btn btn-block btn-success btn-sm"><i class="fa fa-plus"></i> {{$connect}}</a></div> {{/if}} -<div class="fn">{{$name}}</div> +<div class="fn p-name">{{$name}}</div> </div> |