Skip to content
Snippets Groups Projects
Commit 74fd26da authored by gnaegi's avatar gnaegi
Browse files

OO-1068 usability: tell what bookmark icon is good for

parent acada077
No related branches found
No related tags found
No related merge requests found
Showing
with 43 additions and 8 deletions
...@@ -52,7 +52,13 @@ public interface FormLink extends FormItem { ...@@ -52,7 +52,13 @@ public interface FormLink extends FormItem {
* @param iconCSS * @param iconCSS
*/ */
public void setIconRightCSS(String iconCSS); public void setIconRightCSS(String iconCSS);
/**
* Set the title used as hover text on link
* @param linkTitle
*/
public void setTitle(String linkTitle);
public void setDomReplacementWrapperRequired(boolean required); public void setDomReplacementWrapperRequired(boolean required);
......
...@@ -66,6 +66,7 @@ public class FormLinkImpl extends FormItemImpl implements FormLink { ...@@ -66,6 +66,7 @@ public class FormLinkImpl extends FormItemImpl implements FormLink {
private String iconRightCSS; private String iconRightCSS;
private String customEnabledLinkCSS; private String customEnabledLinkCSS;
private String customDisabledLinkCSS; private String customDisabledLinkCSS;
private String title;
/** /**
* creates a form link with the given name which acts also as command, i18n * creates a form link with the given name which acts also as command, i18n
...@@ -151,6 +152,7 @@ public class FormLinkImpl extends FormItemImpl implements FormLink { ...@@ -151,6 +152,7 @@ public class FormLinkImpl extends FormItemImpl implements FormLink {
component.setTranslator(getTranslator()); component.setTranslator(getTranslator());
component.setIconLeftCSS(iconLeftCSS); component.setIconLeftCSS(iconLeftCSS);
component.setIconRightCSS(iconRightCSS); component.setIconRightCSS(iconRightCSS);
component.setTitle(title);
component.setDomReplacementWrapperRequired(domReplacementWrapperRequired); component.setDomReplacementWrapperRequired(domReplacementWrapperRequired);
} }
...@@ -206,6 +208,14 @@ public class FormLinkImpl extends FormItemImpl implements FormLink { ...@@ -206,6 +208,14 @@ public class FormLinkImpl extends FormItemImpl implements FormLink {
} }
} }
@Override
public void setTitle(String linkTitle) {
this.title = linkTitle;
if(component != null){
component.setTitle(linkTitle);
}
}
/** /**
* @see org.olat.core.gui.components.form.flexible.elements.FormLink#setCustomEnabledLinkCSS(java.lang.String) * @see org.olat.core.gui.components.form.flexible.elements.FormLink#setCustomEnabledLinkCSS(java.lang.String)
*/ */
......
...@@ -238,7 +238,8 @@ public class RunMainController extends MainLayoutBasicController implements Gene ...@@ -238,7 +238,8 @@ public class RunMainController extends MainLayoutBasicController implements Gene
public RunMainController(final UserRequest ureq, final WindowControl wControl, final ICourse course, public RunMainController(final UserRequest ureq, final WindowControl wControl, final ICourse course,
final RepositoryEntry re, final boolean offerBookmark, final boolean showCourseConfigLink) { final RepositoryEntry re, final boolean offerBookmark, final boolean showCourseConfigLink) {
super(ureq, wControl); // Use repository package as fallback translator
super(ureq, wControl, Util.createPackageTranslator(RepositoryEntry.class, ureq.getLocale()));
roles = ureq.getUserSession().getRoles(); roles = ureq.getUserSession().getRoles();
...@@ -1030,6 +1031,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene ...@@ -1030,6 +1031,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
css = Mark.MARK_CSS_ICON; css = Mark.MARK_CSS_ICON;
} }
bookmarkLink.setIconLeftCSS(css); bookmarkLink.setIconLeftCSS(css);
bookmarkLink.setTitle(translate(marked ? "details.bookmark.remove" : "details.bookmark"));
bookmarkLink.setDirty(true); bookmarkLink.setDirty(true);
} }
...@@ -1408,6 +1410,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene ...@@ -1408,6 +1410,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
boolean marked = markManager.isMarked(courseRepositoryEntry, getIdentity(), null); boolean marked = markManager.isMarked(courseRepositoryEntry, getIdentity(), null);
String css = marked ? Mark.MARK_CSS_ICON : Mark.MARK_ADD_CSS_ICON; String css = marked ? Mark.MARK_CSS_ICON : Mark.MARK_ADD_CSS_ICON;
bookmarkLink = LinkFactory.createToolLink("bookmark",translate("command.bookmark"), this, css); bookmarkLink = LinkFactory.createToolLink("bookmark",translate("command.bookmark"), this, css);
bookmarkLink.setTitle(translate(marked ? "details.bookmark.remove" : "details.bookmark"));
toolbarPanel.addTool(bookmarkLink, Align.right); toolbarPanel.addTool(bookmarkLink, Align.right);
} }
} }
......
...@@ -410,6 +410,7 @@ public class AuthorListController extends FormBasicController implements Activat ...@@ -410,6 +410,7 @@ public class AuthorListController extends FormBasicController implements Activat
AuthoringEntryRow row = (AuthoringEntryRow)link.getUserObject(); AuthoringEntryRow row = (AuthoringEntryRow)link.getUserObject();
boolean marked = doMark(row); boolean marked = doMark(row);
link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg"); link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg");
link.setTitle(translate(marked ? "details.bookmark.remove" : "details.bookmark"));
link.getComponent().setDirty(true); link.getComponent().setDirty(true);
row.setMarked(marked); row.setMarked(marked);
} }
...@@ -566,6 +567,7 @@ public class AuthorListController extends FormBasicController implements Activat ...@@ -566,6 +567,7 @@ public class AuthorListController extends FormBasicController implements Activat
public void forgeMarkLink(AuthoringEntryRow row) { public void forgeMarkLink(AuthoringEntryRow row) {
FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", "", null, null, Link.NONTRANSLATED); FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", "", null, null, Link.NONTRANSLATED);
markLink.setIconLeftCSS(row.isMarked() ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE); markLink.setIconLeftCSS(row.isMarked() ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
markLink.setTitle(translate(row.isMarked() ? "details.bookmark.remove" : "details.bookmark"));
markLink.setUserObject(row); markLink.setUserObject(row);
row.setMarkLink(markLink); row.setMarkLink(markLink);
} }
......
...@@ -291,7 +291,8 @@ public class AuthoringEntryDetailsController extends RepositoryEntryDetailsContr ...@@ -291,7 +291,8 @@ public class AuthoringEntryDetailsController extends RepositoryEntryDetailsContr
if (!isGuestOnly) { if (!isGuestOnly) {
boolean marked = markManager.isMarked(entry, getIdentity(), null); boolean marked = markManager.isMarked(entry, getIdentity(), null);
String css = "o_icon " + (marked ? Mark.MARK_CSS_ICON : Mark.MARK_ADD_CSS_ICON); String css = "o_icon " + (marked ? Mark.MARK_CSS_ICON : Mark.MARK_ADD_CSS_ICON);
bookmarkLink = LinkFactory.createToolLink("downloadcompat", translate("details.bookmark") , this); bookmarkLink = LinkFactory.createToolLink("downloadcompat", translate("details.bookmark.label") , this);
bookmarkLink.setTitle( translate(marked ? "details.bookmark.remove" : "details.bookmark"));
bookmarkLink.setEnabled(!corrupted); bookmarkLink.setEnabled(!corrupted);
bookmarkLink.setIconLeftCSS(css); bookmarkLink.setIconLeftCSS(css);
stackPanel.addTool(bookmarkLink, Align.right); stackPanel.addTool(bookmarkLink, Align.right);
...@@ -519,8 +520,11 @@ public class AuthoringEntryDetailsController extends RepositoryEntryDetailsContr ...@@ -519,8 +520,11 @@ public class AuthoringEntryDetailsController extends RepositoryEntryDetailsContr
doCatalog(ureq); doCatalog(ureq);
} }
} else if (bookmarkLink == source) { } else if (bookmarkLink == source) {
String css = "o_icon " + (doMark() ? Mark.MARK_CSS_ICON : Mark.MARK_ADD_CSS_ICON); boolean marked = doMark();
String css = "o_icon " + (marked ? Mark.MARK_CSS_ICON : Mark.MARK_ADD_CSS_ICON);
bookmarkLink.setIconLeftCSS(css); bookmarkLink.setIconLeftCSS(css);
bookmarkLink.setTitle( translate(marked ? "details.bookmark.remove" : "details.bookmark"));
} else if (membersLink == source) { } else if (membersLink == source) {
stackPanel.popUpToController(this); stackPanel.popUpToController(this);
doMembers(ureq); doMembers(ureq);
......
...@@ -254,6 +254,7 @@ public class RepositoryEntryListController extends FormBasicController ...@@ -254,6 +254,7 @@ public class RepositoryEntryListController extends FormBasicController
RepositoryEntryRow row = (RepositoryEntryRow)link.getUserObject(); RepositoryEntryRow row = (RepositoryEntryRow)link.getUserObject();
boolean marked = doMark(row); boolean marked = doMark(row);
link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg"); link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg");
link.setTitle(translate(marked ? "details.bookmark.remove" : "details.bookmark"));
link.getComponent().setDirty(true); link.getComponent().setDirty(true);
row.setMarked(marked); row.setMarked(marked);
} else if ("start".equals(cmd)){ } else if ("start".equals(cmd)){
...@@ -452,6 +453,7 @@ public class RepositoryEntryListController extends FormBasicController ...@@ -452,6 +453,7 @@ public class RepositoryEntryListController extends FormBasicController
if(!guestOnly) { if(!guestOnly) {
FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", "", null, null, Link.NONTRANSLATED); FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", "", null, null, Link.NONTRANSLATED);
markLink.setIconLeftCSS(row.isMarked() ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE); markLink.setIconLeftCSS(row.isMarked() ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
markLink.setTitle(translate(row.isMarked() ? "details.bookmark.remove" : "details.bookmark"));
markLink.setUserObject(row); markLink.setUserObject(row);
row.setMarkLink(markLink); row.setMarkLink(markLink);
} }
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
<i class='o_icon $ac_type.type o_icon-lg'></i> <i class='o_icon $ac_type.type o_icon-lg'></i>
#end #end
#end #end
$r.render($row.getSelectLinkName())
#end #end
#if($row.isMember() || $row.getVisit() > 0) #if($row.isMember() || $row.getVisit() > 0)
......
...@@ -63,6 +63,7 @@ $o-content-border-img-padding : 3px !default; ...@@ -63,6 +63,7 @@ $o-content-border-img-padding : 3px !default;
$o-font-size-xsmall : ceil(($font-size-base * 1.7)) !default; // ~24px $o-font-size-xsmall : ceil(($font-size-base * 1.7)) !default; // ~24px
$o-font-size-xlage : ceil(($font-size-base * 0.71)) !default; // ~10px $o-font-size-xlage : ceil(($font-size-base * 0.71)) !default; // ~10px
$o-table-row-selected-color : $state-success-bg !default; $o-table-row-selected-color : $state-success-bg !default;
$o-table-header-color : $text-color !default;
/* The max width the header/navbar/main/footer can possibly have. */ /* The max width the header/navbar/main/footer can possibly have. */
......
...@@ -51,11 +51,19 @@ ...@@ -51,11 +51,19 @@
.table { .table {
margin-bottom: 0; margin-bottom: 0;
} }
th {
color: $o-table-header-color;
}
} }
a.o_orderby, a.o_orderby:hover { a.o_orderby, a.o_orderby:hover {
color: black; color: $o-table-header-color;
text-decoration: none; text-decoration: none;
&.o_orderby_asc, &.o_orderby_desc {
border-bottom: 1px solid $table-border-color;
}
} }
.o_table_row_count { .o_table_row_count {
......
This diff is collapsed.
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