diff --git a/modules/webcomment/lib/webcomment_templates.py b/modules/webcomment/lib/webcomment_templates.py index d804e057f..0d0120f5b 100644 --- a/modules/webcomment/lib/webcomment_templates.py +++ b/modules/webcomment/lib/webcomment_templates.py @@ -1,1399 +1,1423 @@ # -*- coding: utf-8 -*- ## $Id$ ## Comments and reviews for records. ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """HTML Templates for commenting features """ __revision__ = "$Id$" # non CDS Invenio imports import string # CDS Invenio imports from invenio.webuser import get_user_info from invenio.dateutils import convert_datetext_to_dategui from invenio.webmessage_mailutils import email_quoted_txt2html from invenio.config import weburl, \ sweburl, \ cdslang, \ cdsname, \ cdsnameintl,\ CFG_WEBCOMMENT_ALLOW_REVIEWS, \ CFG_WEBCOMMENT_ALLOW_COMMENTS from invenio.messages import gettext_set_language from invenio.textutils import indent_text class Template: """templating class, refer to webcomment.py for examples of call""" def tmpl_get_first_comments_without_ranking(self, recID, ln, comments, nb_comments_total, warnings): """ @param recID: record id @param ln: language @param comments: tuple as returned from webcomment.py/query_retrieve_comments_or_remarks @param nb_comments_total: total number of comments for this record @param warnings: list of warning tuples (warning_msg, arg1, arg2, ...) @return html of comments """ # load the right message language _ = gettext_set_language(ln) # naming data fields of comments c_nickname = 0 c_user_id = 1 c_date_creation = 2 c_body = 3 c_id = 4 warnings = self.tmpl_warnings(warnings, ln) # comments comment_rows = '' for comment in comments: if comment[c_nickname]: nickname = comment[c_nickname] display = nickname else: (uid, nickname, display) = get_user_info(comment[c_user_id]) messaging_link = self.create_messaging_link(nickname, display, ln) comment_rows += """ """ report_link = '%s/record/%s/comments/report?ln=%s&comid=%s' % (weburl, recID, ln, comment[c_id]) reply_link='%s/record/%s/comments/add?ln=%s&comid=%s&action=REPLY' % (weburl, recID, ln, comment[c_id]) comment_rows += self.tmpl_get_comment_without_ranking(ln=ln, nickname=messaging_link, date_creation=comment[c_date_creation], body=comment[c_body], report_link=report_link, reply_link=reply_link) comment_rows += """

""" # write button write_button_label = _("Write a comment") write_button_link = '%s/record/%s/comments/add' % (weburl, recID) write_button_form = '' % ln write_button_form = self.createhiddenform(action=write_button_link, method="get", text=write_button_form, button=write_button_label) # output if nb_comments_total > 0: out = warnings comments_label = len(comments) > 1 and _("Showing the latest %i comments:") % len(comments) \ or "" out += """
%(comment_title)s
%(comments_label)s
%(comment_rows)s
%(view_all_comments_link)s

%(write_button_form)s
""" % \ {'comment_title': _("Discuss this document"), 'comments_label': comments_label, 'nb_comments_total' : nb_comments_total, 'recID': recID, 'comment_rows': comment_rows, 'tab': ' '*4, 'weburl': weburl, 's': nb_comments_total>1 and 's' or "", 'view_all_comments_link': nb_comments_total>0 and '''View all %s comments''' \ % (weburl, recID, nb_comments_total) or "", 'write_button_form': write_button_form, 'nb_comments': len(comments) } else: out = """
%(discuss_label)s:
%(detailed_info)s
%(form)s
""" % {'form': write_button_form, 'discuss_label': _("Discuss this document"), 'detailed_info': _("Start a discussion about any aspect of this document.") } return out def tmpl_record_not_found(self, status='missing', recID="", ln=cdslang): """ Displays a page when bad or missing record ID was given. @param status: 'missing' : no recID was given 'inexistant': recID doesn't have an entry in the database 'nan' : recID is not a number 'invalid' : recID is an error code, i.e. in the interval [-99,-1] @param return: body of the page """ _ = gettext_set_language(ln) if status == 'inexistant': body = _("Sorry, the record %s does not seem to exist.") % (recID,) elif status in ('nan', 'invalid'): body = _("Sorry, %s is not a valid ID value.") % (recID,) else: body = _("Sorry, no record ID was provided.") body += "

" link = "%s." % (weburl, ln, cdsnameintl.get(ln, cdsname)) body += _("You may want to start browsing from %s") % link return body def tmpl_get_first_comments_with_ranking(self, recID, ln, comments=None, nb_comments_total=None, avg_score=None, warnings=[]): """ @param recID: record id @param ln: language @param comments: tuple as returned from webcomment.py/query_retrieve_comments_or_remarks @param nb_comments_total: total number of comments for this record @param avg_score: average score of all reviews @param warnings: list of warning tuples (warning_msg, arg1, arg2, ...) @return html of comments """ # load the right message language _ = gettext_set_language(ln) # naming data fields of comments c_nickname = 0 c_user_id = 1 c_date_creation = 2 c_body = 3 c_nb_votes_yes = 4 c_nb_votes_total = 5 c_star_score = 6 c_title = 7 c_id = 8 warnings = self.tmpl_warnings(warnings, ln) #stars if avg_score > 0: avg_score_img = 'stars-' + str(avg_score).split('.')[0] + '-' + str(avg_score).split('.')[1] + '.png' else: avg_score_img = "stars-0-0.png" # voting links useful_dict = { 'weburl' : weburl, 'recID' : recID, 'ln' : ln, 'yes_img' : 'smchk_gr.gif', #'yes.gif', 'no_img' : 'iconcross.gif' #'no.gif' } link = '' + _("Yes") + '' useful_no = link + '&com_value=-1">' + _("No") + '' #comment row comment_rows = ' ' for comment in comments: if comment[c_nickname]: nickname = comment[c_nickname] display = nickname else: (uid, nickname, display) = get_user_info(comment[c_user_id]) messaging_link = self.create_messaging_link(nickname, display, ln) comment_rows += ''' ''' report_link = '%s/record/%s/reviews/report?ln=%s&comid=%s' % (weburl, recID, ln, comment[c_id]) comment_rows += self.tmpl_get_comment_with_ranking(ln=ln, nickname=messaging_link, date_creation=comment[c_date_creation], body=comment[c_body], nb_votes_total=comment[c_nb_votes_total], nb_votes_yes=comment[c_nb_votes_yes], star_score=comment[c_star_score], title=comment[c_title], report_link=report_link) comment_rows += ''' %s %s / %s
''' % (_("Was this review helpful?"), useful_yes % {'comid':comment[c_id]}, useful_no % {'comid':comment[c_id]}) comment_rows += '''
''' # write button write_button_link = '''%s/record/%s/reviews/add''' % (weburl, recID) write_button_form = ' ' % ln write_button_form = self.createhiddenform(action=write_button_link, method="get", text=write_button_form, button=_("Write a review")) if nb_comments_total > 0: avg_score_img = str(avg_score_img) avg_score = str(avg_score) nb_comments_total = str(nb_comments_total) score = '' score += _("Average review score: %(x_nb_score)s based on %(x_nb_reviews)s reviews") %\ {'x_nb_score': '' + avg_score + '', 'x_nb_reviews': nb_comments_total} useful_label = _("Readers found the following %s reviews to be most helpful.") useful_label %= len(comments) > 1 and len(comments) or "" view_all_comments_link ='' % (weburl, recID, ln) view_all_comments_link += _("View all %s reviews") % nb_comments_total view_all_comments_link += '
' out = warnings + """
%(comment_title)s:
%(score_label)s
%(useful_label)s %(comment_rows)s
%(view_all_comments_link)s %(write_button_form)s
""" % \ { 'comment_title' : _("Rate this document"), 'score_label' : score, 'useful_label' : useful_label, 'recID' : recID, 'view_all_comments' : _("View all %s reviews") % (nb_comments_total,), 'write_comment' : _("Write a review"), 'comment_rows' : comment_rows, 'tab' : ' '*4, 'weburl' : weburl, 'view_all_comments_link': nb_comments_total>0 and view_all_comments_link or "", 'write_button_form' : write_button_form } else: out = '''
%s:
%s
%s
''' % (_("Rate this document"), _("Be the first to review this document."), write_button_form) return out def tmpl_get_comment_without_ranking(self, ln, nickname, date_creation, body, reply_link=None, report_link=None): """ private function @param ln: language @param nickname: nickname @param date_creation: date comment was written @param body: comment body @param reply_link: if want reply and report, give the http links @param repot_link: if want reply and report, give the http links @return html table of comment """ # load the right message language _ = gettext_set_language(ln) date_creation = convert_datetext_to_dategui(date_creation) out = '' final_body = email_quoted_txt2html(body) title = _('%(x_name)s wrote on %(x_date)s:') % {'x_name': nickname, 'x_date': '' + date_creation + ''} links = '' if reply_link: links += '' + _("Reply") +'' if report_link: links += ' | ' if report_link: links += '' + _("Report abuse") + '' out += """
%(title)s
%(body)s

%(links)s
""" % \ {'title' : '
 %s
' % (weburl, title), 'body' : final_body, 'links' : links} return out def tmpl_get_comment_with_ranking(self, ln, nickname, date_creation, body, nb_votes_total, nb_votes_yes, star_score, title, report_link=None): """ private function @param ln: language @param nickname: nickname @param date_creation: date comment was written @param body: comment body @param nb_votes_total: total number of votes for this review @param nb_votes_yes: number of positive votes for this record @param star_score: star score for this record @param title: title of review @return html table of review """ # load the right message language _ = gettext_set_language(ln) if star_score > 0: star_score_img = 'stars-' + str(star_score) + '-0.png' else: star_score_img = 'stars-0-0.png' out = "" date_creation = convert_datetext_to_dategui(date_creation) reviewed_label = _("Reviewed by %(x_nickname)s on %(x_date)s") % {'x_nickname': nickname, 'x_date':date_creation} useful_label = _("%(x_nb_people)i out of %(x_nb_total)i people found this review useful") % {'x_nb_people': nb_votes_yes, 'x_nb_total': nb_votes_total} links = '' if report_link: links += '' + _("Report abuse") + '' _body = '' if body != '': _body = '''
%s
''' % email_quoted_txt2html(body) - + out += '''
%(star_score)s%(title)s
%(reviewed_label)s
%(useful_label)s
%(body)s
%(abuse)s''' % {'weburl' : weburl, 'star_score_img': star_score_img, 'star_score' : star_score, 'title' : title, 'reviewed_label': reviewed_label, 'useful_label' : useful_label, 'body' : _body, 'abuse' : links } return out def tmpl_get_comments(self, recID, ln, nb_per_page, page, nb_pages, display_order, display_since, CFG_WEBCOMMENT_ALLOW_REVIEWS, comments, total_nb_comments, avg_score, warnings, border=0, reviews=0, total_nb_reviews=0, nickname='', uid=-1, note='',score=5): """ Get table of all comments @param recID: record id @param ln: language @param nb_per_page: number of results per page @param page: page number @param display_order: hh = highest helpful score, review only lh = lowest helpful score, review only hs = highest star score, review only ls = lowest star score, review only od = oldest date nd = newest date @param display_since: all= no filtering by date nd = n days ago nw = n weeks ago nm = n months ago ny = n years ago where n is a single digit integer between 0 and 9 @param CFG_WEBCOMMENT_ALLOW_REVIEWS: is ranking enable, get from config.py/CFG_WEBCOMMENT_ALLOW_REVIEWS @param comments: tuple as returned from webcomment.py/query_retrieve_comments_or_remarks @param total_nb_comments: total number of comments for this record @param avg_score: average score of reviews for this record @param warnings: list of warning tuples (warning_msg, color) @param border: boolean, active if want to show border around each comment/review @param reviews: booelan, enabled for reviews, disabled for comments """ # load the right message language _ = gettext_set_language(ln) # naming data fields of comments if reviews: c_nickname = 0 c_user_id = 1 c_date_creation = 2 c_body = 3 c_nb_votes_yes = 4 c_nb_votes_total = 5 c_star_score = 6 c_title = 7 c_id = 8 discussion = 'reviews' comments_link = '%s (%i)' % (weburl, recID, _('Comments'), total_nb_comments) reviews_link = '%s (%i)' % (_('Reviews'), total_nb_reviews) add_comment_or_review = self.tmpl_add_comment_form_with_ranking(recID, uid, nickname, ln, '', score ,note, warnings, show_title_p=True) else: c_nickname = 0 c_user_id = 1 c_date_creation = 2 c_body = 3 c_id = 4 discussion = 'comments' comments_link = '%s (%i)' % (_('Comments'), total_nb_comments) reviews_link = '%s (%i)' % (weburl, recID, _('Reviews'), total_nb_reviews) add_comment_or_review = self.tmpl_add_comment_form(recID, uid, nickname, ln, note, warnings) # voting links useful_dict = { 'weburl' : weburl, 'recID' : recID, 'ln' : ln, 'do' : display_order, 'ds' : display_since, 'nb' : nb_per_page, 'p' : page, 'reviews' : reviews, - 'discussion' : discussion + 'discussion' : discussion } useful_yes = '' + _("Yes") + '' useful_yes %= useful_dict useful_no = '' + _("No") + '' useful_no %= useful_dict warnings = self.tmpl_warnings(warnings, ln) ## record details from invenio.bibformat import format_record record_details = format_record(recID=recID, of='hs', ln=ln) link_dic = { 'weburl' : weburl, 'module' : 'comments', 'function' : 'index', 'discussion': discussion, 'arguments' : 'do=%s&ds=%s&nb=%s' % (display_order, display_since, nb_per_page), 'arg_page' : '&p=%s' % page, 'page' : page, 'rec_id' : recID} ## comments table comments_rows = '' for comment in comments: if comment[c_nickname]: _nickname = comment[c_nickname] display = _nickname else: (uid, _nickname, display) = get_user_info(comment[c_user_id]) messaging_link = self.create_messaging_link(_nickname, display, ln) # do NOT delete the HTML comment below. It is used for parsing... (I plead unguilty!) comments_rows += """ """ if not reviews: report_link = '%(weburl)s/record/%(recID)s/comments/report?ln=%(ln)s&comid=%%(comid)s&do=%(do)s&ds=%(ds)s&nb=%(nb)s&p=%(p)s&referer=%(weburl)s/record/%(recID)s/comments/display' % useful_dict % {'comid':comment[c_id]} reply_link = '%(weburl)s/record/%(recID)s/comments/add?ln=%(ln)s&action=REPLY&comid=%%(comid)s' % useful_dict % {'comid':comment[c_id]} comments_rows += indent_text(self.tmpl_get_comment_without_ranking(ln, messaging_link, comment[c_date_creation], comment[c_body], reply_link, report_link), 2) else: report_link = '%(weburl)s/record/%(recID)s/reviews/report?ln=%(ln)s&comid=%%(comid)s&do=%(do)s&ds=%(ds)s&nb=%(nb)s&p=%(p)s&referer=%(weburl)s/record/%(recID)s/reviews/display' % useful_dict % {'comid': comment[c_id]} comments_rows += indent_text(self.tmpl_get_comment_with_ranking(ln, messaging_link, comment[c_date_creation], comment[c_body], comment[c_nb_votes_total], comment[c_nb_votes_yes], comment[c_star_score], comment[c_title]), 2) helpful_label = _("Was this review helpful?") report_abuse_label = "(" + _("Report abuse") + ")" comments_rows += """
%(helpful_label)s %(tab)s %(yes)s / %(no)s %(tab)s%(tab)s%(report_abuse_label)s
""" \ % {'helpful_label': helpful_label, 'yes' : useful_yes % {'comid':comment[c_id]}, 'no' : useful_no % {'comid':comment[c_id]}, 'report' : report_link % {'comid':comment[c_id]}, 'report_abuse_label': report_abuse_label, 'tab' : ' '*2} # do NOT remove HTML comment below. It is used for parsing... comments_rows += """ """ ## page links page_links = '' # Previous if page != 1: link_dic['arg_page'] = 'p=%s' % (page - 1) page_links += '<< ' % link_dic else: page_links += ' %s ' % (' '*(len(_('Previous'))+7)) # Page Numbers for i in range(1, nb_pages+1): link_dic['arg_page'] = 'p=%s' % i link_dic['page'] = '%s' % i if i != page: page_links += ''' %(page)s ''' % link_dic else: page_links += ''' %s ''' % i # Next if page != nb_pages: link_dic['arg_page'] = 'p=%s' % (page + 1) page_links += ''' >> ''' % link_dic else: page_links += '%s' % (' '*(len(_('Next'))+7)) ## stuff for ranking if enabled if reviews: if avg_score > 0: avg_score_img = 'stars-' + str(avg_score).split('.')[0] + '-' + str(avg_score).split('.')[1] + '.png' else: avg_score_img = "stars-0-0.png" ranking_average = '
' ranking_average += _("Average review score: %(x_nb_score)s based on %(x_nb_reviews)s reviews") %\ {'x_nb_score': '' + str(avg_score) + '', 'x_nb_reviews': str(total_nb_reviews)} ranking_average += '
' else: ranking_average = "" write_button_link = '''%s/record/%s/%s/add''' % (weburl, recID, discussion) write_button_form = '' write_button_form = self.createhiddenform(action=write_button_link, method="get", text=write_button_form, button = reviews and _('Write a review') or _('Write a comment')) if reviews: total_label = _("There is a total of %s reviews") else: total_label = _("There is a total of %s comments") total_label %= total_nb_comments # do NOT remove the HTML comments below. Used for parsing body = '''
 
%(record_details)s
 
%(comments_and_review_tabs)s %(comments_rows)s
%(review_or_comment_first)s
''' % \ { 'record_label': _("Record"), 'back_label': _("Back to search results"), 'total_label': total_label, 'record_details': record_details, 'write_button_form' : write_button_form, 'write_button_form_again' : total_nb_comments>3 and write_button_form or "", 'comments_rows' : indent_text(comments_rows, 1), 'total_nb_comments' : total_nb_comments, 'comments_or_reviews' : reviews and _('review') or _('comment'), 'comments_or_reviews_title' : reviews and _('Review') or _('Comment'), 'weburl' : weburl, 'module' : "comments", 'recid' : recID, 'ln' : ln, 'border' : border, 'ranking_avg' : ranking_average, 'comments_and_review_tabs' : CFG_WEBCOMMENT_ALLOW_REVIEWS and \ CFG_WEBCOMMENT_ALLOW_COMMENTS and \ '%s | %s
' % \ (comments_link, reviews_link) or '', 'review_or_comment_first' : total_nb_comments > 0 and ' ' or \ (reviews==1 and _("Be the first to review this document.") or \ _("Start a discussion about any aspect of this document.")) } # form is not currently used. reserved for an eventual purpose #form = """ # Display # comments per page that are # and sorted by # """ % \ # (reviews==1 and ''' # # # # # ''' or ''' # ''') # #form_link = "%(weburl)s/%(module)s/%(function)s" % link_dic #form = self.createhiddenform(action=form_link, method="get", text=form, button='Go', recid=recID, p=1) pages = """
%(v_label)s %(comments_or_reviews)s %(results_nb_lower)s-%(results_nb_higher)s
%(page_links)s
""" % \ {'v_label': _("Viewing"), 'page_links': _("Page:") + page_links , 'comments_or_reviews': reviews and _('review') or _('comment'), 'results_nb_lower': len(comments)>0 and ((page-1) * nb_per_page)+1 or 0, 'results_nb_higher': page == nb_pages and (((page-1) * nb_per_page) + len(comments)) or (page * nb_per_page)} if nb_pages > 1: #body = warnings + body + form + pages body = warnings + body + pages + add_comment_or_review else: body = warnings + body + add_comment_or_review return '
' + body + '
' def create_messaging_link(self, to, display_name, ln=cdslang): """prints a link to the messaging system""" link = "%s/yourmessages/write?msg_to=%s&ln=%s" % (weburl, to, ln) if to: return '%s' % (link, display_name) else: return display_name def createhiddenform(self, action="", method="get", text="", button="confirm", cnfrm='', **hidden): """ create select with hidden values and submit button @param action: name of the action to perform on submit @param method: 'get' or 'post' @param text: additional text, can also be used to add non hidden input @param button: value/caption on the submit button @param cnfrm: if given, must check checkbox to confirm @param **hidden: dictionary with name=value pairs for hidden input @return html form """ output = """
""" % (action, string.lower(method).strip() in ['get','post'] and method or 'get') output += """
""" output += text + '\n' if cnfrm: output += """ """ for key in hidden.keys(): if type(hidden[key]) is list: for value in hidden[key]: output += """ """ % (key, value) else: output += """ """ % (key, hidden[key]) output += """
""" output += """ """ % (button, ) output += """
""" return output def tmpl_warnings(self, warnings, ln=cdslang): """ Prepare the warnings list @param warnings: list of warning tuples (warning_msg, arg1, arg2, etc) @return html string of warnings """ red_text_warnings = ['WRN_WEBCOMMENT_FEEDBACK_NOT_RECORDED', 'WRN_WEBCOMMENT_ALREADY_VOTED'] green_text_warnings = ['WRN_WEBCOMMENT_FEEDBACK_RECORDED'] from invenio.errorlib import get_msgs_for_code_list span_class = 'important' out = "" if type(warnings) is not list: warnings = [warnings] if len(warnings) > 0: warnings_parsed = get_msgs_for_code_list(warnings, 'warning', ln) for (warning_code, warning_text) in warnings_parsed: if not warning_code.startswith('WRN'): #display only warnings that begin with WRN to user continue if warning_code in red_text_warnings: span_class = 'important' elif warning_code in green_text_warnings: span_class = 'exampleleader' else: span_class = 'important' out += ''' %(warning)s
''' % \ { 'span_class' : span_class, 'warning' : warning_text } return out else: return "" def tmpl_add_comment_form(self, recID, uid, nickname, ln, msg, warnings): """ Add form for comments @param recID: record id @param uid: user id @param ln: language @param msg: comment body contents for when refreshing due to warning @param warnings: list of warning tuples (warning_msg, color) @return html add comment form """ _ = gettext_set_language(ln) link_dic = { 'weburl' : weburl, 'module' : 'comments', 'function' : 'add', 'arguments' : 'ln=%s&action=%s' % (ln, 'SUBMIT'), 'recID' : recID} if nickname: note = _("Note: Your nickname, %s, will be displayed as author of this comment") % ('' + nickname + '') else: (uid, nickname, display) = get_user_info(uid) link = '' % sweburl note = _("Note: you have not %(x_url_open)sdefined your nickname%(x_url_close)s. %(x_nickname)s will be displayed as the author of this comment.") %\ {'x_url_open': link, 'x_url_close': '', 'x_nickname': '
' + display + ''} #from invenio.search_engine import print_record #record_details = print_record(recID=recID, format='hb', ln=ln) warnings = self.tmpl_warnings(warnings, ln) form = """

