Skip to content

Commit

Permalink
Issue #6: added back 'Subscribe Feed' bookmarklet.
Browse files Browse the repository at this point in the history
  • Loading branch information
passiomatic committed Mar 7, 2015
1 parent e1eb56d commit 129b2a2
Show file tree
Hide file tree
Showing 6 changed files with 3,439 additions and 14 deletions.
13 changes: 12 additions & 1 deletion coldsweat/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,21 @@ def feed_add_2(self):
# urls = self.request.POST.getall('feeds')
# for url in urls:
# pass

#@@TODO: validate feed
# try:
# response = fetch_url(self_link)
# except RequestException, exc:
# form_message = u'ERROR Error, feed address is incorrect or host is unreachable.'
# return self.respond_with_template('_feed_add_wizard_1.html', locals())

feed = self.add_feed_from_url(self_link, fetch_data=True)
return self._add_subscription(feed, group_id)

# def _parse_feed(self, self_link):
# feed = self.add_feed_from_url(self_link, fetch_data=False)
# ff = Fetcher(feed)
# ff.parse_feed(response.text)


def _add_subscription(self, feed, group_id):
if group_id:
Expand Down
8 changes: 0 additions & 8 deletions coldsweat/templates/_cheatsheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ <h2>Keyboard Shortcuts</h2>
</dl>


<!--
<hr>

<h2>Subscribe Feed Bookmarklet</h2>
<p>Drag the bookmarklet below to you browser toolbar and subscribe any feed with one click.</p>
<p><a href="javascript:location.href='{{application_url}}/feeds/add?self_link='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"><i class="fa fa-bookmark-o"></i> Subscribe Feed</a></p>
-->
<hr>

<h2>Sync with Your Reader</h2>

<p>Configure your favorite feed reader using your Coldsweat credentials and this web address:</p>
Expand Down
7 changes: 7 additions & 0 deletions coldsweat/templates/_feed_add_wizard_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ <h3>Add Feed Subscription</h3>
</div>
<div class="modal-body">
{{form_message|alert}}

<label for="self-link-field">Web address (URL) for the site or feed</label>
<input type="text" id="field-self-link" autofocus name="self_link" required size="40" value="{{self_link}}" placeholder="http://">
{{if length(groups) > 1}}
Expand All @@ -15,6 +16,12 @@ <h3>Add Feed Subscription</h3>
{{endfor}}
</select></label>
{{endif}}

<hr class="quarter">
<div>
<a href="javascript:window.open('{{application_url}}/feeds/add/1?self_link='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title))"><i class="fa fa-bookmark-o"></i> Subscribe Feed</a><br>
<span class="help-block">Drag bookmarklet to your browser toolbar and quickly subscribe to any feed.</span>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Continue</button>
Expand Down
4 changes: 2 additions & 2 deletions static/stylesheets/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@ $formplaceholdercolor : $lightneutralcolor;
// =help ============

// Set the colour for help text
$formhelpcolor : lighten($textcolor, 10%);
$formhelpcolor : $lightneutralcolor;

// And small text inside forms
$formsmallcolor : lighten($textcolor, 10%);
$formsmallcolor : $formhelpcolor;



Expand Down
Loading

0 comments on commit 129b2a2

Please sign in to comment.