Skip to content
Snippets Groups Projects
Commit 4bef6a39 authored by srosse's avatar srosse
Browse files

OO-1068: small fix, dialog of tinymce, color picker of calendar, drag and drop in calendar

parent ad172bfd
No related branches found
No related tags found
No related merge requests found
Showing
with 131 additions and 109 deletions
<div id="o_cal_colorchooser">
<div class="o_cal_green">$r.render("greenLink")</div>
<div class="o_cal_blue">$r.render("blueLink")</div>
<div class="o_cal_orange">$r.render("orangeLink")</div>
<div class="o_cal_yellow">$r.render("yellowLink")</div>
<div class="o_cal_red">$r.render("redLink")</div>
<div class="o_cal_grey">$r.render("greyLink")</div>
</div>
......@@ -11,7 +11,6 @@
#end
$r.render("eventForm")
#if (!$isNewEvent && !$isReadOnly)
<br/><br/>
$r.render("cal.edit.delete")
#end
</fieldset>
\ No newline at end of file
......@@ -25,91 +25,51 @@
package org.olat.commons.calendar.ui;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.olat.commons.calendar.CalendarManager;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.components.link.LinkFactory;
import org.olat.core.gui.components.velocity.VelocityContainer;
import org.olat.core.gui.control.DefaultController;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.translator.Translator;
import org.olat.core.util.Util;
import org.olat.core.gui.control.controller.BasicController;
public class CalendarColorChooserController extends DefaultController {
private static final String SELECTED_COLOR_CSS = "o_cal_colorchooser_selected";
private static final String VELOCITY_ROOT = Util.getPackageVelocityRoot(CalendarManager.class);
public class CalendarColorChooserController extends BasicController {
private Translator translator;
private VelocityContainer colorVC;
private String choosenColor;
private Map<Link, String> colorLinks;
private Link cancelButton;
public CalendarColorChooserController(Locale locale, WindowControl wControl, String currentCssSelection) {
super(wControl);
translator = Util.createPackageTranslator(CalendarManager.class, locale);
colorVC = new VelocityContainer("calEdit", VELOCITY_ROOT + "/calColor.html", translator, this);
cancelButton = LinkFactory.createButton("cancel", colorVC, this);
private static final String[] colors = new String[]{
"o_cal_green", "o_cal_blue", "o_cal_orange",
"o_cal_yellow", "o_cal_red", "o_cal_rebeccapurple", "o_cal_grey"
};
public CalendarColorChooserController(UserRequest ureq, WindowControl wControl, String currentCssSelection) {
super(ureq, wControl);
colorVC = createVelocityContainer("calEdit", "calColor");
colorLinks = new HashMap<Link, String>();
Link greenLink = LinkFactory.createCustomLink("greenLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
if (currentCssSelection.equals("o_cal_green")){
greenLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
greenLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
}
Link blueLink = LinkFactory.createCustomLink("blueLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
if (currentCssSelection.equals("o_cal_blue")){
blueLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
blueLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
}
Link orangeLink = LinkFactory.createCustomLink("orangeLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
if (currentCssSelection.equals("o_cal_orange")){
orangeLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
orangeLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
}
Link yellowLink = LinkFactory.createCustomLink("yellowLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
if (currentCssSelection.equals("o_cal_yellow")){
yellowLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
yellowLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
for(String color:colors) {
addColor(color, currentCssSelection);
}
Link redLink = LinkFactory.createCustomLink("redLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
if (currentCssSelection.equals("o_cal_red")){
redLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
redLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
}
Link greyLink = LinkFactory.createCustomLink("greyLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
if (currentCssSelection.equals("o_cal_grey")){
greyLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
greyLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
putInitialPanel(colorVC);
}
private void addColor(String css, String currentCssSelection) {
Link colorLink = LinkFactory.createCustomLink(css, "selc", "", Link.NONTRANSLATED, colorVC, this);
if (currentCssSelection.equals(css)){
colorLink.setIconLeftCSS("o_icon o_cal_colorchooser_selected");
} else {
colorLink.setIconLeftCSS("o_icon");
}
colorLinks.put(greenLink, "o_cal_green");
colorLinks.put(blueLink, "o_cal_blue");
colorLinks.put(orangeLink,"o_cal_orange");
colorLinks.put(yellowLink,"o_cal_yellow");
colorLinks.put(redLink,"o_cal_red");
colorLinks.put(greyLink,"o_cal_grey");
setInitialComponent(colorVC);
colorLink.setUserObject(css);
}
@Override
public void event(UserRequest ureq, Component source, Event event) {
if (source == cancelButton) {
fireEvent(ureq, Event.CANCELLED_EVENT);
} else if (colorLinks.containsKey(source)){
choosenColor = colorLinks.get(source);
if (source instanceof Link){
Link colorLink = (Link) source;
colorLink.setCustomEnabledLinkCSS(choosenColor);
colorLink.setCustomDisabledLinkCSS(choosenColor);
choosenColor = (String)colorLink.getUserObject();
fireEvent(ureq, Event.DONE_EVENT);
}
}
......@@ -121,5 +81,4 @@ public class CalendarColorChooserController extends DefaultController {
protected void doDispose() {
// nothing to dispose
}
}
}
\ No newline at end of file
......@@ -109,7 +109,7 @@ public class ImportedCalendarConfigurationController extends BasicController {
String calendarID = ureq.getParameter(PARAM_ID);
lastCalendarWrapper = findKalendarRenderWrapper(calendarID);
removeAsListenerAndDispose(colorChooser);
colorChooser = new CalendarColorChooserController(getLocale(), getWindowControl(), lastCalendarWrapper.getKalendarConfig().getCss());
colorChooser = new CalendarColorChooserController(ureq, getWindowControl(), lastCalendarWrapper.getKalendarConfig().getCss());
listenTo(colorChooser);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), colorChooser.getInitialComponent());
......
......@@ -128,7 +128,7 @@ public class KalendarConfigurationController extends BasicController {
String calendarID = ureq.getParameter(PARAM_ID);
lastCalendarWrapper = findKalendarRenderWrapper(calendarID);
removeAsListenerAndDispose(colorChooser);
colorChooser = new CalendarColorChooserController(getLocale(), getWindowControl(), lastCalendarWrapper.getKalendarConfig().getCss());
colorChooser = new CalendarColorChooserController(ureq, getWindowControl(), lastCalendarWrapper.getKalendarConfig().getCss());
listenTo(colorChooser);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), colorChooser.getInitialComponent(), false, translate("cal.color.title"));
......
......@@ -83,15 +83,13 @@ public class KalendarEntryDetailsController extends BasicController {
this.availableCalendars = availableCalendars;
this.kalendarEvent = kalendarEvent;
this.isNew = isNew;
//setTranslator(new PackageTranslator(CalendarManager.class.getPackage().getName(), getLocale()));
//mainVC = new VelocityContainer("calEditMain", VELOCITY_ROOT + "/calEditMain.html", getTranslator(), this);
mainVC = createVelocityContainer ("calEditMain");
mainVC.contextPut("caller", caller);
pane = new TabbedPane("pane", getLocale());
pane.addListener(this);
mainVC.put("pane", pane);
//eventVC = new VelocityContainer("calEditDetails", VELOCITY_ROOT + "/calEditDetails.html", getTranslator(), this);
eventVC = createVelocityContainer("calEditDetails");
deleteButton = LinkFactory.createButton("cal.edit.delete", eventVC, this);
eventVC.contextPut("caller", caller);
......
......@@ -47,6 +47,7 @@ import org.olat.core.gui.components.form.flexible.elements.TextElement;
import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
import org.olat.core.gui.components.form.flexible.impl.FormEvent;
import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer;
import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
......@@ -364,7 +365,7 @@ public class KalendarEntryForm extends FormBasicController {
formLayout.add(buttonLayout);
uifactory.addFormSubmitButton(SUBMIT_SINGLE, "cal.form.submitSingle", buttonLayout);
if (writeableCalendars.size() > 1) {
multi = uifactory.addFormLink("cal.form.submitMulti", buttonLayout, "b_button");
multi = uifactory.addFormLink("cal.form.submitMulti", buttonLayout, Link.BUTTON);
}
uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
......
<div id="o_cal_colorchooser">
<div class="o_cal_green">$r.render("o_cal_green")</div>
<div class="o_cal_blue">$r.render("o_cal_blue")</div>
<div class="o_cal_orange">$r.render("o_cal_orange")</div>
<div class="o_cal_yellow">$r.render("o_cal_yellow")</div>
<div class="o_cal_red">$r.render("o_cal_red")</div>
<div class="o_cal_rebeccapurple">$r.render("o_cal_rebeccapurple")</div>
<div class="o_cal_grey">$r.render("o_cal_grey")</div>
</div>
......@@ -99,6 +99,7 @@ public class FullCalendarComponent extends AbstractComponent {
/**
* @see org.olat.core.gui.components.Component#doDispatchRequest(org.olat.core.gui.UserRequest)
*/
@Override
protected void doDispatchRequest(UserRequest ureq) {
//
}
......@@ -106,6 +107,7 @@ public class FullCalendarComponent extends AbstractComponent {
/**
* @see org.olat.core.gui.components.Component#getHTMLRendererSingleton()
*/
@Override
public ComponentRenderer getHTMLRendererSingleton() {
return RENDERER;
}
......@@ -113,9 +115,11 @@ public class FullCalendarComponent extends AbstractComponent {
/**
* @see org.olat.core.gui.components.Component#validate(org.olat.core.gui.UserRequest, org.olat.core.gui.render.ValidationResult)
*/
@Override
public void validate(UserRequest ureq, ValidationResult vr) {
super.validate(ureq, vr);
vr.getJsAndCSSAdder().addRequiredStaticJsFile("js/jquery/fullcalendar/fullcalendar.min.js");
vr.getJsAndCSSAdder().addRequiredStaticJsFile("js/jquery/ui/jquery-ui-1.10.4.custom.dnd.min.js");
}
/**
......
<div class="b_toolboxes">
<div class="o_toolboxes">
#set($entriesSize = $entries.size())
#foreach ($entry in $entries)
......@@ -9,33 +9,33 @@
#end
## wrapper div
<div class="b_toolbox">
<div class="o_toolbox">
## head
<div class="b_toolbox_head_wrapper">
<div class="b_toolbox_head">
<div class="b_toolbox_head_icon $!entry.getCssClass()"><strong>$entry.getHeaderText()</strong></div>
<div class="o_toolbox_head_wrapper">
<div class="o_toolbox_head">
<div class="o_toolbox_head_icon $!entry.getCssClass()"><strong>$entry.getHeaderText()</strong></div>
</div>
</div>
## body
<div class="b_toolbox_content">
<div class="o_toolbox_content">
<ul>
#elseif ($entry.getType() == 2)
#if ($entry.isEnabled())
<li class="clearfix"><a href="$r.commandURIbg("$entry.getAction()")" $r.bgTarget() onclick="return o2cl()" class="$entry.getCssClass()">$entry.getLinkText()</a></li>
<li><a href="$r.commandURIbg("$entry.getAction()")" $r.bgTarget() onclick="return o2cl()" class="$entry.getCssClass()">$entry.getLinkText()</a></li>
#else
<li class="clearfix"><span class="b_toolbox_disabled">$entry.getLinkText()</span></li>
<li><span class="o_toolbox_disabled">$entry.getLinkText()</span></li>
#end
#elseif ($entry.getType() == 3)
#if ($entry.isEnabled())
<li class="clearfix"><a id="$r.getCId()_$velocityCount" href="javascript:void(o_openPopUp('$r.commandURI("$entry.getAction()")', '$entry.getAction()', '$entry.getWidth()', '$entry.getHeight()', $entry.isBrowserMenuEnabled()))" onclick="return o2cl()" class="$entry.getCssClass()">$entry.getLinkText()</a></li>
<li><a id="$r.getCId()_$velocityCount" href="javascript:void(o_openPopUp('$r.commandURI("$entry.getAction()")', '$entry.getAction()', '$entry.getWidth()', '$entry.getHeight()', $entry.isBrowserMenuEnabled()))" onclick="return o2cl()" class="$entry.getCssClass()">$entry.getLinkText()</a></li>
<script>// <![CDATA[
jQuery('#$r.getCId()_$velocityCount').each(function(index, el){ jQuery(el).click(function() { setTimeout(removeBusyAfterDownload, 1200)}) });
// ]]></script>
#else
<li class="clearfix"><span class="b_toolbox_disabled">$entry.getLinkText()</span></li>
<li><span class="o_toolbox_disabled">$entry.getLinkText()</span></li>
#end
#elseif ($entry.getType() == 4)
<li class="clearfix">$r.render("$entry.getComponentName()")</li>
<li>$r.render("$entry.getComponentName()")</li>
#end
#end
......
......@@ -103,6 +103,6 @@ public class CourseCalendarConfigForm extends FormBasicController {
CoordinatorManager.getInstance().getCoordinator().getEventBus()
.fireEventToListenersOf(new KalendarModifiedEvent(), OresHelper.lookupType(CalendarManager.class));
fireEvent (ureq, Event.DONE_EVENT);
fireEvent(ureq, Event.CHANGED_EVENT);
}
}
\ No newline at end of file
......@@ -695,7 +695,7 @@ public class IQRunController extends BasicController implements GenericEventList
if("test".equals(ce.getOLATResourceable().getResourceableTypeName())) {
Long resourceId = ce.getOLATResourceable().getResourceableId();
if(resourceId != null && resourceId.longValue() >= 0) {
event(ureq, startButton, Event.CHANGED_EVENT);
//event(ureq, startButton, Event.CHANGED_EVENT);
}
}
}
......
......@@ -78,10 +78,6 @@ public class AuthoringEntryPublishController extends FormBasicController {
private static final String MEMBERSONLY_KEY = "m";
private String[] publishedKeys;
private static final String OPENED_KEY = "o";
private static final String CLOSED_KEY = "c";
private static final String[] statusKeys = new String[]{OPENED_KEY, CLOSED_KEY};
/**
* The details form is initialized with data collected from entry and
......
......@@ -13,11 +13,15 @@
.o_cal_yellow { background: #ffe066; border-color: #ffcc00; color: #5D5D5D; }
.o_cal_yellow .o_cal_wv_event_header {background: #ffcc00;}
.o_cal_yellow a { color: #5D5D5D! important; }
.o_cal_yellow a { color: #5D5D5D! important; }
.o_cal_red { background: #c26666; border-color: #990000; color: #FFF; }
.o_cal_red .o_cal_wv_event_header {background: #990000;}
.o_cal_red a { color: #FFF ! important; }
.o_cal_red a { color: #FFF ! important; }
.o_cal_rebeccapurple { background: #663399; border-color: #663399; color: #FFF; }
.o_cal_rebeccapurple .o_cal_wv_event_header {background: #663399;}
.o_cal_rebeccapurple a { color: #FFF ! important; }
.o_cal_grey { background: #DDDAAA; border-color: #5D5D5D; color: #FFF; }
.o_cal_grey .o_cal_wv_event_header {background: #5D5D5D;}
......@@ -32,6 +36,30 @@
margin: 0 5px;
padding: 1px 6px 1px 4px;
position: relative;
width: 200px; overflow: hidden;
float: left; display: inline;
width: 200px;
overflow: hidden;
float: left;
display: inline;
}
.o_cal_colorchooser_selected:before {
content: $fa-var-check;
}
#o_cal_colorchooser {
div {
border: 1px solid $brand-primary;
margin: 5px;
display: inline-block;
}
div:hover {
border: 1px solid #333;
}
a {
width: 20px;
height: 20px;
display: inline-block;
}
}
......@@ -17,13 +17,31 @@
font-weight: bold;
}
.ui-icon, .ui-widget-content .ui-icon, .ui-widget-header .ui-icon,
.ui-state-default .ui-icon, .ui-state-hover .ui-icon, .ui-state-focus .ui-icon,
.ui-state-active .ui-icon, .ui-state-highlight .ui-icon, .ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background: none;
background-image: none;
}
.ui-dialog {
@include box-shadow(0px 1px 5px -1px rgba(0,0,0,.25));
background-color: $o-dialog-window-bg;
.ui-widget-header {
.ui-icon-closethick:before {
content: $fa-var-times;
.ui-dialog-titlebar-close:before {
content: $fa-var-times !important;
}
.ui-dialog-titlebar-close {
display: inline-block;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
font-size: 120%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.ui-button.ui-corner-all {
......@@ -114,3 +132,14 @@
.ui-datepicker.ui-widget-content {
border: 1px solid transparent;
}
// override the label in _forms.scss of bootstrap
label.mce-label {
display: inline;
max-width: 150px;
margin-bottom: 0;
font-weight: normal;
}
......@@ -338,6 +338,14 @@ a.o_chelp {
}
}
/* the old toolbox */
.o_toolboxes {
ul {
margin: 0 0 1.5em 0;
padding: 0 0 0 1.5em;
}
}
/* QR-Code container */
.o_qrcode {
width: 256px;
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment