Dénote

Dénote Commit Details

Date:2015-10-12 18:05:07 (3 years 2 months ago)
Author:Grégory Soutadé
Branch:master
Commit:f48b0516dfe8eebc216ec886b79a19409356c47a
Parents: 46082b8dcbd8b718403054a250ea88ab7103b917
Message:Edit note with right click Remove default parameters (thanks Chrome...) Add number of registered people

Changes:
Mdenote/static/js/denote.js (5 diffs)
Mdenote/templates/base_user.html (3 diffs)
Mdenote/templates/login.html (1 diff)
Mdenote/templates/user_index.html (1 diff)
Mdenote/views.py (1 diff)

File differences

denote/static/js/denote.js
2626
2727
2828
29
29
3030
3131
3232
......
6464
6565
6666
67
67
6868
69
70
69
70
7171
7272
7373
7474
7575
7676
77
77
7878
79
79
8080
81
81
8282
8383
8484
......
115115
116116
117117
118
119
118120
119121
120122
121123
122
123
124
125
124126
125127
126128
......
129131
130132
131133
132
133
134
135
134136
135137
136138
......
157159
158160
159161
160
161
162
163
164
162
163
164
165
166
165167
166168
167169
168170
169171
170
171
172
173
172174
173175
174
176
177
178
179
180
181
175182
return null;
}
function set_visible(id, visible, display="block")
function set_visible(id, visible, display)
{
widget = document.getElementById(id);
if (visible)
setPreference('hidden_categories', hidden_categories.join(","));
}
function hide_category(cat_id, update_cookie=true)
function hide_category(cat_id, update_cookie)
{
set_visible("content_" + cat_id, false);
set_visible("minus_" + cat_id, false);
set_visible("content_" + cat_id, false, "");
set_visible("minus_" + cat_id, false, "");
set_visible("plus_" + cat_id, true, "inline-block");
if (update_cookie)
updateHiddenCategories(cat_id, true);
}
function show_category(cat_id, update_cookie=true)
function show_category(cat_id, update_cookie)
{
set_visible("content_" + cat_id, true);
set_visible("content_" + cat_id, true, "block");
set_visible("minus_" + cat_id, true, "inline-block");
set_visible("plus_" + cat_id, false);
set_visible("plus_" + cat_id, false, "");
if (update_cookie)
updateHiddenCategories(cat_id, false);
function startup()
{
category_setup();
if (location.search.search('edit_note') != -1)
edit_note();
}
function edit_category(cat_id, name)
{
set_visible("category_" + cat_id, false);
set_visible("edit_category_" + cat_id, true);
set_visible("category_" + cat_id, false, "");
set_visible("edit_category_" + cat_id, true, "block");
input = document.getElementById("cat_name_" + cat_id);
input.value = name;
function end_edit_category(cat_id)
{
set_visible("category_" + cat_id, true);
set_visible("edit_category_" + cat_id, false);
set_visible("category_" + cat_id, true, "block");
set_visible("edit_category_" + cat_id, false, "");
}
function submit_category_name(cat_id, orig)
function edit_note()
{
document.body.scrollTop = document.documentElement.scrollTop = 0;
set_visible("title", false);
set_visible("transformed_content", false);
set_visible("edit_button", false);
set_visible("form_delete", false);
set_visible("div_edit", true);
set_visible("title", false, "");
set_visible("transformed_content", false, "");
set_visible("edit_button", false, "");
set_visible("form_delete", false, "");
set_visible("div_edit", true, "block");
}
function cancel_edit_note()
{
document.body.scrollTop = document.documentElement.scrollTop = 0;
set_visible("title", true);
set_visible("transformed_content", true);
set_visible("title", true, "block");
set_visible("transformed_content", true, "block");
set_visible("edit_button", true, "inline");
set_visible("form_delete", true, "inline");
set_visible("div_edit", false);
set_visible("div_edit", false, "");
}
function DoEdit(url) {
window.location.href = '/note/' + url + '?edit_note=1';
return false;
}
denote/templates/base_user.html
2323
2424
2525
26
26
2727
2828
2929
......
3434
3535
3636
37
37
3838
3939
4040
......
4545
4646
4747
48
48
4949
5050
5151
52
52
5353
5454
5555
{% for meta_note in notes_by_category %}
<div class="category" category_id="{{ meta_note.category_id }}">
<div id="category_{{ meta_note.category_id }}" class="name" ondblclick="edit_category({{ meta_note.category_id }}, '{{ meta_note.category }}')">
<img id="minus_{{ meta_note.category_id }}" src="{{ STATIC_URL }}images/denote_minus.png" onclick="hide_category({{ meta_note.category_id }});"/><img id="plus_{{ meta_note.category_id }}" src="{{ STATIC_URL }}images/denote_plus.png" onclick="show_category({{ meta_note.category_id }});"/>{{ meta_note.category }} ({{ meta_note.notes|length }})
<img id="minus_{{ meta_note.category_id }}" src="{{ STATIC_URL }}images/denote_minus.png" onclick="hide_category({{ meta_note.category_id }},true);"/><img id="plus_{{ meta_note.category_id }}" src="{{ STATIC_URL }}images/denote_plus.png" onclick="show_category({{ meta_note.category_id }},true);"/>{{ meta_note.category }} ({{ meta_note.notes|length }})
</div>
<div class="edit_category" id="edit_category_{{ meta_note.category_id }}">
<form id="form_edit_category_{{ meta_note.category_id }}" action="/category/edit/{{ meta_note.category_id }}" method="post" onsubmit="return submit_category_name({{ meta_note.category_id }}, '{{ meta_note.category }}');">
<div id="content_{{ meta_note.category_id }}" class="content" >
{% for note in meta_note.notes %}
<div class="note">
<a href="/note/{{ note.id}}"><div class="title">{{ note.title }}</div></a>
<a href="/note/{{ note.id}}" oncontextmenu="return DoEdit('{{ note.id}}');"><div class="title">{{ note.title }}</div></a>
<div class="date">{{ note.created_date }}</div>
<div class="summary">{{ note.short_summary }}</div>
</div>
{% if notes_without_category|length != 0 %}
<div class="category" category_id="-1">
<div id="category_-1" class="name">
<img id="minus_-1" src="{{ STATIC_URL }}images/denote_minus.png" onclick="hide_category(-1);"/><img id="plus_-1" src="{{ STATIC_URL }}images/denote_plus.png" onclick="show_category(-1);"/>Other ({{ notes_without_category|length }})</div>
<img id="minus_-1" src="{{ STATIC_URL }}images/denote_minus.png" onclick="hide_category(-1,true);"/><img id="plus_-1" src="{{ STATIC_URL }}images/denote_plus.png" onclick="show_category(-1,true);"/>Other ({{ notes_without_category|length }})</div>
<div id="content_-1" class="content">
{% for note in notes_without_category %}
<div class="note">
<a href="/note/{{ note.id}}"><div class="title">{{ note.title }}</div></a>
<a href="/note/{{ note.id}}" oncontextmenu="return DoEdit('{{ note.id}}');"><div class="title">{{ note.title }}</div></a>
<div class="date">{{ note.created_date }}</div>
<div class="summary">{{ note.short_summary }}</div>
</div>
denote/templates/login.html
2626
2727
2828
29
29
3030
3131
3232
<tr><td>Login</td><td><input type="text" name="login"/></td></tr>
<tr><td>Password</td><td><input id="password" type="password" name="password"/></td></tr>
<tr><td/><td><input type="submit" value="Connect"/></td></tr>
<tr><td/><td><a href="/user/add">Create an account</a></td></tr>
<tr><td/><td><a href="/user/add">Create an account</a><br/>(already {{ nb_people_registered }} people(s) registered)</td></tr>
</table>
</form>
</div>
denote/templates/user_index.html
44
55
66
7
7
88
9
9
1010
1111
1212
{% for note in notes %}
<div class="note">
{% if note.category != None %}
<div class="title"><a href="/note/{{ note.id }}">{{ note.title }} [{{ note.category.name }}]</a></div>
<div class="title"><a href="/note/{{ note.id}}" oncontextmenu="return DoEdit('{{ note.id}}');">{{ note.title }} [{{ note.category.name }}]</a></div>
{% else %}
<div class="title"><a href="/note/{{ note.id }}">{{ note.title }}</a></div>
<div class="title"><a href="/note/{{ note.id}}" oncontextmenu="return DoEdit('{{ note.id}}');">{{ note.title }}</a></div>
{% endif %}
<div class="date">{{ note.modified_date }}</div>
<div class="summary">{{ note.long_summary }}</div>
denote/views.py
4646
4747
4848
49
49
50
51
52
5053
5154
5255
else:
return user_home(request, request.user)
c = {'login_failed' : login_failed}
c = {
'login_failed' : login_failed,
'nb_people_registered' : User.objects.all().count()
}
return render(request, 'login.html', c)

Archive Download the corresponding diff file

Branches

Tags