Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
problem-builder
Commits
b7941017
Commit
b7941017
authored
Jan 23, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
html-css-review: Add description for table background for accessibility
parent
f530f2bc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
0 deletions
+30
-0
mentoring/table.py
+11
-0
static/css/mentoring-table.css
+12
-0
static/text/table-immunity-map-assumptions.txt
+3
-0
static/text/table-immunity-map.txt
+3
-0
templates/html/mentoring-table.html
+1
-0
No files found.
mentoring/table.py
View file @
b7941017
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
# Imports ###########################################################
# Imports ###########################################################
import
errno
import
logging
import
logging
from
xblock.core
import
XBlock
from
xblock.core
import
XBlock
...
@@ -56,11 +57,21 @@ class MentoringTableBlock(XBlock, XBlockWithChildrenFragmentsMixin):
...
@@ -56,11 +57,21 @@ class MentoringTableBlock(XBlock, XBlockWithChildrenFragmentsMixin):
# TODO: What's the right way to link to images from CSS? This hack won't work in prod
# TODO: What's the right way to link to images from CSS? This hack won't work in prod
bg_image_url
=
self
.
runtime
.
resources_url
(
'mentoring/img/{}-bg.png'
.
format
(
self
.
type
))
bg_image_url
=
self
.
runtime
.
resources_url
(
'mentoring/img/{}-bg.png'
.
format
(
self
.
type
))
# Load an optional description for the background image, for accessibility
try
:
bg_image_description
=
load_resource
(
'static/text/table-{}.txt'
.
format
(
self
.
type
))
except
IOError
as
e
:
if
e
.
errno
==
errno
.
ENOENT
:
bg_image_description
=
''
else
:
raise
fragment
.
add_content
(
render_template
(
'templates/html/mentoring-table.html'
,
{
fragment
.
add_content
(
render_template
(
'templates/html/mentoring-table.html'
,
{
'self'
:
self
,
'self'
:
self
,
'columns_frags'
:
columns_frags
,
'columns_frags'
:
columns_frags
,
'header_frags'
:
header_frags
,
'header_frags'
:
header_frags
,
'bg_image_url'
:
bg_image_url
,
'bg_image_url'
:
bg_image_url
,
'bg_image_description'
:
bg_image_description
,
}))
}))
fragment
.
add_css
(
load_resource
(
'static/css/mentoring-table.css'
))
fragment
.
add_css
(
load_resource
(
'static/css/mentoring-table.css'
))
fragment
.
add_javascript
(
load_resource
(
'static/js/vendor/jquery.shorten.js'
))
fragment
.
add_javascript
(
load_resource
(
'static/js/vendor/jquery.shorten.js'
))
...
...
static/css/mentoring-table.css
View file @
b7941017
...
@@ -35,3 +35,15 @@
...
@@ -35,3 +35,15 @@
.mentoring-table
h3
,
.mentoring-table
h4
{
.mentoring-table
h3
,
.mentoring-table
h4
{
margin
:
0
0
5px
;
margin
:
0
0
5px
;
}
}
/* Hidden elements - Screenreaders */
.mentoring-table
.cont-text-sr
{
border
:
0
;
clip
:
rect
(
0
0
0
0
);
height
:
1px
;
margin
:
-1px
;
overflow
:
hidden
;
padding
:
0
;
position
:
absolute
;
width
:
1px
;
}
static/text/table-immunity-map-assumptions.txt
0 → 100644
View file @
b7941017
On the table background, an arrow goes from column 1 (My Improvement Goal), to
column 3 (My Hidden Commitments). A second arrow goes back from column 3 to
column 1. A third arrow goes from column 4 (My Big Assumptions) to column 3.
static/text/table-immunity-map.txt
0 → 100644
View file @
b7941017
On the table background, an arrow goes from column 1 (My Improvement Goal), to
column 3 (My Hidden Commitments). A second arrow goes back from column 3 to
column 1.
templates/html/mentoring-table.html
View file @
b7941017
<div
class=
"mentoring-table {{ self.type }}"
style=
"background-image: url({{ bg_image_url }})"
>
<div
class=
"mentoring-table {{ self.type }}"
style=
"background-image: url({{ bg_image_url }})"
>
<div
class=
"cont-text-sr"
>
{{ bg_image_description }}
</div>
<table>
<table>
{% if header_frags %}
{% if header_frags %}
<thead>
<thead>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment