Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
Owen Leonard 3c0883fac7 Fix for Bug 6884, Improve TinyMCE configuration on Koha News page
- Increases the width of the editor to fill the space provided
- Adjusts the layout of the toolbars to better fit the space
- Adds a custom editor stylesheet to make the contents of the
  editor better match the expected output

In changing the toolbar configuration I chose to make the display
of each button explicit rather than assuming a default set of
buttons and adding or subtracting from that. I think this is
clearer for someone approaching the configuration trying to under-
stand how buttons are displayed. I also chose to use the
shorthand "|" instead of "separator" for brevity. This last change
is the only one made to the edithelp configuration.

[2011.09.20] F. Demians. This patch is compatible with bug 6649 patch,
fixing help pages editing, and so could be applied before or after it.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-24 19:45:47 +12:00

214 lines
9.5 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; News</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript">//<![CDATA[
$(document).ready(function() {
$("#newst").tablesorter({[% IF ( dateformat == 'metric' ) %]
dateFormat: 'uk',[% END %]
sortList: [[2,0]],
headers: { 0: {sorter:false},6: { sorter: false },7: { sorter: false }}
});
});
//]]>
</script>
<script language="javascript" type="text/javascript" src="[% themelang %]/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
content_css : "[% themelang %]/css/tinymce.css",
plugins : "table,save,advhr,advlink,iespell,searchreplace,print,contextmenu",
theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
theme_advanced_resizing : true,
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
apply_source_formatting : true,
height : "300",
width : "700"
});
</script>
</head>
<body>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% IF ( add_form ) %]<a href="/cgi-bin/koha/tools/koha-news.pl">News</a> &rsaquo; [% IF ( id ) %]
Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div>
[% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% UNLESS ( add_form ) %]
<div id="toolbar">
<script type="text/javascript">
//<![CDATA[
// prepare DOM for YUI Toolbar
$(document).ready(function() {
yuiToolbar();
});
// YUI Toolbar Functions
function yuiToolbar() {
new YAHOO.widget.Button("newentry");
}
//]]>
</script>
<ul class="toolbar">
<li><a id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form">New Entry</a></li>
</ul></div>
[% END %]
[% IF ( add_form ) %]
<form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
<input type="hidden" name="op" value="[% op %]" />
<input type="hidden" name="id" value="[% id %]" />
<fieldset class="rows">
<legend>OPAC and Koha News</legend>
<ol> <li>
<label for="lang">Display Location</label>
<select id="lang" name="lang">
<option value="koha">Librarian interface</option>
[% IF ( slip ) %]<option value="slip" selected="selected">Slip</option>[% ELSE %]<option value="slip">Slip</option>[% END %]
[% FOREACH lang_lis IN lang_list %]
[% IF ( lang_lis.selected ) %]<option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>[% ELSE %]<option value="[% lang_lis.language %]">OPAC ([% lang_lis.language %])</option>[% END %]
[% END %]
</select>
</li>
<li>
<label for="title">Title</label>
<input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" />
</li>
<li>
<label for="timestamp">Publication date</label>
<input id="timestamp" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" />
<img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="timestampButton" style="cursor: pointer;" />
<script type="text/javascript">
Calendar.setup(
{
button : "timestampButton",
inputField : "timestamp",
ifFormat : "[% DHTMLcalendar_dateformat %]"
}
);
</script>
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>
<label for="expirationdate">Expiration date</label>
<input id="expirationdate" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" />
<img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openCalendar" style="cursor: pointer;" />
<script type="text/javascript">
Calendar.setup(
{
button : "openCalendar",
inputField : "expirationdate",
ifFormat : "[% DHTMLcalendar_dateformat %]"
}
);
</script>
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>
<label for="number">Appear in position </label>
[% IF ( new_detail.number ) %]
<input id="number" size="3" name="number" type="text" checked="checked" value="[% new_detail.number %]" />
[% ELSE %]
<input id="number" size="3" name="number" type="text" />
[% END %]
</li>
<li><label for="new">News</label>
<textarea name="new" id="new" cols="75" rows="10">[% new_detail.new %]</textarea></li>
</ol>
</fieldset>
<fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
</form>
[% ELSE %]
<div style="margin-bottom:5px;">
<form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
<label for="lang">Display Location:</label>
<select name="lang" id="lang">
<option value="">All</option>
<option value="koha">Librarian interface</option>
<option value="slip">Slip</option>
[% FOREACH lang_lis IN lang_list %]
[% IF ( lang_lis.selected ) %]
<option value="[% lang_lis.language %]" selected="selected">
[% ELSE %]
<option value="[% lang_lis.language %]">
[% END %]
OPAC ([% lang_lis.language %])
</option>
[% END %]
</select>
<input type="submit" class="button" value="Filter" />
</form>
</div>
[% IF ( opac_news_count ) %]
<form name="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" onsubmit="return confirm('Are you sure you want to delete the selected news?')">
<table id="newst">
<thead> <tr>
<th>&nbsp;</th>
<th>Location</th>
<th>Number</th>
<th>Creation&nbsp;Date</th>
<th>Expiration&nbsp;Date</th>
<th>Title</th>
<th>News</th>
<th>&nbsp;</th>
</tr></thead>
<tbody>[% FOREACH opac_new IN opac_news %]
[% IF ( opac_new.expired ) %]
<tr class="expired">
[% ELSE %]
<tr>
[% END %]
<td>
<input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
</td>
<td>[% IF ( opac_new.lang == 'koha' ) %]
Librarian interface
[% ELSE %]
[% IF ( opac_new.lang == 'slip' ) %]
Slip
[% ELSE %]
OPAC
[% END %]
[% END %]
</td>
<td>[% opac_new.number %]</td>
<td>[% opac_new.newdate %]</td>
<td>[% opac_new.expirationdate %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</td>
<td>[% opac_new.title %]</td>
<td>
[% opac_new.new %]
</td>
<td><a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew %]">Edit</a></td>
</tr>
[% END %]</tbody>
</table>
<input type="hidden" name="op" value="del" />
<fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
</form>
[% ELSE %]
<p>No news loaded</p>
[% END %]
[% END %]
</div>
</div>
[% UNLESS ( add_form ) %]
<div class="yui-b noprint">
[% INCLUDE 'tools-menu.inc' %]
</div>
[% END %]
</div>
[% INCLUDE 'intranet-bottom.inc' %]