diff options
Diffstat (limited to 'etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs')
-rw-r--r-- | etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs | 199 |
1 files changed, 78 insertions, 121 deletions
diff --git a/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs b/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs index 1f33eb8..e101196 100644 --- a/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs +++ b/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs @@ -14,35 +14,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ %> <% + template.inherit('page.ejs'); helpers.setHtmlTitle("EtherPad: Browse tags"); helpers.includeCss("plugins/twitterStyleTags/tagBrowser.css"); helpers.includeCss("plugins/twitterStyleTags/pad.css"); - helpers.setBodyId("padbody"); - helpers.addBodyClass("limwidth nonpropad nonprouser"); - helpers.includeCss("pad2_ejs.css"); - helpers.includeJs("undo-xpopup.js"); - helpers.includeCometJs(); - helpers.includeJQuery(); - helpers.includeJs("json2.js"); - helpers.includeJs("colorutils.js"); - helpers.includeJs("ace.js"); - helpers.includeJs("collab_client.js"); - helpers.includeJs("draggable.js"); - helpers.includeJs("pad_utils.js"); - helpers.includeJs("pad_cookie.js"); - helpers.includeJs("pad_editor.js"); - helpers.includeJs("pad_userlist.js"); - helpers.includeJs("pad_editbar.js"); - helpers.includeJs("pad_chat.js"); - helpers.includeJs("pad_docbar.js"); - helpers.includeJs("pad_impexp.js"); - helpers.includeJs("pad_savedrevs.js"); - helpers.includeJs("pad_connectionstatus.js"); - helpers.includeJs("pad_modals.js"); - helpers.includeJs("pad2.js"); - helpers.suppressGA(); - helpers.setRobotsPolicy({index: false, follow: false}); - helpers.addToHead('\n<link rel="alternate" href="/ep/tag/?query=' + tagsToQuery(tags, antiTags) + '&format=rss" type="application/rss+xml" title="Query results as RSS" />\n'); + helpers.addToHead('\n<link rel="alternate" href="' + helpers.updateToUrl({format:'rss'}) + '" type="application/rss+xml" title="Query results as RSS" />\n'); function inArray(item, arr) { for (var i = 0; i < arr.length; i++) @@ -51,108 +27,89 @@ limitations under the License. */ %> return false; } %> +<% template.define('docBarTitle', function() { var ejs_data=''; %> + <td id="docbarpadtitle"><span>Browse Tags</span></td> +<% return ejs_data; }); %> -<div id="padpage"> - <div id="padtop"> - <div id="topbar"> - <div id="topbarleft"><!-- --></div> - <div id="topbarright"><!-- --></div> - <div id="topbarcenter"><a href="/" id="topbaretherpad">EtherPad</a></div> - <% if (isProAccountHolder) { %> - <div id="accountnav"><%= toHTML(account.email) %><a href="/ep/account/sign-out">(sign out)</a></div> - <% } else if (isPro) { %> - <div id="accountnav"><a href="<%= signinUrl %>">sign in</a></div> +<% + template.define('docBarItems', function() { + return plugins.callHookStr('docbarItemsTagBrowserPad', {}, '', '', '') + + plugins.callHookStr('docbarItemsTagBrowser', {}, '', '', ''); + }); +%> + +<% template.define('sideBar', function() { var ejs_data=''; %> + <div id="padusers"> + <% if (isProAccountEnabled()) { %> + <a href="/ep/pad/newpad" style="padding: 25px 0" id="home-newpad"> + Create new pad + </a> + <a href="/ep/pro-signup/" style="padding: 25px 0" id="home-newteam"> + Create new team + </a> + <% } else { %> + <a href="/ep/pad/newpad" id="home-newpad"> + Create new pad + </a> <% } %> </div> - <div id="docbar"> - <table border="0" cellpadding="0" cellspacing="0" width="100%" id="docbartable"> - <td><img src="/static/img/jun09/pad/roundcorner_left.gif"></td> - <td id="docbarpadtitle"><span>Browse Tags</span></td> - <td width="100%"> </td> - <td><img src="/static/img/jun09/pad/roundcorner_right.gif"></td> - </table> - </div> - <div id="padmain"> - <div id="padsidebar"> - <div id="padusers"> - <% if (isProAccountEnabled()) { %> - <a href="/ep/pad/newpad" style="padding: 25px 0" id="home-newpad"> - Create new pad - </a> - <a href="/ep/pro-signup/" style="padding: 25px 0" id="home-newteam"> - Create new team - </a> - <% } else { %> - <a href="/ep/pad/newpad" id="home-newpad"> - Create new pad - </a> - <% } %> - </div> + <div id="hdraggie"><!-- --></div> - <div id="hdraggie"><!-- --></div> + <div id="padchat"><iframe src="<%= config['motdPage'] %>" width="100%" height="100%"></iframe></div> +<% return ejs_data; }); %> - <div id="padchat"><iframe src="<%= config['motdPage'] %>" width="100%" height="100%"></iframe></div> - </div> <!-- /padsidebar --> - - <div id="padeditor"> - <div id="editbar" class="enabledtoolbar"> - <div id="editbarleft"><!-- --></div> - <div id="editbarright"><!-- --></div> - - <div id="editbarinner"> - Query: - <% if (tags.length == 0 && antiTags.length == 0) { %> - Latest changed pads - <% } else { %> - <% for (i = 0; i < tags.length; i++) { %> - <a href="/ep/tag/?query=<%= tagsToQuery(tags.filter(function (tag) { return tag != tags[i]}), antiTags) %>" class="padtag" title="<%= tags[i] %> matches">#<%= tags[i] %></a> - <% } %> - <% for (i = 0; i < antiTags.length; i++) { %> - <a href="/ep/tag/?query=<%= tagsToQuery(tags, antiTags.filter(function (tag) { return tag != antiTags[i]})) %>" class="anti_padtag" title="<%= antiTags[i] %> matches">!#<%= antiTags[i] %></a> - <% } %> - <% } %> - </div> - </div> - <div id="editorcontainerbox"> - <div id="editorcontainer"> - <div class="query-refiner"> - <h1>Search for pads that have the tag</h1> - <% for (i = 0; i < newTags.length; i++) { %> - <a href="/ep/tag/?query=<%= tagsToQuery(tags.concat([newTags[i].tagname]),antiTags) %>" class="padtag" title="<%= newTags[i].matches %> matches">#<%= newTags[i].tagname %></a> - <% } %> +<% template.define('editBarItemsLeft', function() { var ejs_data=''; %> + <td> + Query: + <% if (tags.length == 0 && antiTags.length == 0) { %> + Latest changed pads + <% } else { %> + <% for (i = 0; i < tags.length; i++) { %> + <a href="<%= helpers.updateToUrl({query:tagQuery.tagsToQuery(tags.filter(function (tag) { return tag != tags[i]}), antiTags)}) %>" class="padtag" title="<%= tags[i] %> matches">#<%= tags[i] %></a> + <% } %> + <% for (i = 0; i < antiTags.length; i++) { %> + <a href="<%= helpers.updateToUrl({query:tagQuery.tagsToQuery(tags, antiTags.filter(function (tag) { return tag != antiTags[i]}))}) %>" class="anti_padtag" title="<%= antiTags[i] %> matches">!#<%= antiTags[i] %></a> + <% } %> + <% } %> + </td> +<% return ejs_data; }); %> - <h1>Search for pads that <em>don't</em> have the tag</h1> - <% for (i = 0; i < newTags.length; i++) { %> - <a href="/ep/tag/?query=<%= tagsToQuery(tags,antiTags.concat([newTags[i].tagname])) %>" class="anti_padtag" title="<%= newTags[i].antimatches %> matches">!#<%= newTags[i].tagname %></a> - <% } %> - </div> +<% template.define('contentArea', function() { var ejs_data=''; %> + <div id="editorcontainer"> + <div class="query-refiner"> + <%: template.use('queryRefiner', function() { var ejs_data=''; %> + <h1>Search for pads that have the tag</h1> + <% for (i = 0; i < newTags.length; i++) { %> + <a href="<%= helpers.updateToUrl({query:tagQuery.tagsToQuery(tags.concat([newTags[i].tagname]),antiTags)}) %>" class="padtag" title="<%= newTags[i].matches %> matches">#<%= newTags[i].tagname %></a> + <% } %> - <dl> - <% for (i = 0; i < matchingPads.length; i++) { %> - <% - var matchingPadId = matchingPads[i].ID; - var matchingPadUrl = matchingPadId; - if (!inArray('writable', matchingPads[i].TAGS)) { - matchingPadId = padIdToReadonly(matchingPads[i].ID); - matchingPadUrl = 'ep/pad/view/' + matchingPadId + '/latest'; - } - %> - <dt><a href="/<%= matchingPadUrl %>"><%= matchingPadId %></a><dt> - <dd> - <% for (j = 0; j < matchingPads[i].TAGS.length; j++) { %> - <a href="/ep/tag/?query=<%= tagsToQuery(tags.concat([matchingPads[i].TAGS[j]]), antiTags) %>" class="padtag" title="<%= matchingPads[i].TAGS[j] %> matches">#<%= matchingPads[i].TAGS[j] %></a> - <% } %> - </dd> - <% } %> - </dl> - </div> - </div> - </div><!-- /padeditor --> + <h1>Search for pads that <em>don't</em> have the tag</h1> + <% for (i = 0; i < newTags.length; i++) { %> + <a href="<%= helpers.updateToUrl({query:tagQuery.tagsToQuery(tags,antiTags.concat([newTags[i].tagname]))}) %>" class="anti_padtag" title="<%= newTags[i].antimatches %> matches">!#<%= newTags[i].tagname %></a> + <% } %> + <% return ejs_data; }); %> + </div> - <div id="bottomarea"> - <div id="widthprefcheck" class="widthprefunchecked"><!-- --></div> - <div id="sidebarcheck" class="sidebarchecked"><!-- --></div> + <dl> + <%: template.use('queryResult', function() { var ejs_data=''; %> + <% for (i = 0; i < matchingPads.length; i++) { %> + <% + var matchingPadId = matchingPads[i].ID; + var matchingPadUrl = matchingPadId; + if (!inArray('writable', matchingPads[i].TAGS)) { + matchingPadId = padIdToReadonly(matchingPads[i].ID); + matchingPadUrl = 'ep/pad/view/' + matchingPadId + '/latest'; + } + %> + <dt><a href="/<%= matchingPadUrl %>"><%= matchingPadId %></a><dt> + <dd> + <% for (j = 0; j < matchingPads[i].TAGS.length; j++) { %> + <a href="<%= helpers.updateToUrl({query:tagQuery.tagsToQuery(tags.concat([matchingPads[i].TAGS[j]]), antiTags)}) %>" class="padtag" title="<%= matchingPads[i].TAGS[j] %> matches">#<%= matchingPads[i].TAGS[j] %></a> + <% } %> + </dd> + <% } %> + <% return ejs_data; }); %> + </dl> </div> - </div> -</div> +<% return ejs_data; }); %> |