##// END OF EJS Templates
gists: removed private/public gist buttons and replaced them with radio group...
marcink -
r4083:ca52deba default
parent child Browse files
Show More
@@ -159,7 +159,7 b' class TestGistsController(TestController'
159 params={'lifetime': -1,
159 params={'lifetime': -1,
160 'content': 'gist test',
160 'content': 'gist test',
161 'filename': 'foo',
161 'filename': 'foo',
162 'public': 'public',
162 'gist_type': 'public',
163 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
163 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
164 'csrf_token': self.csrf_token},
164 'csrf_token': self.csrf_token},
165 status=302)
165 status=302)
@@ -174,7 +174,7 b' class TestGistsController(TestController'
174 params={'lifetime': -1,
174 params={'lifetime': -1,
175 'content': 'gist test',
175 'content': 'gist test',
176 'filename': '/home/foo',
176 'filename': '/home/foo',
177 'public': 'public',
177 'gist_type': 'public',
178 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
178 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
179 'csrf_token': self.csrf_token},
179 'csrf_token': self.csrf_token},
180 status=200)
180 status=200)
@@ -197,7 +197,7 b' class TestGistsController(TestController'
197 params={'lifetime': -1,
197 params={'lifetime': -1,
198 'content': 'private gist test',
198 'content': 'private gist test',
199 'filename': 'private-foo',
199 'filename': 'private-foo',
200 'private': 'private',
200 'gist_type': 'private',
201 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
201 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
202 'csrf_token': self.csrf_token},
202 'csrf_token': self.csrf_token},
203 status=302)
203 status=302)
@@ -216,7 +216,7 b' class TestGistsController(TestController'
216 params={'lifetime': -1,
216 params={'lifetime': -1,
217 'content': 'private gist test',
217 'content': 'private gist test',
218 'filename': 'private-foo',
218 'filename': 'private-foo',
219 'private': 'private',
219 'gist_type': 'private',
220 'gist_acl_level': Gist.ACL_LEVEL_PRIVATE,
220 'gist_acl_level': Gist.ACL_LEVEL_PRIVATE,
221 'csrf_token': self.csrf_token},
221 'csrf_token': self.csrf_token},
222 status=302)
222 status=302)
@@ -236,7 +236,7 b' class TestGistsController(TestController'
236 'content': 'gist test',
236 'content': 'gist test',
237 'filename': 'foo-desc',
237 'filename': 'foo-desc',
238 'description': 'gist-desc',
238 'description': 'gist-desc',
239 'public': 'public',
239 'gist_type': 'public',
240 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
240 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
241 'csrf_token': self.csrf_token},
241 'csrf_token': self.csrf_token},
242 status=302)
242 status=302)
@@ -252,7 +252,7 b' class TestGistsController(TestController'
252 'content': 'gist test',
252 'content': 'gist test',
253 'filename': 'foo-desc',
253 'filename': 'foo-desc',
254 'description': 'gist-desc',
254 'description': 'gist-desc',
255 'public': 'public',
255 'gist_type': 'public',
256 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
256 'gist_acl_level': Gist.ACL_LEVEL_PUBLIC,
257 'csrf_token': self.csrf_token
257 'csrf_token': self.csrf_token
258 }
258 }
@@ -153,14 +153,19 b' class GistView(BaseAppView):'
153
153
154 data = dict(self.request.POST)
154 data = dict(self.request.POST)
155 data['filename'] = data.get('filename') or Gist.DEFAULT_FILENAME
155 data['filename'] = data.get('filename') or Gist.DEFAULT_FILENAME
156
156 data['nodes'] = [{
157 data['nodes'] = [{
157 'filename': data['filename'],
158 'filename': data['filename'],
158 'content': data.get('content'),
159 'content': data.get('content'),
159 'mimetype': data.get('mimetype') # None is autodetect
160 'mimetype': data.get('mimetype') # None is autodetect
160 }]
161 }]
162 gist_type = {
163 'public': Gist.GIST_PUBLIC,
164 'private': Gist.GIST_PRIVATE
165 }.get(data.get('gist_type')) or Gist.GIST_PRIVATE
161
166
162 data['gist_type'] = (
167 data['gist_type'] = gist_type
163 Gist.GIST_PUBLIC if data.get('public') else Gist.GIST_PRIVATE)
168
164 data['gist_acl_level'] = (
169 data['gist_acl_level'] = (
165 data.get('gist_acl_level') or Gist.ACL_LEVEL_PRIVATE)
170 data.get('gist_acl_level') or Gist.ACL_LEVEL_PRIVATE)
166
171
@@ -429,6 +429,7 b' div.codeblock {'
429 line-height: inherit
429 line-height: inherit
430 }
430 }
431 }
431 }
432
432 .author {
433 .author {
433 clear: both;
434 clear: both;
434 vertical-align: middle;
435 vertical-align: middle;
@@ -273,6 +273,85 b' form.rcform {'
273
273
274 }
274 }
275
275
276 .rcform-element {
277
278 label { display: inline; border:none; padding:0; }
279 .label { display: none; }
280
281 label:not(#ie) {
282 cursor: pointer;
283 display: inline-block;
284 position: relative;
285 background: white;
286 border-radius: 4px;
287 box-shadow: none;
288
289 &:hover::after {
290 opacity: 0.5;
291 }
292 }
293
294 input[type="radio"],
295 input[type="checkbox"] {
296 padding: 0;
297 border: none;
298 }
299
300 input[type="radio"]:not(#ie),
301 input[type="checkbox"]:not(#ie) {
302 // Hide the input, but have it still be clickable
303 opacity: 0;
304 float: left;
305 height: 0;
306 width: 0;
307 margin: 0;
308 padding: 0;
309 }
310 input[type='radio'] + label:not(#ie),
311 input[type='checkbox'] + label:not(#ie) {
312 margin: 0;
313 clear: none;
314 }
315
316 input[type='radio'] + label:not(#ie) {
317 .circle (@form-radio-width,white);
318 float: left;
319 display: inline-block;
320 height: @form-radio-width;
321 width: @form-radio-width;
322 margin: 2px 2px 2px 0;
323 border: 1px solid @grey4;
324 background-color: white;
325 box-shadow: none;
326 text-indent: -9999px;
327 transition: none;
328
329 & + .label {
330 float: left;
331 margin-top: 7px
332 }
333 }
334
335 input[type='radio']:checked + label:not(#ie) {
336 margin: 0 0px 0 -2px;
337 padding: 3px;
338 border-style: double;
339 border-color: white;
340 border-width: thick;
341 background-color: @rcblue;
342 box-shadow: none;
343 }
344
345 fieldset {
346 .label:not(#ie) {
347 display: inline;
348 margin: 0 1em 0 .5em;
349 line-height: 1em;
350 }
351 }
352
353 }
354
276 .badged-field {
355 .badged-field {
277 .user-badge {
356 .user-badge {
278 line-height: 25px;
357 line-height: 25px;
@@ -802,6 +802,16 b' label {'
802 }
802 }
803 }
803 }
804
804
805 .gist-type-fields {
806 line-height: 30px;
807 height: 30px;
808
809 .gist-type-fields-wrapper {
810 vertical-align: middle;
811 display: inline-block;
812 line-height: 25px;
813 }
814 }
805
815
806 // ADMIN SETTINGS
816 // ADMIN SETTINGS
807
817
@@ -57,9 +57,28 b''
57 </div>
57 </div>
58
58
59 <div class="pull-right">
59 <div class="pull-right">
60 <i class="tooltip icon-info" title="${_('Secret gists are hidden from listing, but accessible to anyone who knows the url.')}"></i>
60 ##<i class="tooltip icon-info" title="${_('Secret gists are hidden from listing, but accessible to anyone who knows the url.')}"></i>
61 ${h.submit('private',_('Create Private Gist'),class_="btn")}
61
62 ${h.submit('public',_('Create Public Gist'),class_="btn")}
62 <div class="pull-right">
63 ${h.submit('create',_('Create Gist'),class_="btn")}
64 </div>
65 <div class="rcform-element pull-right">
66 <div class="fields gist-type-fields">
67 <fieldset>
68 <div class="gist-type-fields-wrapper">
69
70 <input type="radio" id="private_gist" checked="" name="gist_type" value="private">
71 <label for="private_gist">${_('Private Gist')}</label>
72 <span class="tooltip label" title="${_('Private Gists are not listed and only accessible through their secret url.')}">${_('Private Gist')}</span>
73
74 <input type="radio" id="public_gist" name="gist_type" value="public">
75 <label for="public_gist">${_('Public Gist')}</label>
76 <span class="tooltip label" title="${_('Public Gists are accessible to anyone and listed in Gists page.')}">${_('Public Gist')}</span>
77 </div>
78 </fieldset>
79 </div>
80 </div>
81
63 </div>
82 </div>
64 ${h.end_form()}
83 ${h.end_form()}
65 </div>
84 </div>
General Comments 0
You need to be logged in to leave comments. Login now