summaryrefslogtreecommitdiffstats
path: root/modules-available/news
diff options
context:
space:
mode:
authorSimon Rettberg2016-09-07 17:23:30 +0200
committerSimon Rettberg2016-09-07 17:23:30 +0200
commitc86f4161abc11d048d75d12442850849c55709b2 (patch)
tree27c93bcc920c94ddeb08b004809f998b55dfc47c /modules-available/news
parentMerge branch 'modularization' of dnbd3:openslx-ng/slx-admin into modularization (diff)
downloadslx-admin-c86f4161abc11d048d75d12442850849c55709b2.tar.gz
slx-admin-c86f4161abc11d048d75d12442850849c55709b2.tar.xz
slx-admin-c86f4161abc11d048d75d12442850849c55709b2.zip
[news] Switch to new ellipsis hack; fix saving when summernote is in source code view
Diffstat (limited to 'modules-available/news')
-rw-r--r--modules-available/news/page.inc.php2
-rw-r--r--modules-available/news/templates/page-news.html30
2 files changed, 22 insertions, 10 deletions
diff --git a/modules-available/news/page.inc.php b/modules-available/news/page.inc.php
index 50e07458..ee377dc4 100644
--- a/modules-available/news/page.inc.php
+++ b/modules-available/news/page.inc.php
@@ -109,6 +109,7 @@ class Page_News extends Page
if ($row['newsid'] == $this->newsId) {
$row['active'] = 'active';
}
+ $row['content'] = strip_tags(str_replace('>', '> ', $row['content']));
$lines[] = $row;
}
// fetch the list of the older helps
@@ -120,6 +121,7 @@ class Page_News extends Page
if ($row['newsid'] == $this->newsId) {
$row['active'] = 'active';
}
+ $row['content'] = strip_tags(str_replace('>', '> ', $row['content']));
$linesHelp[] = $row;
}
diff --git a/modules-available/news/templates/page-news.html b/modules-available/news/templates/page-news.html
index 7750137e..192635ea 100644
--- a/modules-available/news/templates/page-news.html
+++ b/modules-available/news/templates/page-news.html
@@ -18,7 +18,7 @@
<textarea name="news-content" id ="news-content-id" class="form-control summernote" rows="5" cols="30" placeholder="">{{latestContent}}</textarea>
</div>
<p>{{lang_latestUpdate}}: {{latestDate}}</p>
- <button class="btn btn-primary btn-sm" name="news-type" value="news" type="submit">{{lang_save}}</button>
+ <button class="btn btn-primary btn-sm sn-btn" name="news-type" value="news" type="submit">{{lang_save}}</button>
<input type="hidden" name="token" value="{{token}}">
</form>
<br/>
@@ -41,10 +41,10 @@
<tbody>
{{#list}}
<tr {{#active}}class="active"{{/active}}>
- <td class="text-left nowrap">{{date}}</td>
- <td class="slx-ellipsis">{{title}}</td>
- <td class="slx-ellipsis">{{content}}</td>
- <td>
+ <td class="text-left text-nowrap">{{date}}</td>
+ <td><table class="slx-ellipsis"><tr><td>{{title}}</td></tr></table></td>
+ <td><table class="slx-ellipsis"><tr><td>{{content}}</td></tr></table></td>
+ <td class="text-nowrap">
<a class="btn btn-primary btn-xs" href="?do=news&amp;newsid={{newsid}}&amp;action=show"><span class="glyphicon glyphicon-share-alt"></span> {{lang_show}}</a>
<button class="btn btn-danger btn-xs" type="submit" name="newsid" value="{{newsid}}"><span class="glyphicon glyphicon-remove"></span> {{lang_delete}}</button>
</td>
@@ -62,9 +62,9 @@
<form action="?do=News&amp;action=save" method="post">
<div class="form-group">
<label for="news-content-id">{{lang_content}}</label>
- <textarea name="help-content" id ="help-content-id" class="form-control summernote" style="min-height:400px" placeholder="">{{latestHelp}}</textarea>
+ <textarea name="help-content" id="help-content-id" class="form-control summernote" style="min-height:400px" placeholder="">{{latestHelp}}</textarea>
</div>
- <button class="btn btn-primary btn-sm" name="news-type" value="help" type="submit">{{lang_save}}</button>
+ <button class="btn btn-primary btn-sm sn-btn" name="news-type" value="help" type="submit">{{lang_save}}</button>
<input type="hidden" name="token" value="{{token}}">
</form>
<div class="panel panel-default">
@@ -85,9 +85,9 @@
<tbody>
{{#listHelp}}
<tr {{#active}}class="active"{{/active}}>
- <td class="text-left nowrap">{{date}}</td>
- <td class="slx-ellipsis">{{content}}</td>
- <td>
+ <td class="text-left text-nowrap">{{date}}</td>
+ <td><table class="slx-ellipsis"><tr><td>{{content}}</td></tr></table></td>
+ <td class="text-nowrap">
<a class="btn btn-primary btn-xs" href="?do=news&amp;newsid={{newsid}}&amp;action=show"><span class="glyphicon glyphicon-share-alt"></span> {{lang_show}}</a>
<button class="btn btn-danger btn-xs" type="submit" name="newsid" value="{{newsid}}"><span class="glyphicon glyphicon-remove"></span> {{lang_delete}}</button>
</td>
@@ -102,3 +102,13 @@
</div>
</div>
</div>
+<script type="application/javascript"><!--
+document.addEventListener("DOMContentLoaded", function () {
+ $('.sn-btn').click(function (event) {
+ var $button = $('.note-btn.btn-codeview');
+ if ($button.hasClass('active')) {
+ $button.click();
+ }
+ });
+}, false);
+// --></script> \ No newline at end of file