%(add_comment)s

- +
%(note)s
""" % {'msg': msg, 'note': note, #'record': record_details, 'record_label': _("Article") + ":", 'comment_label': _("Comment") + ":", 'add_comment': _('Add comment')} form_link = "%(weburl)s/record/%(recID)s/comments/%(function)s?%(arguments)s" % link_dic form = self.createhiddenform(action=form_link, method="post", text=form, button='Add comment') return warnings + form def tmpl_add_comment_form_with_ranking(self, recID, uid, nickname, ln, msg, score, note, warnings, show_title_p=False): """ Add form for reviews @param recID: record id @param uid: user id @param ln: language @param msg: comment body contents for when refreshing due to warning @param score: review score @param note: review title @param warnings: list of warning tuples (warning_msg, color) @param show_title_p: if True, prefix the form with "Add Review" as title @return html add review form """ _ = gettext_set_language(ln) link_dic = { 'weburl' : weburl, 'module' : 'comments', 'function' : 'add', 'arguments' : 'ln=%s&action=%s' % (ln, 'SUBMIT'), 'recID' : recID} warnings = self.tmpl_warnings(warnings, ln) #from search_engine import print_record #record_details = print_record(recID=recID, format='hb', ln=ln) if nickname: note_label = _("Note: Your nickname, %s, will be displayed as the author of this review.") note_label %= ('' + nickname + '') else: (uid, nickname, display) = get_user_info(uid) link = '' % sweburl note_label = _("Note: you have not %(x_url_open)sdefined your nickname%(x_url_close)s. %(x_nickname)s will be displayed as the author of this comment.") %\ {'x_url_open': link, 'x_url_close': '', 'x_nickname': '
' + display + ''} selected0 = '' selected1 = '' selected2 = '' selected3 = '' selected4 = '' selected5 = '' if score == 0: selected0 = ' selected="selected"' elif score == 1: selected1 = ' selected="selected"' elif score == 2: selected2 = ' selected="selected"' elif score == 3: selected3 = ' selected="selected"' elif score == 4: selected4 = ' selected="selected"' elif score == 5: selected5 = ' selected="selected"' form = """%(add_review)s
%(rate_label)s:
%(title_label)s:
%(write_label)s:
%(note_label)s
""" % {'article_label': _('Article'), 'rate_label': _("Rate this article"), 'select_label': _("Select a score"), 'title_label': _("Give a title to your review"), 'write_label': _("Write your review"), 'note_label': note_label, 'note' : note!='' and note or "", 'msg' : msg!='' and msg or "", #'record' : record_details 'add_review': show_title_p and ('

'+_('Add review')+'

') or '', 'selected0': selected0, 'selected1': selected1, 'selected2': selected2, 'selected3': selected3, 'selected4': selected4, 'selected5': selected5 } form_link = "%(weburl)s/record/%(recID)s/reviews/%(function)s?%(arguments)s" % link_dic form = self.createhiddenform(action=form_link, method="post", text=form, button=_('Add Review')) return warnings + form def tmpl_add_comment_successful(self, recID, ln, reviews, warnings): """ @param recID: record id @param ln: language @return html page of successfully added comment/review """ _ = gettext_set_language(ln) link_dic = { 'weburl' : weburl, 'module' : 'comments', 'function' : 'display', 'arguments' : 'ln=%s&do=od' % ln, 'recID' : recID, 'discussion': reviews==1 and 'reviews' or 'comments'} link = "%(weburl)s/record/%(recID)s/%(discussion)s/%(function)s?%(arguments)s" % link_dic if warnings: out = self.tmpl_warnings(warnings, ln) + '

' else: if reviews: out = _("Your review was successfully added.") + '

' else: out = _("Your comment was successfully added.") + '

' out += '' % link out += _('Back to record') + '' return out def tmpl_create_multiple_actions_form(self, form_name="", form_action="", method="get", action_display={}, action_field_name="", button_label="", button_name="", content="", **hidden): """ Creates an HTML form with a multiple choice of actions and a button to select it. @param form_action: link to the receiver of the formular @param form_name: name of the HTML formular @param method: either 'GET' or 'POST' @param action_display: dictionary of actions. action is HTML name (name of action) display is the string provided in the popup @param action_field_name: html name of action field @param button_label: what's written on the button @param button_name: html name of the button @param content: what's inside te formular @param **hidden: dictionary of name/value pairs of hidden fields. """ output = """
""" % (form_action, method) output += """
""" output += content + '\n' for key in hidden.keys(): if type(hidden[key]) is list: for value in hidden[key]: output += """ """ % (key, value) else: output += """ """ % (key, hidden[key]) output += """
""" if type(action_display) is dict and len(action_display.keys()): output += """ """ output += """ """ % (button_label, button_name) output += """
""" return output def tmpl_admin_index(self, ln): """ """ # load the right message language _ = gettext_set_language(ln) out = '
    ' if CFG_WEBCOMMENT_ALLOW_COMMENTS or CFG_WEBCOMMENT_ALLOW_REVIEWS: if CFG_WEBCOMMENT_ALLOW_COMMENTS: out += '
  1. %(reported_cmt_label)s
  2. ' %\ {'weburl': weburl, 'ln': ln, 'reported_cmt_label': _("View all reported comments")} if CFG_WEBCOMMENT_ALLOW_REVIEWS: out += '
  3. %(reported_rev_label)s
  4. ' %\ {'weburl': weburl, 'ln': ln, 'reported_rev_label': _("View all reported reviews")} out += """
  5. %(delete_label)s
  6. %(view_users)s
  7. """ % {'weburl' : weburl, 'delete_label': _("Delete a specific comment/review (by ID)"), 'view_users': _("View all users who have been reported"), 'ln' : ln} else: out += _("Comments and reviews are disabled") + '
    ' out += '
' from invenio.bibrankadminlib import addadminbox return addadminbox('%s'%_("Menu"), [out]) def tmpl_admin_delete_form(self, ln, warnings): """ @param warnings: list of warning_tuples where warning_tuple is (warning_message, text_color) see tmpl_warnings, color is optional """ # load the right message language _ = gettext_set_language(ln) warnings = self.tmpl_warnings(warnings, ln) out = '''
%s

'''%_("Please enter the ID of the comment/review so that you can view it before deciding whether to delete it or not") form = '''
%s


''' %_("Comment ID:") form_link = "%s/admin/webcomment/webcommentadmin.py/delete?ln=%s" % (weburl, ln) form = self.createhiddenform(action=form_link, method="get", text=form, button=_('View Comment')) return warnings + out + form def tmpl_admin_users(self, ln, users_data): """ @param users_data: tuple of ct, i.e. (ct, ct, ...) where ct is a tuple (total_number_reported, total_comments_reported, total_reviews_reported, total_nb_votes_yes_of_reported, total_nb_votes_total_of_reported, user_id, user_email, user_nickname) sorted by order of ct having highest total_number_reported """ _ = gettext_set_language(ln) u_reports = 0 u_comment_reports = 1 u_reviews_reports = 2 u_nb_votes_yes = 3 u_nb_votes_total = 4 u_uid = 5 u_email = 6 u_nickname = 7 if not users_data: return self.tmpl_warnings([(_("There have been no reports so far."), 'green')]) user_rows = "" for utuple in users_data: com_label = _("View all %s reported comments") % utuple[u_comment_reports] com_link = '''%s
''' % \ (weburl, ln, utuple[u_uid], com_label) rev_label = _("View all %s reported reviews") % utuple[u_reviews_reports] rev_link = '''%s''' % \ (weburl, ln, utuple[u_uid], rev_label) if not utuple[u_nickname]: user_info = get_user_info(utuple[u_uid]) nickname = user_info[2] else: nickname = utuple[u_nickname] if CFG_WEBCOMMENT_ALLOW_REVIEWS: review_row = """ %s %s %s""" review_row %= (utuple[u_nb_votes_yes], utuple[u_nb_votes_total] - utuple[u_nb_votes_yes], utuple[u_nb_votes_total]) review_row = indent_text(review_row, 1) else: review_row = '' user_rows += """ %(nickname)s %(email)s %(uid)s%(review_row)s %(reports)s %(com_link)s%(rev_link)s """ % { 'nickname' : nickname, 'email' : utuple[u_email], 'uid' : utuple[u_uid], 'reports' : utuple[u_reports], 'review_row': review_row, 'weburl' : weburl, 'ln' : ln, 'com_link' : CFG_WEBCOMMENT_ALLOW_COMMENTS and com_link or "", 'rev_link' : CFG_WEBCOMMENT_ALLOW_REVIEWS and rev_link or "" } out = "
" out += _("Here is a list, sorted by total number of reports, of all users who have had a comment reported at least once.") out += """

