Skip to content

Commit

Permalink
[#1262] fix pull request issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kindly committed Nov 4, 2013
1 parent 8c7329c commit 8b15c79
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
4 changes: 0 additions & 4 deletions ckan/controllers/group.py
Expand Up @@ -7,7 +7,6 @@
from urllib import urlencode

from pylons.i18n import get_lang
from pylons import config

import ckan.lib.base as base
import ckan.lib.helpers as h
Expand Down Expand Up @@ -462,7 +461,6 @@ def edit(self, id, data=None, errors=None, error_summary=None):

group = context.get("group")
c.group = group
context.pop('for_edit')
c.group_dict = self._action('group_show')(context, data_dict)

try:
Expand Down Expand Up @@ -521,8 +519,6 @@ def _force_reindex(self, grp):

def _save_edit(self, id, context):
try:
old_group = self._action('group_show')(context, {"id": id})
old_image_url = old_group.get('image_url')
data_dict = clean_dict(dict_fns.unflatten(
tuplize_dict(parse_params(request.params))))
context['message'] = data_dict.get('log_message', '')
Expand Down
78 changes: 41 additions & 37 deletions ckan/public/base/css/main.css
Expand Up @@ -49,16 +49,12 @@ sub {
}
img {
/* Responsive images (ensure images don't scale beyond their parents) */

max-width: 100%;
/* Part 1: Set a maxium relative to the parent */

width: auto\9;
/* IE7-8 need help adjusting responsive images */

height: auto;
/* Part 2: Scale the height according to the width, otherwise you get stretching */

vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
Expand Down Expand Up @@ -153,7 +149,7 @@ textarea {
img {
max-width: 100% !important;
}
@page {
@page {
margin: 0.5cm;
}
p,
Expand Down Expand Up @@ -693,7 +689,6 @@ ol.inline > li {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
padding-left: 5px;
padding-right: 5px;
Expand Down Expand Up @@ -972,7 +967,6 @@ input[type="color"]:focus,
outline: 0;
outline: thin dotted \9;
/* IE6-9 */

-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
Expand All @@ -982,10 +976,8 @@ input[type="checkbox"] {
margin: 4px 0 0;
*margin-top: 0;
/* IE7 */

margin-top: 1px \9;
/* IE8-9 */

line-height: normal;
}
input[type="file"],
Expand All @@ -1001,10 +993,8 @@ select,
input[type="file"] {
height: 30px;
/* In IE7, the height of the select element cannot be changed by height, only font-size */

*margin-top: 4px;
/* For IE7, add top margin to align select with labels */

line-height: 30px;
}
select {
Expand Down Expand Up @@ -1402,7 +1392,6 @@ select:focus:invalid:focus {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
vertical-align: middle;
padding-left: 5px;
Expand Down Expand Up @@ -1553,7 +1542,6 @@ input.search-query {
padding-left: 14px;
padding-left: 4px \9;
/* IE7-8 doesn't have border-radius, so don't indent the padding */

margin-bottom: 0;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
Expand Down Expand Up @@ -1610,7 +1598,6 @@ input.search-query {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
margin-bottom: 0;
vertical-align: middle;
Expand Down Expand Up @@ -2220,7 +2207,6 @@ button.close {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
padding: 4px 12px;
margin-bottom: 0;
Expand All @@ -2243,7 +2229,6 @@ button.close {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #eaeaea;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
border: 1px solid #cccccc;
*border: 0;
Expand Down Expand Up @@ -2379,7 +2364,6 @@ input[type="button"].btn-block {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #085871;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-primary:hover,
Expand Down Expand Up @@ -2411,7 +2395,6 @@ input[type="button"].btn-block {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #f89406;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-warning:hover,
Expand Down Expand Up @@ -2443,7 +2426,6 @@ input[type="button"].btn-block {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #bd362f;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-danger:hover,
Expand Down Expand Up @@ -2475,7 +2457,6 @@ input[type="button"].btn-block {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #51a351;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-success:hover,
Expand Down Expand Up @@ -2507,7 +2488,6 @@ input[type="button"].btn-block {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #2f96b4;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-info:hover,
Expand Down Expand Up @@ -2539,7 +2519,6 @@ input[type="button"].btn-block {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #222222;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-inverse:hover,
Expand Down Expand Up @@ -2614,7 +2593,6 @@ input[type="submit"].btn.btn-mini {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
font-size: 0;
vertical-align: middle;
Expand Down Expand Up @@ -2790,7 +2768,6 @@ input[type="submit"].btn.btn-mini {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
}
.btn-group-vertical > .btn {
Expand Down Expand Up @@ -3487,7 +3464,6 @@ input[type="submit"].btn.btn-mini {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #e5e5e5;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);
Expand Down Expand Up @@ -3721,7 +3697,6 @@ input[type="submit"].btn.btn-mini {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #040404;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.navbar-inverse .btn-navbar:hover,
Expand Down Expand Up @@ -3751,7 +3726,6 @@ input[type="submit"].btn.btn-mini {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
text-shadow: 0 1px 0 #ffffff;
}
Expand All @@ -3769,7 +3743,6 @@ input[type="submit"].btn.btn-mini {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
margin-left: 0;
margin-bottom: 0;
Expand Down Expand Up @@ -3970,7 +3943,6 @@ input[type="submit"].btn.btn-mini {
border: 1px solid rgba(0, 0, 0, 0.3);
*border: 1px solid #999;
/* IE6-7 */

-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
Expand Down Expand Up @@ -5828,7 +5800,6 @@ textarea {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #085871;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */

filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.control-custom.disabled .checkbox.btn:hover,
Expand Down Expand Up @@ -6107,7 +6078,6 @@ textarea {
outline: 0;
outline: thin dotted \9;
/* IE6-9 */

-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
Expand All @@ -6130,6 +6100,43 @@ textarea {
-moz-box-shadow: none;
box-shadow: none;
}
.js .image-upload #field-image-upload {
cursor: pointer;
position: absolute;
z-index: 1;
opacity: 0;
filter: alpha(opacity=0);
}
.js .image-upload .controls {
position: relative;
}
.js .image-upload .btn {
position: relative;
top: 0;
margin-right: 10px;
}
.js .image-upload .btn.hover {
color: #333333;
text-decoration: none;
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
.js .image-upload .btn-remove-url {
position: absolute;
margin-right: 0;
top: 4px;
right: 5px;
padding: 0 4px;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
}
.js .image-upload .btn-remove-url .icon-remove {
margin-right: 0;
}
.dataset-item {
border-bottom: 1px dotted #dddddd;
padding-bottom: 20px;
Expand Down Expand Up @@ -6516,7 +6523,6 @@ textarea {
margin-right: 5px;
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
}
.actions li:last-of-type {
Expand Down Expand Up @@ -7925,9 +7931,9 @@ h4 small {
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
-webkit-box-shadow: inset 0 1px 2 x rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 2 x rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 2 x rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 2x rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 2x rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 2x rgba(0, 0, 0, 0.2);
}
.popover-followee .nav li a:hover i {
background-color: #000;
Expand Down Expand Up @@ -8162,7 +8168,6 @@ iframe {
.ie7 .control-custom .checkbox {
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
}
.ie7 .stages {
Expand Down Expand Up @@ -8196,7 +8201,6 @@ iframe {
.ie7 .masthead nav {
*display: inline;
/* IE7 inline-block hack */

*zoom: 1;
}
.ie7 .masthead .header-image {
Expand Down
6 changes: 3 additions & 3 deletions ckan/templates/macros/form.html
Expand Up @@ -405,12 +405,12 @@
#}
{% macro image_upload(data, errors, field_url='image_url', field_upload='image_upload', field_clear='clear_upload', image_url=false, is_upload_enabled=false, placeholder=false) %}
{% set placeholder = placeholder if placeholder else _('http://example.com/my-image.jpg') %}
{% set has_uploaded_data = data.image_url and not data.image_url.startswith('http') %}
{% set is_url = data.image_url and data.image_url.startswith('http') %}
{% set has_uploaded_data = data.get(field_url) and not data[field_url].startswith('http') %}
{% set is_url = data.get(field_url) and data[field_url].startswith('http') %}

{% if is_upload_enabled %}<div class="image-upload" data-module="image-upload" data-module-is_url="{{ 'true' if is_url else 'false' }}" data-module-image_url="{{ image_url }}">{% endif %}

{{ input(field_url, label=_('Image URL'), id='field-image-url', placeholder=placeholder, value=data.image_url, error=errors.image_url, classes=['control-full']) }}
{{ input(field_url, label=_('Image URL'), id='field-image-url', placeholder=placeholder, value=data.get(field_url), error=errors.get(field_url), classes=['control-full']) }}

{% if is_upload_enabled %}
{{ input(field_upload, label=_('Image Upload'), id='field-image-upload', type='file', placeholder='', value='', error='', classes=['control-full']) }}
Expand Down

0 comments on commit 8b15c79

Please sign in to comment.