Permalink
Browse files

Adding final fixes for beisel2.0 theme. Closes #563

  • Loading branch information...
1 parent a65a24c commit a35114601245ce096656711ee790f90d9712d817 @jmathai jmathai committed Apr 3, 2012
@@ -63,14 +63,17 @@ OPU = (function() {
},
UploadFile: function() {
- var uploader = $("#uploader").pluploadQueue(), license, permission, tags;
+ var uploader = $("#uploader").pluploadQueue(), license, permission, tags, groups;
license = $("form.upload select[name='license'] :selected").val();
tags = $("form.upload input[name='tags']").val();
permission = $("form.upload input[name='permission']:checked").val();
+ // http://stackoverflow.com/a/6116631
+ groups = $("form.upload input[name='groups[]']:checked").map(function () {return this.value;}).get().join(",");
uploader.settings.multipart_params.license = license;
uploader.settings.multipart_params.tags = tags;
uploader.settings.multipart_params.permission = permission;
+ uploader.settings.multipart_params.groups = groups;
}
}
});
Oops, something went wrong.
@@ -187,6 +187,9 @@ li.plupload_done a {
.plupload_scroll .plupload_filelist_header .plupload_file_action, .plupload_scroll .plupload_filelist_footer .plupload_file_action {
margin-right: 17px;
}
+a.plupload_button.plupload_start {
+ display:none !important;
+}
/* Floats */
@@ -337,7 +337,7 @@ var opTheme = (function() {
html = markup.modal(
'Edit this photo',
response.result.markup,
- '<a href="#" class="btn photo-update-click">Save</a>'
+ '<a href="#" class="btn btn-primary photo-update-click">Save</a>'
);
el.html(html).modal();
} else {
@@ -446,6 +446,10 @@ var opTheme = (function() {
}
$("#modal").modal('hide');
},
+ photosViewMore: function(ev) {
+ ev.preventDefault();
+ opTheme.init.pages.photos.load();
+ },
pinClick: function(ev) {
var el = $(ev.target),
id = el.attr('data-id');
@@ -591,6 +595,7 @@ var opTheme = (function() {
OP.Util.on('click:photo-update-batch', opTheme.callback.photoUpdateBatch);
OP.Util.on('click:photo-view', opTheme.callback.photoView);
OP.Util.on('click:photo-view-modal', opTheme.callback.photoViewModal);
+ OP.Util.on('click:photos-load-more', opTheme.callback.photosViewMore);
OP.Util.on('click:pin', opTheme.callback.pinClick);
OP.Util.on('click:pin-clear', opTheme.callback.pinClearClick);
OP.Util.on('click:search', opTheme.callback.searchByTags);
@@ -4032,6 +4032,9 @@ body.photos .infobar .date {
font-style:italic;
color:#e6501e;
}
+.load-more {
+ text-align:center;
+}
/* 09.03. Photos details ----------------------------------------------------------- */
/* 09.04. Tags ----------------------------------------------------------- */
body.tags div.tags .tag-list {
@@ -36,4 +36,7 @@
<?php } ?>
<div class="photo-grid-justify"></div>
<br clear="all">
+ <div class="load-more">
+ <button type="button" class="span2 btn btn-primary photos-load-more-click"><i class="icon-plus icon-large"></i> Load more</button>
+ </div>
</div>
@@ -25,10 +25,12 @@
<?php if($this->config->site->mode === 'dev') { ?>
<link href="<?php $this->theme->asset('stylesheet', 'bootstrap.min.css'); ?>" rel="stylesheet">
<link href="<?php $this->theme->asset('stylesheet', 'opme.css'); ?>" rel="stylesheet">
+ <link href="/assets/stylesheets/upload.css" rel="stylesheet">
<?php } else { ?>
<link rel="stylesheet" href="<?php echo getAssetPipeline(true)->addCss($this->theme->asset('stylesheet', 'bootstrap.min.css', false))->
+ addCss("/assets/stylesheets/upload.css")->
addCss($this->theme->asset('stylesheet', 'opme.css', false))->
- getUrl(AssetPipeline::css, 'i'); ?>">
+ getUrl(AssetPipeline::css, 'j'); ?>">
<?php } ?>
<?php if(!$this->plugin->isActive('BetterPageTitles')) { ?>
@@ -97,6 +99,7 @@
'photo-update-batch-click':'click:photo-update-batch',
'photo-view-click':'click:photo-view',
'photo-view-modal-click':'click:photo-view-modal',
+ 'photos-load-more-click':'click:photos-load-more',
'pin-click':'click:pin',
'pin-clear-click':'click:pin-clear',
'plugin-status-click':'click:plugin-status',
@@ -126,7 +129,7 @@
'/assets/javascripts/jquery.plupload.queue.js',
'/assets/javascripts/openphoto-upload.js',
<?php } else { ?>
- '<?php echo getAssetPipeline(true)->addJs('/assets/javascripts/openphoto-upload.min.js')->getUrl(AssetPipeline::js, 'f'); ?>',
+ '<?php echo getAssetPipeline(true)->addJs('/assets/javascripts/openphoto-upload.min.js')->getUrl(AssetPipeline::js, 'g'); ?>',
<?php } ?>
<?php } ?>
@@ -152,7 +155,7 @@
'<?php echo getAssetPipeline(true)->setMode(AssetPipeline::combined)->
addJs('/assets/javascripts/openphoto-helper.min.js')->
addJs($this->theme->asset('javascript', 'min/openphoto-theme-full.min.js', false))->
- getUrl(AssetPipeline::js, 'l'); ?>'
+ getUrl(AssetPipeline::js, 'm'); ?>'
<?php } ?>
],
onComplete: function(){
@@ -24,8 +24,9 @@ public function apps()
{
$credentialsResp = $this->api->invoke('/oauth/list.json');
$credentials = $credentialsResp['result'];
+ $navigation = $this->getNavigation('apps');
$bodyTemplate = sprintf('%s/manage-apps.php', $this->config->paths->templates);
- $body = $this->template->get($bodyTemplate, array('credentials' => $credentials, 'page' => 'apps', 'crumb' => getSession()->get('crumb')));
+ $body = $this->template->get($bodyTemplate, array('credentials' => $credentials, 'navigation' => $navigation, 'crumb' => getSession()->get('crumb')));
$this->theme->display('template.php', array('body' => $body, 'page' => 'manage-apps'));
}
@@ -48,18 +49,27 @@ public function home()
$pages['totalPages'] = $photos[0]['totalPages'];
$pages['requestUri'] = $_SERVER['REQUEST_URI'];
}
+ $pagination = $this->theme->get('partials/pagination.php', $pages);
+ $navigation = $this->getNavigation('home');
$bodyTemplate = sprintf('%s/manage.php', $this->config->paths->templates);
- $body = $this->template->get($bodyTemplate, array('photos' => $photos, 'pages' => $pages, 'page' => 'home', 'crumb' => getSession()->get('crumb')));
+ $body = $this->template->get($bodyTemplate, array('photos' => $photos, 'pagination' => $pagination, 'navigation' => $navigation, 'crumb' => getSession()->get('crumb')));
$this->theme->display('template.php', array('body' => $body, 'page' => 'manage'));
}
public function groups()
{
$groupsResp = $this->api->invoke('/groups/list.json');
$groups = $groupsResp['result'];
+ $navigation = $this->getNavigation('groups');
$bodyTemplate = sprintf('%s/manage-groups.php', $this->config->paths->templates);
- $body = $this->template->get($bodyTemplate, array('groups' => $groups, 'page' => 'groups', 'crumb' => getSession()->get('crumb')));
+ $body = $this->template->get($bodyTemplate, array('groups' => $groups, 'navigation' => $navigation, 'crumb' => getSession()->get('crumb')));
$this->theme->display('template.php', array('body' => $body, 'page' => 'manage-groups'));
}
+
+ private function getNavigation($page)
+ {
+ $tpl = sprintf('%s/manage-navigation.php', $this->config->paths->templates);
+ return $this->template->get($tpl, array('page' => $page));
+ }
}
@@ -1,13 +1,13 @@
<div class="manage credentials">
- <?php $this->theme->display('partials/manage-navigation.php', array('page' => $page)); ?>
+ <?php echo $navigation; ?>
<h3>Your OAuth Applications</h3>
<p>
You've granted these applications access to your OpenPhoto account. Clicking <strong>revoke</strong> cannot be undone and you may have to reapprove the application.
</p>
<p>
- <a href="/v1/oauth/authorize?oauth_callback=<?php $this->utility->safe(sprintf('%s://%s%s', $this->utility->getProtocol(false), $_SERVER['HTTP_HOST'], '/manage/apps/callback')); ?>&name=<?php $this->utility->safe(urlencode('Self Generated App')); ?>" class="btn">Create a new app</a>
+ <a href="/v1/oauth/authorize?oauth_callback=<?php $this->utility->safe(sprintf('%s://%s%s', $this->utility->getProtocol(false), $_SERVER['HTTP_HOST'], '/manage/apps/callback')); ?>&name=<?php $this->utility->safe(urlencode('Self Generated App')); ?>" class="btn btn-primary">Create a new app</a>
</p>
<table class="table well">
<thead>
@@ -1,6 +1,6 @@
<div class="manage groups">
- <?php $this->theme->display('partials/manage-navigation.php', array('page' => $page)); ?>
+ <?php echo $navigation; ?>
<form class="well" action="/group/create">
<h3>Create a new group</h3>
@@ -11,7 +11,7 @@
<input type="text" class="group-email-input">&nbsp;&nbsp;&nbsp;<a href="#" class="group-email-add-click">Add</a>
<ul class="group-emails-add-list unstyled">
</ul>
- <a class="btn group-post-click">Create</a>
+ <a class="btn btn-primary group-post-click">Create</a>
</form>
<?php foreach($groups as $group) { ?>
@@ -1,15 +1,19 @@
<div class="manage home">
- <?php $this->template->display(dirname(__FILE__).'/manage-navigation.php', array('page' => $page)); ?>
- <?php $this->theme->display('partials/pagination.php', $pages); ?>
+ <?php echo $navigation; ?>
- <ul class="thumbnails">
- <?php foreach($photos as $photo) { ?>
- <li class="span2">
- <img src="<?php $this->utility->safe($photo['path160x160xCR']); ?>" alt="<?php $this->utility->safe($photo['title']); ?>" class="thumbnail">
- <i class="icon-ok icon-large photo-<?php $this->utility->safe($photo['id']); ?> pin-click pin reveal" data-id="<?php $this->utility->safe($photo['id']); ?>"></i>
- <i class="icon-edit icon-large photo-<?php $this->utility->safe($photo['id']); ?> photo-edit-click edit reveal" data-id="<?php $this->utility->safe($photo['id']); ?>"></i>
- </li>
- <?php } ?>
- </ul>
+ <?php if($photos[0]['totalRows'] > 0) { ?>
+ <?php echo $pagination; ?>
+ <ul class="thumbnails">
+ <?php foreach($photos as $photo) { ?>
+ <li class="span2">
+ <img src="<?php $this->utility->safe($photo['path160x160xCR']); ?>" alt="<?php $this->utility->safe($photo['title']); ?>" class="thumbnail">
+ <i class="icon-ok icon-large photo-<?php $this->utility->safe($photo['id']); ?> pin-click pin reveal" data-id="<?php $this->utility->safe($photo['id']); ?>"></i>
+ <i class="icon-edit icon-large photo-<?php $this->utility->safe($photo['id']); ?> photo-edit-click edit reveal" data-id="<?php $this->utility->safe($photo['id']); ?>"></i>
+ </li>
+ <?php } ?>
+ </ul>
+ <?php } else { ?>
+ <?php $this->theme->display('partials/no-content.php'); ?>
+ <?php } ?>
</div>
@@ -7,7 +7,7 @@
<textarea name="description" id="description" placeholder="A description of the photo (typically longer than the title)"><?php $this->utility->safe($photo['description']); ?></textarea>
<label for="tags">Tags</label>
- <input type="text" name="tags" id="tags" class="tags-autocomplete" placeholder="A comma separated list of tags" value="<?php $this->utility->safe(implode(',', $photo['tags'])); ?>">
+ <input type="text" name="tags" id="tags" class="typeahead-tags" placeholder="A comma separated list of tags" value="<?php $this->utility->safe(implode(',', $photo['tags'])); ?>">
<label for="latitude">Latitude &amp; Longitude</label>
<input type="text" class="input-small" name="latitude" id="latitude" placeholder="Lat, i.e. 49.73" value="<?php $this->utility->safe($photo['latitude']); ?>">
@@ -7,69 +7,61 @@
<form class="upload form-stacked">
<div class="row">
- <div class="span5">
- <h2>Use these settings.</h2>
- <div class="clearfix">
- <label for="tags">Tags</label>
- <div class="input">
- <input type="text" name="tags" class="tags tags-autocomplete" placeholder="Optional comma separated list">
+ <div class="span8">
+ <div id="uploader">
+ <div class="insufficient">
+ <img src="<?php echo getTheme()->asset('image', 'error.png'); ?>">
+ <h1>Unfortunately, it doesn't look like we support your browser. :(</h1>
+ <p>
+ Try using <a href="http://www.mozilla.org/en-US/firefox/new/">Firefox</a>.
+ </p>
</div>
</div>
+ <em class="poweredby">Powered by <a href="http://www.plupload.com">Plupload</a>.</em>
+ </div>
+ <div class="span4">
+ <h2>Use these settings.</h2>
+ <label for="tags">Tags</label>
+ <input type="text" name="tags" class="typeahead-tags tags tags-autocomplete" placeholder="Optional comma separated list">
+
<?php if(count($groups) > 0) { ?>
<div class="control-group">
<label class="control-label">Groups</label>
- <div class="controls">
- <?php foreach($groups as $group) { ?>
- <label class="checkbox inline">
- <input type="checkbox" name="groups[]" value="<?php $this->utility->safe($group['id']); ?>">
- <?php $this->utility->safe($group['name']); ?>
- </label>
- <?php } ?>
- </div>
+ <?php foreach($groups as $group) { ?>
+ <label class="checkbox inline">
+ <input type="checkbox" name="groups[]" value="<?php $this->utility->safe($group['id']); ?>">
+ <?php $this->utility->safe($group['name']); ?>
+ </label>
+ <?php } ?>
</div>
<?php } ?>
- <div class="clearfix">
+
+ <div class="control-group">
<label for="tags">Permission</label>
- <div class="input">
- <ul class="inputs-list">
- <li>
- <label>
- <input type="radio" name="permission" value="1" checked="checked">
- <span>Public</span>
- </label>
- </li>
- <li>
- <label>
- <input type="radio" name="permission" value="0">
- <span>Private</span>
- </label>
- </li>
- </div>
- </div>
- <div class="clearfix">
- <label for="license">License</label>
- <div class="input">
- <select name="license" class="license">
- <?php foreach($licenses as $code => $license) { ?>
- <option value="<?php $this->utility->safe($code); ?>" <?php if($license['selected']) { ?> selected="selected" <?php } ?>><?php $this->utility->licenseName($code); ?></option>
- <?php } ?>
- </select>
+ <div class="controls">
+ <label class="radio inline">
+ <input type="radio" name="permission" value="1" checked="checked">
+ <span>Public</span>
+ </label>
+ <label class="radio inline">
+ <input type="radio" name="permission" value="0">
+ <span>Private</span>
+ </label>
</div>
</div>
+
+ <label for="license">License</label>
+ <select name="license" class="license">
+ <?php foreach($licenses as $code => $license) { ?>
+ <option value="<?php $this->utility->safe($code); ?>" <?php if($license['selected']) { ?> selected="selected" <?php } ?>><?php $this->utility->licenseName($code); ?></option>
+ <?php } ?>
+ </select>
+
<input type="hidden" name="crumb" value="<?php $this->utility->safe($crumb); ?>" class="crumb">
- </div>
- <div class="span10">
- <div id="uploader">
- <div class="insufficient">
- <img src="<?php echo getTheme()->asset('image', 'error.png'); ?>">
- <h1>Unfortunately, it doesn't look like we support your browser. :(</h1>
- <p>
- Try using <a href="http://www.mozilla.org/en-US/firefox/new/">Firefox</a>.
- </p>
- </div>
+
+ <div class="btn-toolbar">
+ <button type="button" class="btn btn-primary upload-start-click upload-button"><i class="icon-upload icon-large"></i> Start uploading</button>
</div>
- <button type="button" class="upload-start-click upload-button">Start uploading</button>
- <em class="poweredby">Powered by <a href="http://www.plupload.com">Plupload</a>.</em>
</div>
</div>
</form>

0 comments on commit a351146

Please sign in to comment.