\n' out += indent_text('\n', 3) out += indent_text('\n', 3) if CFG_WEBCOMMENT_ALLOW_REVIEWS > 0: out += indent_text('\n', 3) out += indent_text('\n', 3) out += indent_text('\n', 3) out += indent_text('\n', 3) out += indent_text('\n', 3) out += """ %s
""" out += _("Nickname") + '' + _("Email") + '' + _("User ID") + '' + _("Number positive votes") + '' + _("Number negative votes") + '' + _("Total number votes") + '' + _("Total number of reports") + '' + _("View all user's reported comments/reviews") + '
""" % indent_text(user_rows, 2) return out def tmpl_admin_select_comment_checkbox(self, cmt_id): """ outputs a checkbox named "comidXX" where XX is cmt_id """ return '' % int(cmt_id) def tmpl_admin_user_info(self, ln, nickname, uid, email): """ prepares informations about a user""" _ = gettext_set_language(ln) out = """ %(nickname_label)s: %(messaging)s
%(uid_label)s: %(uid)i
%(email_label)s: %(email)s""" out %= {'nickname_label': _("Nickname"), 'messaging': self.create_messaging_link(uid, nickname, ln), 'uid_label': _("User ID"), 'uid': int(uid), 'email_label': _("Email"), 'email': email} return out def tmpl_admin_review_info(self, ln, reviews, nb_reports, cmt_id, rec_id): """ outputs information about a review """ _ = gettext_set_language(ln) if reviews: reported_label = _("This review has been reported %i times") else: reported_label = _("This comment has been reported %i times") reported_label %= int(nb_reports) out = """ %(reported_label)s
%(rec_id_label)s
%(cmt_id_label)s""" out %= {'reported_label': reported_label, 'rec_id_label': _("Record") + ' #' + str(rec_id), 'weburl': weburl, 'rec_id': int(rec_id), 'cmt_id_label': _("Comment") + ' #' + str(cmt_id), 'ln': ln} return out def tmpl_admin_comments(self, ln, uid, comID, comment_data, reviews): """ @param comment_data: same type of tuple as that which is returned by webcomment.py/query_retrieve_comments_or_remarks i.e. tuple of comment where comment is tuple (nickname, date_creation, body, id) if ranking disabled or tuple (nickname, date_creation, body, nb_votes_yes, nb_votes_total, star_score, title, id) """ _ = gettext_set_language(ln) comments = [] comments_info = [] checkboxes = [] users = [] for (cmt_tuple, meta_data) in comment_data: if reviews: comments.append(self.tmpl_get_comment_with_ranking(ln, cmt_tuple[0],#nickname cmt_tuple[2],#date_creation cmt_tuple[3],#body cmt_tuple[5],#nb_votes_total cmt_tuple[4],#nb_votes_yes cmt_tuple[6],#star_score cmt_tuple[7]))#title else: comments.append(self.tmpl_get_comment_without_ranking(ln, cmt_tuple[0],#nickname cmt_tuple[2],#date_creation cmt_tuple[3],#body None, #reply_link None)) #report_link users.append(self.tmpl_admin_user_info(ln, meta_data[0], #nickname meta_data[1], #uid meta_data[2]))#email comments_info.append(self.tmpl_admin_review_info(ln, reviews, meta_data[5], # nb abuse reports meta_data[3], # cmt_id meta_data[4]))# rec_id checkboxes.append(self.tmpl_admin_select_comment_checkbox(meta_data[3])) form_link = "%s/admin/webcomment/webcommentadmin.py/del_com?ln=%s" % (weburl, ln) out = """ """ % {'review_label': reviews and _("Review") or _("Comment"), 'written_by_label': _("Written by"), 'review_info_label': _("General informations"), 'select_label': _("Select")} for i in range (0, len(comments)): out += """ """ % (comments[i], users[i], comments_info[i], checkboxes[i]) out += """
%(review_label)s %(written_by_label)s %(review_info_label)s %(select_label)s
%s %s %s %s
""" if reviews: action_display = { 'delete': _('Delete selected reviews'), 'unreport': _('Suppress selected abuse report') } else: action_display = { 'delete': _('Delete selected comments'), 'unreport': _('Suppress selected abuse report') } form = self.tmpl_create_multiple_actions_form(form_name="admin_comment", form_action=form_link, method="post", action_display=action_display, action_field_name='action', button_label=_("OK"), button_name="okbutton", content=out) if uid > 0: header = '
' if reviews: header += _("Here are the reported reviews of user %s") % uid else: header += _("Here are the reported comments of user %s") % uid header += '

' if comID > 0: header = '
' +_("Here is comment/review %s")% comID + '

' if uid > 0 and comID > 0: header = '
' + _("Here is comment/review %(x_cmtID)s written by user %(x_user)s") % {'x_cmtID': comID, 'x_user': uid} header += '

' if uid == 0 and comID == 0: header = '
' if reviews: header += _("Here are all reported reviews sorted by the most reported") else: header += _("Here are all reported comments sorted by the most reported") header += "

" return header + form def tmpl_admin_del_com(self, del_res, ln=cdslang): """ @param del_res: list of the following tuple (comment_id, was_successfully_deleted), was_successfully_deleted is boolean (0=false, >0=true """ _ = gettext_set_language(ln) table_rows = '' for deltuple in del_res: table_rows += """ %s %s """ % (deltuple[0], deltuple[1]>0 and _("Yes") or "" +_("No") + "") out = """ %s
%s %s
""" % (_("comment ID"), _("successfully deleted"), table_rows) return out def tmpl_admin_suppress_abuse_report(self, del_res, ln=cdslang): """ @param del_res: list of the following tuple (comment_id, was_successfully_deleted), was_successfully_deleted is boolean (0=false, >0=true """ _ = gettext_set_language(ln) table_rows = '' for deltuple in del_res: table_rows += """ """ % (deltuple[0], deltuple[1]>0 and _("Yes") or "" +_("No") + "") out = """
%s %s
%s
%s %s
""" % (_("comment ID"), _("successfully suppressed abuse report"), table_rows) return out def tmpl_mini_review(self, recID, ln=cdslang, action='SUBMIT', avg_score=0, nb_comments_total=0): """Display the mini version of reviews (only the grading part)""" _ = gettext_set_language(ln) - + url = '%s/record/%s/reviews/add?ln=%s&action=%s' % (weburl, recID, ln, action) if avg_score > 0: score = _("Average review score: %(x_nb_score)s based on %(x_nb_reviews)s reviews") %\ {'x_nb_score': '%.1f' % avg_score, 'x_nb_reviews': nb_comments_total} else: score = '(' +_("Not yet reviewed") + ')' - + + if score == 5: + s1, s2, s3, s4, s5 = 'full', 'full', 'full', 'full', 'full' + elif score >= 4.5: + s1, s2, s3, s4, s5 = 'full', 'full', 'full', 'full', 'half' + elif score >= 4: + s1, s2, s3, s4, s5 = 'full', 'full', 'full', 'full', '' + elif score >= 3.5: + s1, s2, s3, s4, s5 = 'full', 'full', 'full', 'half', '' + elif score >= 3: + s1, s2, s3, s4, s5 = 'full', 'full', 'full', '', '' + elif score >= 2.5: + s1, s2, s3, s4, s5 = 'full', 'full', 'half', '', '' + elif score >= 2: + s1, s2, s3, s4, s5 = 'full', 'full', '', '', '' + elif score >= 1.5: + s1, s2, s3, s4, s5 = 'full', 'half', '', '', '' + elif score == 1: + s1, s2, s3, s4, s5 = 'full', '', '', '', '' + out = ''' %(rate)s:

Rate this document: -
1 -
2 -
3 -
4 -
+
1 +
2 +
3 +
4 +
 
%(score)s ''' % {'url': url, 'score': score, - 'rate': _("Rate this document") + 'rate': _("Rate this document"), + 's1': s1, + 's2': s2, + 's3': s3, + 's4': s4, + 's5': s5 } return out diff --git a/modules/webstyle/css/cds.css b/modules/webstyle/css/cds.css index 0b0eddcc9..9cd7591fa 100644 --- a/modules/webstyle/css/cds.css +++ b/modules/webstyle/css/cds.css @@ -1,1610 +1,1619 @@ /* * -*- mode: text; coding: utf-8; -*- - $Id$ + $Id$ This file is part of CDS Invenio. Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. CDS Invenio is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + CDS Invenio is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - + General Public License for more details. + You should have received a copy of the GNU General Public License along with CDS Invenio; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ body { color: #000; background: #fff; margin: 0px; padding: 0px; } h1 { font-size: 173%; font-weight: 700; margin-top: 5px; margin-left: 0px; color: #36c; background: transparent; } .h1 { font-size: 173%; font-weight: 700; margin-left: 0px; color: #36c; background: transparent; } h2 { font-size: 144%; font-weight: 650; margin-left: 0px; color: #36c; background: transparent; } h3 { font-size: 120%; font-weight: 600; font-variant: small-caps; margin-top: 40px; margin-left: 0px; margin-bottom: 10px; color: #36c; background: transparent; border-bottom: dotted 2px #36c; width: 50%; } h4 { font-size: 110%; font-weight: 600; font-style: italic; color: #36c; margin-left: 0px; background: transparent; } h5 { font-size: 110%; font-weight: 400; color: #36c; margin-left: 0px; background: transparent; } h6 { font-size: 110%; font-weight: 200; font-style: italic; color: #36c; margin-left: 0px; background: transparent; } a:link { color: #00c; background: transparent; } a:visited { color: #006; background: transparent; } a:active { color: #00c; background: transparent; } a:hover { color: #00c; background: transparent; } a.moreinfo:link { color: #060; background: transparent; } a.moreinfo:visited { color: #060; background: transparent; } a.moreinfo:active { color: #060; background: transparent; } a.moreinfo:hover { color: #060; background: transparent; } a.img:hover { color: #00c; background: transparent; } a.img:active { color: #00c; background: transparent; font-weight: normal; } a.note:link { color: #666; background: transparent; } a.note:visited { color: #666; background: transparent; } a.note:active { color: #666; background: transparent; } a.note:hover { color: #666; background: transparent; } .headerbox { color: #000; background: transparent; width: 100%; padding: 0px; margin-top: 0px; margin-bottom: 0px; border-collapse: collapse; border-bottom: 2px solid #3366cc; } .headerboxbody { color: #000; padding: 0px; margin: 0px; } .headerboxbodylogo { width: 200px; padding-left: 5px; color: #36c; font-size: 20px; font-weight: bold; font-variant: small-caps; letter-spacing: 6px; } .headermodulebox { color: #fff; background: transparent; border-collapse: collapse; margin: 0px; padding: 0px; } .headermoduleboxbody { color: #000; background: #36c; font-size: x-small; font-weight: bold; text-align: center; margin: 0px; padding: 0px; width: 75px; } .headermoduleboxbodyblank { - width: 12px; + width: 12px; padding: 0px; margin: 0px; } .headermoduleboxbodyselected { color: #000; background: #fff; font-size: x-small; font-weight: bold; text-align: center; border-left: 2px solid #36c; border-right: 2px solid #36c; border-top: 2px solid #36c; margin: 5px; padding: 0px; width: 75px; } a.header:link { color: #fff; background: #36c; text-decoration: none; } a.header:visited { color: #fff; background: #36c; text-decoration: none; } a.header:active { color: #fff; background: #36c; text-decoration: none; } a.header:hover { color: #fff; background: #36c; text-decoration: none; } a.headerselected:link { color: #36c; background: #fff; text-decoration: none; } a.headerselected:visited { color: #36c; background: #fff; text-decoration: none; } a.headerselected:active { color: #36c; background: #fff; text-decoration: none; } a.headerselected:hover { color: #36c; background: #fff; text-decoration: none; } .navtrailbox { color: #36c; background: #fff; padding: 0px; margin-top: 7px; border-spacing: 0px; border-collapse: collapse; font-size: x-small; } .navtrailboxbody { color: #36c; padding: 0px 0px 0px 10px; border-spacing: 0px; background: #fff; font-size: x-small; } a.navtrail:link { color: #36c; background: transparent; } a.navtrail:visited { color: #36c; background: transparent; } a.navtrail:active { color: #36c; background: transparent; } a.navtrail:hover { color: #36c; background: transparent; } .info { color: #060; background: transparent; } .snapshot { color: #000; background: transparent; - border: 2px solid #999; + border: 2px solid #999; margin: 10px 10px 0px 40px; } .pageheader { color: #999; font-size: x-small; background: transparent; padding: 0px; margin: 0px; width: 100%; } .pagebody { color: #000; background: transparent; margin:0px; padding: 20px; } .pagebodystripeleft { color: #000; background: #fff; font-size: x-small; width: 120px; margin: 0px; padding-left: 10px; float: left; } .pagebodystripemiddle { color: #000; background: #fff; padding: 0px; margin: 0px; } .pagebodystriperight { color: #000; background: #fff; font-size: x-small; width: 120px; float: right; } .pageboxlefttop { color: #000; background: transparent; font-size: x-small; } .pageboxlefttopadd { color: #000; background: transparent; font-size: x-small; } .pageboxleftbottom { color: #000; background: transparent; font-size: x-small; } .pageboxleftbottomadd { color: #000; background: transparent; font-size: x-small; } .pageboxrighttop { color: #000; background: transparent; font-size: x-small; } .pageboxrighttopadd { color: #000; background: transparent; font-size: x-small; } .pageboxrightbottom { color: #000; background: transparent; font-size: x-small; } .pageboxrightbottomadd { color: #000; background: transparent; font-size: x-small; } .pagefooter { color: #666; background: #fff; font-size: x-small; margin-top: 50px; padding: 0px; border-top: 1px solid #666; width: 100%; clear: both; } .pagefooterstripeleft { color: #666; background: #fff; font-size: x-small; margin-left: 5px; width: 60%; float: left; text-align: left; } .pagefooterstriperight { color: #666; background: #fff; margin-right: 5px; font-size: x-small; text-align: right; } a.footer:link { color: #666; background: transparent; } a.footer:visited { color: #666; background: transparent; } a.footer:active { color: #666; background: transparent; } a.footer:hover { color: #666; background: transparent; } .errorbox { color: #000; background: #ffcccc; padding: 1px; margin: 5px 30px 5px 30px; border-collapse: collapse; - border: 2px solid #900; + border: 2px solid #900; } .errorboxheader { color: #000; background: #ffcccc; padding: 3px; border-spacing: 0px; font-weight: bold; text-align: left; } .errorboxbody { color: #000; background: #ffcccc; padding: 3px; } .searchbox { color: #000; background: #fff; padding: 1px; margin: 5px 0px 5px 0px; border-collapse: collapse; border-top: 1px solid #36c; } .searchboxheader { color: #000; background: #f1f1f1; padding: 3px; border-spacing: 0px; font-size: small; text-align: left; } .searchboxbody { color: #000; background: #fff; padding: 3px; } .narrowsearchbox { color: #000; background: #fff; padding: 1px; margin: 20px 20px 5px 0px; border-collapse: collapse; - border-top: 1px solid #36c; + border-top: 1px solid #36c; } .narrowsearchboxheader { color: #000; background: #f1f1f1; padding: 3px; border-spacing: 0px; font-size: small; text-align: left; } .narrowsearchboxbody { color: #000; background: #fff; padding: 3px; } .focusonsearchbox { color: #000; background: #f0f8ff; padding: 1px; margin: 20px 20px 5px 0px; border-collapse: collapse; - border-top: 1px solid #36c; + border-top: 1px solid #36c; } .focusonsearchboxheader { color: #000; background: #e6e6fa; padding: 3px; border-spacing: 0px; font-size: small; text-align: left; } .focusonsearchboxbody { color: #000; background: #f0f8ff; padding: 3px; } .searchalsosearchbox { color: #000; background: #fffbf5; padding: 1px; margin: 20px 20px 5px 0px; border-collapse: collapse; - border-top: 1px solid #36c; + border-top: 1px solid #36c; } .searchalsosearchboxheader { color: #000; background: #ffeacc; padding: 3px; border-spacing: 0px; font-size: small; text-align: left; } .searchalsosearchboxbody { color: #444; background: #fffbf5; padding: 3px; } .latestadditionsbox { color: #000; background: #fff; padding: 5px; margin: 5px 20px 5px 0px; border-spacing: 5px; } .latestadditionsboxtimebody { color: #000; background: #fff; padding: 3px; white-space: nowrap; text-align: right; vertical-align: top; font-size: xx-small; } .latestadditionsboxrecordbody { color: #000; background: #fff; padding: 3px; text-align: left; vertical-align: top; font-size: small; } .portalbox { color: #000; background: #fff; margin: 0px 0px 15px 0px; border-collapse: collapse; border-top: 1px solid #abb; font-size: x-small; width: 100%; } .portalboxheader { color: #000; background: #f1f1f1; padding: 2px; border-spacing: 0px; border-bottom: 1px solid #999; text-align: left; font-size: x-small; } .portalboxbody { color: #000; background: #fff; padding: 2px; font-size: x-small; } .admin_wvar, .admin_w200, .admin_wvar_nomargin { color: #000; background: white; padding: 1px; margin: 0px 0px 5px 20px; border-spacing: 0px; border-top: 1px solid #36c; } .admin_w200 { width: 250px; } .admin_wvar_nomargin { margin: 0px; } .adminlabel { width: 100px; font-size: small; background: #f1f1f1; vertical-align: top; } .adminheader, .adminheaderleft, .adminheadercenter, .adminheaderright { color: #000; background: #f1f1f1; border-spacing: 0px; font-size: small; padding: 3px 5px; text-align: center; } .adminheaderleft { text-align: left; } .adminheaderright { text-align: right; } .adminbutton { color: #fff; background: #36c; font-weight: bold; margin: 5px 10px 5px 10px; border-collapse: collapse; border-top: 1px solid #36c; } .admintd, .admintdleft, .admintdright { font-size: small; padding: 0px 10px; text-align: center; vertical-align: top; } .admintdleft { text-align: left; } .admintdright { text-align: right; } a.google:link { color: #333; background: transparent; } a.google:visited { color: #333; background: transparent; } a.google:active { color: #333; background: transparent; } a.google:hover { color: #333; background: transparent; } .googlebox { color: #333; background: #fff; text-align: left; margin-left: auto; margin-right: auto; margin-top: 50px; padding: 10px; font-size: small; border-collapse: collapse; border-top: 1px solid #fc0; } .googleboxheader { color: #333; background: #ffc; font-weight: normal; font-size: small; vertical-align: top; } .googleboxbody { color: #333; background: #fff; padding: 0px 5px 0px 5px; font-size: small; text-align: left; vertical-align: top; } .adminbox { color: #000; background: #f1f1f1; margin: 0px; padding: 0px; width: 120px; } .adminboxheader { color: #000; background: #f1f1f1; font-size: x-small; text-align: left; } .adminboxbody { color: #000; background: #f1f1f1; font-size: x-small; } .formbutton { color: #fff; background: #36c; font-weight: bold; } .headline { color: #36c; background: transparent; } .quicknote { color: #603; background: transparent; } .important { color: #f00; background: transparent; } .popupselected { color: #fff; background: #006; } .searchresultsbox { color: #000; background: #ffe; padding: 0px; margin-top: 15px; border-collapse: collapse; - border-top: 1px solid #fc0; + border-top: 1px solid #fc0; width: 100%; } .searchresultsboxheader { color: #000; background: #ffc; padding: 2px; border-spacing: 0px; text-align: left; font-weight: normal; } .searchresultsboxbody { color: #000; background: #ffe; - border-top: 1px dotted #fc0; - border-bottom: 1px dotted #fc0; + border-top: 1px dotted #fc0; + border-bottom: 1px dotted #fc0; padding: 2px; } .searchresultsboxrecords { color: #000; background: transparent; margin-left: 0px; margin-right: 20px; } .nearesttermsbox { color: #603; background: #ffe; padding: 0px; border-collapse: collapse; } .nearesttermsboxheader { color: #603; background: #ffc; padding: 0px; border-spacing: 0px; text-align: left; font-weight: normal; } .nearesttermsboxbody { color: #603; background: #fff; padding: 0px; } a.nearestterms:link { color: #603; background: transparent; } a.nearestterms:visited { color: #603; background: transparent; } a.nearestterms:active { color: #603; background: transparent; } a.nearestterms:hover { color: #603; background: transparent; } .nearesttermsboxbodyselected { color: #999; background: #fff; padding: 0px; } a.nearesttermsselected:link { color: #999; background: transparent; } a.nearesttermsselected:visited { color: #999; background: transparent; } a.nearesttermsselected:active { color: #999; background: transparent; } a.nearesttermsselected:hover { color: #999; background: transparent; } .moreinfo { color: #060; font-size: small; background: transparent; } .rankscoreinfo { color: #666; font-size: x-small; background: transparent; } .userinfobox { color: #039; font-size: x-small; width: 150px; margin-bottom: 15px; } .userinfoboxheader { color: #039; font-size: x-small; font-weight: bold; - border-top: 1px solid #060; - border-bottom: 1px solid #060; + border-top: 1px solid #060; + border-bottom: 1px solid #060; } .userinfoboxbody { color: #039; padding: 0px 5px 2px 0px; font-size: x-small; font-weight: normal; } a.userinfo:link { color: #039; background: transparent; } a.userinfo:visited { color: #039; background: transparent; } a.userinfo:active { color: #039; background: transparent; } a.userinfo:hover { color: #039; background: transparent; } a.langinfo:link { color: #666; background: transparent; } a.langinfo:visited { color: #666; background: transparent; } a.langinfo:active { color: #666; background: transparent; } a.langinfo:hover { color: #666; background: transparent; } .faq { margin-left: 12%; margin-right: 3%; } .faqq { margin-left: 18%; margin-right: 3%; } .exampleleader { color: #060; background: transparent; } .example { color: #039; background: transparent; } .blocknote { color: #000; background: #ccc; } .blocknotebis { color: #000; background: #999; } .devel { color: #600; background: #fff; border-color: #600; border-left-width: medium; border-left-style: solid; font-size: 90%; } .normal { color: #000; background: #fff; } .address { font-style: normal; font-size: x-small; } .note { color: #666; background: transparent; } .warning { color: #603; background: transparent; } .light { color: #ccc; background: transparent; } .nbdoccoll { color: #666; background: transparent; } hr { width: 100%; height: 1px; color: #999; background-color: #999; - border-width: 0; + border-width: 0; } input,select { color: #000; background: #fff; } .wsactionbutton { width: 150px; height: 25px; color: #039; margin: 0px; background-color: #fff; border: 2px solid #039; vertical-align: middle; font-size: small; padding: 5px 5px 0px 5px; } .wsactionbuttonh { width: 150px; height: 25px; color: #039; margin: 0px; background-color: #9cf; border: 2px solid #039; vertical-align: middle; font-size: small; padding: 5px 5px 0px 5px; } .textbutton { color: #039; font-weight: bold; text-decoration: none; } .submitBody { - color: #000; - background: #9cf; -} + color: #000; + background: #9cf; +} .submitHeader { - color: #fff; - background: #006; + color: #fff; + background: #006; } .submitCurrentPage { color: #000; background: #9cf; border-top: 1px solid #039; border-left: 1px solid #039; border-right: 1px solid #039; } .submitEmptyPage { color: #fff; background: #fff; border-bottom: 1px solid #039; } .submitPage { color: #000; background: #fff; border-top: 1px solid #039; border-left: 1px solid #039; border-right: 1px solid #039; } .mycdscell { border-right: 1px solid #fff; } .guideimg { border: 2px dotted #777; padding: 5px; margin: 5px; } .guideheader { font-size: 120%; font-weight: 600; font-variant: small-caps; color: #36c; margin-left: 10px; background: transparent; } .recordlastmodifiedbox { text-align: left; font-size: small; color: #603; background: #fff; } .commentbox { color: #000; width: 100%; padding: 0px 10px 10px 10px; border-left: 2px solid #36c; } .warninggreen { color: #060; background: transparent; } .warningred { color: #f00; background: transparent; } .reportabuse { color: #000; background: #fff; font-size: small; vertical-align: bottom; } /* WebMessage module */ .mailbox{ border-collapse: collapse; color: #000; margin-top: 15px; padding: 0px; width: auto; } .mailboxheader tr{ - background: #ffc; + background: #ffc; } .inboxheader { text-align:center; padding: 5px 30px 5px 30px; border-top: 1px solid #fc0; border-bottom: 1px solid #fc0; } .messageheader{ width: 100%; padding: 0px; border: 0px; } .mailboxinput{ width: 100%; } .mailboxlabel{ white-space: nowrap; - padding-right: 15px; + padding-right: 15px; } .mailboxbody{ background: #ffe; } .mailboxrecord{ /* each record */ } .mailboxrecord td{ /* each cell of a record */ padding: 4px 30px 4px 30px; border-top: 1px dashed #fff; } .mailboxfooter{ background-color: #fff; } .mailboxfooter td{ padding: 10px 0px 0px 0px; - border-top: 1px solid #fc0; + border-top: 1px solid #fc0; border-bottom: none; border-left: none; - border-right: none; + border-right: none; } .mailboxsearch td { padding-top: 10px; padding-bottom: 10px; } .mailboxresults td { padding-bottom: 5px; border-bottom: 1px solid #fc0; } .nonsubmitbutton { color: #000; background: #fc0; font-weight: bold; } .confirmoperation{ margin: auto; width: 400px; height: 100px; background-color: #ddf; } .confirmmessage{ font-weight: bold; text-align: center; } .infobox{ background-color: #ffc; padding: 7px; border-collapse: collapse; border: 1px solid #fc0; } .warningbox{ background-color: #cff; padding: 7px; border-collapse: collapse; border: 1px solid #ccff00; } .quotabox{ background-color: #ffc; width: 200px; height: 15px; border: 1px solid #fc0; margin: 3px 0px 3px 0px; } .quotabar{ - background-color: #fc0; + background-color: #fc0; border: 0px none black; - height: 15px; + height: 15px; } /* WebBasket module */ #bskcontainer{ float: left; background: transparent; } #bsktabs{ float: left; background:transparent; padding: 0px; margin: 0px; text-align: center; } .bsktab{ float: left; vertical-align: center; margin: 0px 20px 0px 20px; padding: 4px 10px 5px 5px; background-repeat: no-repeat; background-position: top-left; background-color: #ffe; } #bsktab_selected{ background-color: #ffc; font-weight: bold; - border-bottom: hidden; + border-bottom: hidden; } .bsktab a{ color: #000; text-decoration: none; } .bsktab a:hover{ text-decoration: underline; } .bsktab img{ margin: 0px 5px 0px 0px; } #bskcontent{ float: left; width: 100%; border-collapse: collapse; background: #ffe; border: none; } #bsktopics{ background-color: #ffc; padding: 10px; width: 100%; } .bsktopic{ white-space: nowrap; font-weight: bold; - margin: 0px 20px 0px 20px; + margin: 0px 20px 0px 20px; } .bsktopic a{ font-weight: normal; text-decoration: none; color: #000; } .bsktopic a:hover{ text-decoration: underline; } #bskbaskets{ padding: 10px; } #bskinfos{ background-color: transparent; } .bskbasket{ margin-bottom: 20px; border-collapse: collapse; border: 1px solid #fc0; background-color:white; } .bskbasketheader{ background-color: #ffc; } .bskbasketheader td{ padding: 5px; border-bottom: 1px solid #fc0; border-collapse: collapse; vertical-align: top; } .bskbasketfooter{ border-top: 1px solid #fc0; background-color: #ffc; padding: 3px; } .bskbasketheaderactions{ text-align: center; white-space: nowrap; } .bskbasketheaderactions td{ border: none; } .bskbasketheaderactions img{ border: 0px; margin: 2px; } .bskbasketheaderactions a{ font-size: small; color: #000; } .bskbasketfooter td{ padding: 5px 0px 5px 0px; } .bskactions{ text-align: center; white-space: nowrap; border-bottom: 1px solid #fc0; } .bskactions td{ border: none; } .bskactions img{ border: 0px; margin: 2px; } .bskactions a{ font-size: x-small; } .bsktitle { width: 100%; } .bskcmtcol{ white-space: nowrap; text-align: right; } .bskcontentcol{ border-bottom: 1px solid #fc0; padding: 5px; } .bskcontentcol a{ font-size: small; } .bskcomment { padding: 15px 10px 15px 10px; margin-bottom: 5px; - border-bottom: 1px solid #fc0; + border-bottom: 1px solid #fc0; } .bsklabel{ font-size: small; font-weight: bold; white-space: nowrap; - padding-right: 15px; + padding-right: 15px; } .bsk_create_link{ padding-top: 5px; padding-bottom: 10px; background-color: transparent; } .bsk_create_link a{ color: black; } .bsk_create_link img{ border: none; } dd{ margin-bottom: 10px; } /* end of WebBasket module */ /* WebSubmit module */ form.hyperlinkform { /* used in form tag for a form that should be hidden, but contains a button styled like a hyperlink */ display: inline; padding: 0; margin: 0; height: 0; width: 0; } input.hyperlinkformHiddenInput { /* used in a hidden input tag for a form that should be hidden, but contains a button styled like a hyperlink */ display: inline; padding: 0; margin: 0; height: 0; width: 0; } input.hyperlinkformSubmitButton { /* used in a submit input tag for a form that should be hidden, but contains a button styled like a hyperlink */ display: inline; padding: 0; margin: 0; border: 0; background-color: transparent; font-size: 1em; line-height: 1em; text-decoration: underline; cursor: pointer; color: blue; } /* end of WebSubmit module */ /* BibEdit module */ .bibEditTable{ background: #ececec; border: 0px; padding: 0px; border-collapse: collapse; } .bibEditTable th{ background: #ccc; text-align: left; padding: 5px; } .bibEditCellRight{ font-size: small; text-align: right; padding: 0px; } .bibEditCellTag{ font-size: small; text-align: right; vertical-align: top; padding: 2px 5px 2px 5px; font-weight: bold; } /* end of BibEdit module*/ /* WebAlert module */ .alrtTable{ border: 1px solid black; width: 100%; padding: 0px; border-collapse: collapse; } .alrtTable td{ border: 1px solid black; padding: 3px; } /* end of WebAlert module */ /* externalcollections */ .externalcollectionsbox { color: #333; background: #fffbf5; text-align: left; margin-left: auto; margin-right: auto; margin-top: 50px; padding: 10px; font-size: small; border-collapse: collapse; border-top: 1px solid #fc0; } .externalcollectionsboxheader { color: #333; background: #ffeacc; font-weight: normal; font-size: small; vertical-align: top; } .externalcollectionsboxbody { color: #333; background: ##fffbf5; padding: 0px 5px 0px 5px; font-size: small; text-align: left; vertical-align: top; } .externalcollectionsresultsbox { color: #000; background: #fffbf5; padding: 0px; margin-top: 15px; border-collapse: collapse; border-top: 1px solid #fc0; width: 100%; } .externalcollectionsresultsboxheader { color: #000; background: #ffeacc; padding: 2px; border-spacing: 0px; text-align: left; font-weight: normal; } .externalcollectionsresultsboxbody { color: #000; background: #fffbf5; border-top: 1px dotted #fc0; border-bottom: 1px dotted #fc0; padding: 2px; } .externalcollectionsresultsboxrecords { color: #000; background: transparent; margin-left: 0px; margin-right: 20px; } /* Start 'detailed record' boxes*/ div.detailed, div.mini-panel { width:90%; margin:auto; position:relative; max-width: 1280px; } div.detailed div.content { position:relative; top:1em; } div.detailed img, div.mini-panel img{ border:none; } div.detailed div.content, div.mini-panel { /* Should be removed for future CERN style*/ border: 1px solid #36c; padding-top:3px; padding-bottom:3px; } div.mini-panel{ /* Should be removed for future CERN style*/ background-color:#F2F2FD; background-image: url(mini_panel_background.gif); } .notopgap { margin: 0; height:0;} .nobottomgap { margin-bottom: 0; height:0;} /* CERN-specific style div.detailed .inside, div.mini-panel .inside{ border-left: 1px solid #B2B2B2; border-right: 1px solid #B2B2B2; background: #FFF url(gradient-lightgray-1x100.gif) repeat-x left top; color: #000000; padding-left: 0px; padding-right:0px; } */ /* mini-panel in detailed record pages*/ /* Future CERN-specific style -.top-left, .top-right, .bottom-left, .bottom-right { +.top-left, .top-right, .bottom-left, .bottom-right { background-image: url(rcorners-gray-1280x18.gif); height: 9px; font-size: 2px; } -.top-left, .bottom-left { +.top-left, .bottom-left { margin-right: 9px; } -.top-right, .bottom-right { +.top-right, .bottom-right { margin-left: 9px; margin-top: -9px; } .top-right { background-position: 100% 0; } -.bottom-left { +.bottom-left { background-position: 0 -9px; } -.bottom-right { +.bottom-right { background-position: 100% -9px; } */ - -/* Detailed record box */ -.top-left-folded { + +/* Detailed record box */ +.top-left-folded { height: 10px; } /* Future CERN-specific style -.top-left-folded, .top-right-folded, .bottom-left-folded, .bottom-right-folded { +.top-left-folded, .top-right-folded, .bottom-left-folded, .bottom-right-folded { background-image: url(rcorners-gray-1280x60-folded.gif); height: 30px; font-size: 2px; } -.top-left-folded, .bottom-left-folded { +.top-left-folded, .bottom-left-folded { margin-right: 21px; } -.top-right-folded, .bottom-right-folded { +.top-right-folded, .bottom-right-folded { margin-left: 21px; margin-top: -30px; } .top-right-folded { background-position: 100% 0; } -.bottom-left-folded { +.bottom-left-folded { background-position: 0 -30px; } .bottom-right-folded { background-position: 100% -30px; } */ /* tabs as used in detailed record pages */ ul.tabs{ margin-top:5px; margin-bottom:5px; list-style-type:none; text-align:center; } .tabs li{ display:inline; } .tabs li a{ border-top: 1px solid #36c; border-right: 1px solid #36c; border-bottom: 1px solid #36c; border-left: none; background-color: #FFF; padding:4px; color:#36c; font-size:x-small; font-weight:bold; text-decoration:none; zoom:100%; /*We loose CSS validity here, but necessary because of ie7*/ } .tabs li.on a{ background-color: #36c; color: #FFF } .tabs li.disabled a{ color:#ccf; cursor:default; } .tabs li.first a{ border-left: 1px solid #36c; -} +} /*Future CERN-specific style ul.tabs{ margin-top:5px; margin-bottom:5px; list-style-type:none; text-align:center; } .tabs li{ display:inline; -} +} .tabs li a{ border-top: 1px solid #B2B2B2; border-right: 1px solid #B2B2B2; border-bottom: 1px solid #B2B2B2; border-left: none; background: #EBEBEB url(gradient_tab-gray-1x23.gif) repeat-x left top; padding:4px; color:#000; text-decoration:none; zoom:100%; } .tabs li.on a{ background: #D6D6D6 url(gradient_tab_on-gray-1x23.gif) repeat-x left top; } .tabs li.disabled a{ color:#999; cursor:default } .tabs li.first a{ border-left: 1px solid #B2B2B2; -} +} */ /* Actions in mini-box in detailed view */ ul.detailedRecordActions{ list-style-image: url(arrow_link-icon-15x11-right.gif) ; padding-left: 1em; text-align:left; margin:0.05em; } .detailedRecordActions, .detailedRecordActions a{ text-decoration:none; color:#555; font-weight:700; font-size:small; } /* Grading stars for mini-panel in detailed view*/ div.mini-panel div.star a{ text-indent:-9000px; /*Hide text*/ height:30px; width:30px; float:left; } div.mini-panel div.star{ height:30px !important; float:left; clear:none; width:auto; text-align:left; - background:url(star_dot-icon-30x30.gif) no-repeat; + background:url(star_empty-icon-30x30.gif) no-repeat; } div.mini-panel div.star:hover{ + background-image:url(star-icon-30x30.gif) !important; +} +div.mini-panel:hover div.full, div.mini-panel:hover div.half{ + background-image:url(star_empty-icon-30x30.gif) ; +} +div.mini-panel div.full{ background-image:url(star-icon-30x30.gif) ; } +div.mini-panel div.half{ + background-image:url(star_half-icon-30x30.gif) ; +} /* Short bib notice displayed as sheet of paper in detailed record pages */ #commentHB { background: #fff url(paper-texture-128x128.gif) repeat top left; padding:4px; border-bottom: 1px solid #CCC; border-right: 1px solid #CCC; border-top: 1px solid #DDD; border-left: 1px solid #DDD; } #commentHB #clip { position:relative; clear:none; float:left; left: -45px; top:-15px; height:72px; width:72px; background: transparent url(paper_clip-72x72.gif) no-repeat top left; } #commentHB #HB{ position:relative; left: -50px; } /* end detailed record page*/ /* end of cds.css */ diff --git a/modules/webstyle/img/star_empty-icon-30x30.gif b/modules/webstyle/img/star_empty-icon-30x30.gif new file mode 100644 index 000000000..0095d516f Binary files /dev/null and b/modules/webstyle/img/star_empty-icon-30x30.gif differ diff --git a/modules/webstyle/img/star_half-icon-30x30.gif b/modules/webstyle/img/star_half-icon-30x30.gif new file mode 100644 index 000000000..5c3ad5426 Binary files /dev/null and b/modules/webstyle/img/star_half-icon-30x30.gif differ